android 经典下雨效果
英文原文地址:https://blog.stylingandroid.com/snowfall/
中文翻译地址:http://www.open-open.com/lib/view/open1452263908573.html
国外大神实现效果youtube视频地址:https://www.youtube.com/watch?v=pk66ZziTfOw
中文翻译是open开发者经验库一位作者翻译,翻译的很好。在那篇文章也能看到实现的最原始的效果。
实现漫天飞舞的雪花下载地址:http://download.csdn.net/detail/qq_16064871/9420804
实现下雨天效果的下载地址:http://download.csdn.net/detail/qq_16064871/9420808
1、漫天飞舞的雪花主要代码
SnowView
- <span style="font-size:14px;">package com.ex</span>ample.snowflake.view;
- import android.content.Context;
- import android.graphics.Canvas;
- import android.graphics.Color;
- import android.graphics.Paint;
- import android.util.AttributeSet;
- import android.view.View;
- /**
- * 雪花视图, DELAY时间重绘, 绘制NUM_SNOWFLAKES个雪花
- */
- public class SnowView extends View {
- private static final int NUM_SNOWFLAKES = 150; // 雪花数量
- private static final int DELAY = 5; // 延迟
- private SnowFlake[] mSnowFlakes; // 雪花
- public SnowView(Context context) {
- super(context);
- }
- public SnowView(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
- public SnowView(Context context, AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
- }
- @Override
- protected void onSizeChanged(int w, int h, int oldw, int oldh) {
- super.onSizeChanged(w, h, oldw, oldh);
- if (w != oldw || h != oldh) {
- initSnow(w, h);
- }
- }
- private void initSnow(int width, int height) {
- Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); // 抗锯齿
- paint.setColor(Color.WHITE); // 白色雪花
- paint.setStyle(Paint.Style.FILL); // 填充;
- mSnowFlakes = new SnowFlake[NUM_SNOWFLAKES];
- //mSnowFlakes所有的雪花都生成放到这里面
- for (int i = 0; i < NUM_SNOWFLAKES; ++i) {
- mSnowFlakes[i] = SnowFlake.create(width, height, paint);
- }
- }
- @Override
- protected void onDraw(Canvas canvas) {
- super.onDraw(canvas);
- //for返回SnowFlake
- for (SnowFlake s : mSnowFlakes) {
- //然后进行绘制
- s.draw(canvas);
- }
- // 隔一段时间重绘一次, 动画效果
- getHandler().postDelayed(runnable, DELAY);
- }
- // 重绘线程
- private Runnable runnable = new Runnable() {
- @Override
- public void run() {
- //自动刷新
- invalidate();
- }
- };
- }
SnowFlake
- package com.example.snowflake.view;
- import com.example.snowflake.RandomGenerator;
- import android.graphics.Canvas;
- import android.graphics.Paint;
- import android.graphics.Point;
- /**
- * 雪花的类, 移动, 移出屏幕会重新设置位置.
- */
- public class SnowFlake {
- // 雪花的角度
- private static final float ANGE_RANGE = 0.1f; // 角度范围
- private static final float HALF_ANGLE_RANGE = ANGE_RANGE / 2f; // 一般的角度
- private static final float HALF_PI = (float) Math.PI / 2f; // 半PI
- private static final float ANGLE_SEED = 25f; // 角度随机种子
- private static final float ANGLE_DIVISOR = 10000f;
- // 雪花的移动速度
- private static final float INCREMENT_LOWER = 2f;
- private static final float INCREMENT_UPPER = 4f;
- // 雪花的大小
- private static final float FLAKE_SIZE_LOWER = 7f;
- private static final float FLAKE_SIZE_UPPER = 20f;
- private final RandomGenerator mRandom; // 随机控制器
- private final Point mPosition; // 雪花位置
- private float mAngle; // 角度
- private final float mIncrement; // 雪花的速度
- private final float mFlakeSize; // 雪花的大小
- private final Paint mPaint; // 画笔
- private SnowFlake(RandomGenerator random, Point position, float angle, float increment, float flakeSize, Paint paint) {
- mRandom = random;
- mPosition = position;
- mIncrement = increment;
- mFlakeSize = flakeSize;
- mPaint = paint;
- mAngle = angle;
- }
- public static SnowFlake create(int width, int height, Paint paint) {
- RandomGenerator random = new RandomGenerator();
- int x = random.getRandom(width);
- int y = random.getRandom(height);
- Point position = new Point(x, y);
- float angle = random.getRandom(ANGLE_SEED) / ANGLE_SEED * ANGE_RANGE + HALF_PI - HALF_ANGLE_RANGE;
- float increment = random.getRandom(INCREMENT_LOWER, INCREMENT_UPPER);
- float flakeSize = random.getRandom(FLAKE_SIZE_LOWER, FLAKE_SIZE_UPPER);
- return new SnowFlake(random, position, angle, increment, flakeSize, paint);
- }
- // 绘制雪花
- public void draw(Canvas canvas) {
- int width = canvas.getWidth();
- int height = canvas.getHeight();
- move(width, height);
- canvas.drawCircle(mPosition.x, mPosition.y, mFlakeSize, mPaint);
- }
- // 移动雪花
- private void move(int width, int height) {
- //x水平方向,那么需要晃动,主要设置这个值就可以,现在取消晃动了
- //如果 mPosition.x不加上后面那个值,就不会晃动了
- double x = mPosition.x + (mIncrement * Math.cos(mAngle));
- //y是竖直方向,就是下落
- double y = mPosition.y + (mIncrement * Math.sin(mAngle));
- mAngle += mRandom.getRandom(-ANGLE_SEED, ANGLE_SEED) / ANGLE_DIVISOR;
- //这个是设置雪花位置,如果在很短时间内刷新一次,就是连起来的动画效果
- mPosition.set((int) x, (int) y);
- // 移除屏幕, 重新开始
- if (!isInside(width, height)) {
- // 重置雪花
- reset(width);
- }
- }
- // 判断是否在其中
- private boolean isInside(int width, int height) {
- int x = mPosition.x;
- int y = mPosition.y;
- return x > mFlakeSize -5 && x + mFlakeSize <= width && y >= -mFlakeSize - 1 && y - mFlakeSize < height;
- }
- // 重置雪花
- private void reset(int width) {
- mPosition.x = mRandom.getRandom(width);
- mPosition.y = (int) (-mFlakeSize - 1); // 最上面
- mAngle = mRandom.getRandom(ANGLE_SEED) / ANGLE_SEED * ANGE_RANGE + HALF_PI - HALF_ANGLE_RANGE;
- }
- }
2、实现下雨天效果代码
RainView
- package com.example.raindrop.view;
- import com.example.raindrop.R;
- import android.content.Context;
- import android.graphics.Canvas;
- import android.graphics.Paint;
- import android.util.AttributeSet;
- import android.view.View;
- /**
- * 雨滴视图, DELAY时间重绘, 绘制NUM_SNOWFLAKES个雨滴
- */
- public class RainView extends View {
- private static final int NUM_SNOWFLAKES = 150; // 雨滴数量
- private static final int DELAY = 5; // 延迟
- private RainFlake[] mSnowFlakes; // 雨滴
- public RainView(Context context) {
- super(context);
- }
- public RainView(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
- public RainView(Context context, AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
- }
- @Override
- protected void onSizeChanged(int w, int h, int oldw, int oldh) {
- super.onSizeChanged(w, h, oldw, oldh);
- if (w != oldw || h != oldh) {
- initSnow(w, h);
- }
- }
- private void initSnow(int width, int height) {
- Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); // 抗锯齿
- paint.setColor(getResources().getColor(R.color.colorWater)); // 雨滴的颜色
- paint.setStyle(Paint.Style.FILL); // 填充;
- mSnowFlakes = new RainFlake[NUM_SNOWFLAKES];
- //mSnowFlakes所有的雨滴都生成放到这里面
- for (int i = 0; i < NUM_SNOWFLAKES; ++i) {
- mSnowFlakes[i] = RainFlake.create(width, height, paint);
- }
- }
- @Override
- protected void onDraw(Canvas canvas) {
- super.onDraw(canvas);
- //for返回SnowFlake
- for (RainFlake s : mSnowFlakes) {
- //然后进行绘制
- s.draw(canvas);
- }
- // 隔一段时间重绘一次, 动画效果
- getHandler().postDelayed(runnable, DELAY);
- }
- // 重绘线程
- private Runnable runnable = new Runnable() {
- @Override
- public void run() {
- //自动刷新
- invalidate();
- }
- };
- }
RainFlake
- package com.example.raindrop.view;
- import com.example.raindrop.RandomGenerator;
- import android.graphics.Canvas;
- import android.graphics.Paint;
- /**
- * 雨滴的类, 移动, 移出屏幕会重新设置位置.
- */
- public class RainFlake {
- // 雨滴的移动速度
- private static final float INCREMENT_LOWER = 6f;
- private static final float INCREMENT_UPPER = 8f;
- // 雨滴的大小
- private static final float FLAKE_SIZE_LOWER = 2f;
- private static final float FLAKE_SIZE_UPPER = 5f;
- private final float mIncrement; // 雨滴的速度
- private final float mFlakeSize; // 雨滴的大小
- private final Paint mPaint; // 画笔
- private Line mLine; // 雨滴
- private RandomGenerator mRandom;
- private RainFlake(RandomGenerator random,Line line, float increment, float flakeSize, Paint paint) {
- mRandom = random;
- mLine = line;
- mIncrement = increment;
- mFlakeSize = flakeSize;
- mPaint = paint;
- }
- //生成雨滴
- public static RainFlake create(int width, int height, Paint paint) {
- RandomGenerator random = new RandomGenerator();
- int [] nline;
- nline = random.getLine(width, height);
- Line line = new Line(nline[0], nline[1], nline[2], nline[3]);
- float increment = random.getRandom(INCREMENT_LOWER, INCREMENT_UPPER);
- float flakeSize = random.getRandom(FLAKE_SIZE_LOWER, FLAKE_SIZE_UPPER);
- return new RainFlake(random,line, increment, flakeSize, paint);
- }
- // 绘制雨滴
- public void draw(Canvas canvas) {
- int width = canvas.getWidth();
- int height = canvas.getHeight();
- drawLine(canvas, width, height);
- }
- /**
- * 改成线条,类似于雨滴效果
- * @param canvas
- * @param width
- * @param height
- */
- private void drawLine(Canvas canvas, int width, int height) {
- //设置线宽
- mPaint.setStrokeWidth(mFlakeSize);
- //y是竖直方向,就是下落
- double y1 = mLine.y1 + (mIncrement * Math.sin(1.5));
- double y2 = mLine.y2 + (mIncrement * Math.sin(1.5));
- //这个是设置雨滴位置,如果在很短时间内刷新一次,就是连起来的动画效果
- mLine.set(mLine.x1,(int) y1,mLine.x2 ,(int) y2);
- if (!isInsideLine(height)) {
- resetLine(width,height);
- }
- canvas.drawLine(mLine.x1, mLine.y1, mLine.x2, mLine.y2, mPaint);
- }
- // 判断是否在其中
- private boolean isInsideLine(int height) {
- return mLine.y1 < height && mLine.y2 < height;
- }
- // 重置雨滴
- private void resetLine(int width, int height) {
- int [] nline;
- nline = mRandom.getLine(width, height);
- mLine.x1 = nline[0];
- mLine.y1 = nline[1];
- mLine.x2 = nline[2];
- mLine.y2 = nline[3];
- }
- }
3、效果图
在这里我说一下为什么是没有gif效果图,android手机录制屏幕太太麻烦了,还要转为gif。以前我是用腾讯应用宝截图做成gif效果图。但是这次效果不好我就直接截图了。
需要看动画效果,下载我demo。或者去中文翻译那片文章也有效果图。
还有各位有什么推荐工具,关于android 机器录制gif工具或者软件。
再次说明以下:
英文原文地址:https://blog.stylingandroid.com/snowfall/
中文翻译地址:http://www.open-open.com/lib/view/open1452263908573.html
国外大神实现效果youtube视频地址:https://www.youtube.com/watch?v=pk66ZziTfOw
中文翻译是open开发者经验库一位作者翻译,翻译的很好。在那篇文章也能看到实现的最原始的效果。
实现漫天飞舞的雪花下载地址:http://download.csdn.net/detail/qq_16064871/9420804
实现下雨天效果的下载地址:http://download.csdn.net/detail/qq_16064871/9420808
英文原文地址:https://blog.stylingandroid.com/snowfall/
中文翻译地址:http://www.open-open.com/lib/view/open1452263908573.html
国外大神实现效果youtube视频地址:https://www.youtube.com/watch?v=pk66ZziTfOw
中文翻译是open开发者经验库一位作者翻译,翻译的很好。在那篇文章也能看到实现的最原始的效果。
实现漫天飞舞的雪花下载地址:http://download.csdn.net/detail/qq_16064871/9420804
实现下雨天效果的下载地址:http://download.csdn.net/detail/qq_16064871/9420808
1、漫天飞舞的雪花主要代码
SnowView
- <span style="font-size:14px;">package com.ex</span>ample.snowflake.view;
- import android.content.Context;
- import android.graphics.Canvas;
- import android.graphics.Color;
- import android.graphics.Paint;
- import android.util.AttributeSet;
- import android.view.View;
- /**
- * 雪花视图, DELAY时间重绘, 绘制NUM_SNOWFLAKES个雪花
- */
- public class SnowView extends View {
- private static final int NUM_SNOWFLAKES = 150; // 雪花数量
- private static final int DELAY = 5; // 延迟
- private SnowFlake[] mSnowFlakes; // 雪花
- public SnowView(Context context) {
- super(context);
- }
- public SnowView(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
- public SnowView(Context context, AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
- }
- @Override
- protected void onSizeChanged(int w, int h, int oldw, int oldh) {
- super.onSizeChanged(w, h, oldw, oldh);
- if (w != oldw || h != oldh) {
- initSnow(w, h);
- }
- }
- private void initSnow(int width, int height) {
- Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); // 抗锯齿
- paint.setColor(Color.WHITE); // 白色雪花
- paint.setStyle(Paint.Style.FILL); // 填充;
- mSnowFlakes = new SnowFlake[NUM_SNOWFLAKES];
- //mSnowFlakes所有的雪花都生成放到这里面
- for (int i = 0; i < NUM_SNOWFLAKES; ++i) {
- mSnowFlakes[i] = SnowFlake.create(width, height, paint);
- }
- }
- @Override
- protected void onDraw(Canvas canvas) {
- super.onDraw(canvas);
- //for返回SnowFlake
- for (SnowFlake s : mSnowFlakes) {
- //然后进行绘制
- s.draw(canvas);
- }
- // 隔一段时间重绘一次, 动画效果
- getHandler().postDelayed(runnable, DELAY);
- }
- // 重绘线程
- private Runnable runnable = new Runnable() {
- @Override
- public void run() {
- //自动刷新
- invalidate();
- }
- };
- }
SnowFlake
- package com.example.snowflake.view;
- import com.example.snowflake.RandomGenerator;
- import android.graphics.Canvas;
- import android.graphics.Paint;
- import android.graphics.Point;
- /**
- * 雪花的类, 移动, 移出屏幕会重新设置位置.
- */
- public class SnowFlake {
- // 雪花的角度
- private static final float ANGE_RANGE = 0.1f; // 角度范围
- private static final float HALF_ANGLE_RANGE = ANGE_RANGE / 2f; // 一般的角度
- private static final float HALF_PI = (float) Math.PI / 2f; // 半PI
- private static final float ANGLE_SEED = 25f; // 角度随机种子
- private static final float ANGLE_DIVISOR = 10000f;
- // 雪花的移动速度
- private static final float INCREMENT_LOWER = 2f;
- private static final float INCREMENT_UPPER = 4f;
- // 雪花的大小
- private static final float FLAKE_SIZE_LOWER = 7f;
- private static final float FLAKE_SIZE_UPPER = 20f;
- private final RandomGenerator mRandom; // 随机控制器
- private final Point mPosition; // 雪花位置
- private float mAngle; // 角度
- private final float mIncrement; // 雪花的速度
- private final float mFlakeSize; // 雪花的大小
- private final Paint mPaint; // 画笔
- private SnowFlake(RandomGenerator random, Point position, float angle, float increment, float flakeSize, Paint paint) {
- mRandom = random;
- mPosition = position;
- mIncrement = increment;
- mFlakeSize = flakeSize;
- mPaint = paint;
- mAngle = angle;
- }
- public static SnowFlake create(int width, int height, Paint paint) {
- RandomGenerator random = new RandomGenerator();
- int x = random.getRandom(width);
- int y = random.getRandom(height);
- Point position = new Point(x, y);
- float angle = random.getRandom(ANGLE_SEED) / ANGLE_SEED * ANGE_RANGE + HALF_PI - HALF_ANGLE_RANGE;
- float increment = random.getRandom(INCREMENT_LOWER, INCREMENT_UPPER);
- float flakeSize = random.getRandom(FLAKE_SIZE_LOWER, FLAKE_SIZE_UPPER);
- return new SnowFlake(random, position, angle, increment, flakeSize, paint);
- }
- // 绘制雪花
- public void draw(Canvas canvas) {
- int width = canvas.getWidth();
- int height = canvas.getHeight();
- move(width, height);
- canvas.drawCircle(mPosition.x, mPosition.y, mFlakeSize, mPaint);
- }
- // 移动雪花
- private void move(int width, int height) {
- //x水平方向,那么需要晃动,主要设置这个值就可以,现在取消晃动了
- //如果 mPosition.x不加上后面那个值,就不会晃动了
- double x = mPosition.x + (mIncrement * Math.cos(mAngle));
- //y是竖直方向,就是下落
- double y = mPosition.y + (mIncrement * Math.sin(mAngle));
- mAngle += mRandom.getRandom(-ANGLE_SEED, ANGLE_SEED) / ANGLE_DIVISOR;
- //这个是设置雪花位置,如果在很短时间内刷新一次,就是连起来的动画效果
- mPosition.set((int) x, (int) y);
- // 移除屏幕, 重新开始
- if (!isInside(width, height)) {
- // 重置雪花
- reset(width);
- }
- }
- // 判断是否在其中
- private boolean isInside(int width, int height) {
- int x = mPosition.x;
- int y = mPosition.y;
- return x > mFlakeSize -5 && x + mFlakeSize <= width && y >= -mFlakeSize - 1 && y - mFlakeSize < height;
- }
- // 重置雪花
- private void reset(int width) {
- mPosition.x = mRandom.getRandom(width);
- mPosition.y = (int) (-mFlakeSize - 1); // 最上面
- mAngle = mRandom.getRandom(ANGLE_SEED) / ANGLE_SEED * ANGE_RANGE + HALF_PI - HALF_ANGLE_RANGE;
- }
- }
2、实现下雨天效果代码
RainView
- package com.example.raindrop.view;
- import com.example.raindrop.R;
- import android.content.Context;
- import android.graphics.Canvas;
- import android.graphics.Paint;
- import android.util.AttributeSet;
- import android.view.View;
- /**
- * 雨滴视图, DELAY时间重绘, 绘制NUM_SNOWFLAKES个雨滴
- */
- public class RainView extends View {
- private static final int NUM_SNOWFLAKES = 150; // 雨滴数量
- private static final int DELAY = 5; // 延迟
- private RainFlake[] mSnowFlakes; // 雨滴
- public RainView(Context context) {
- super(context);
- }
- public RainView(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
- public RainView(Context context, AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
- }
- @Override
- protected void onSizeChanged(int w, int h, int oldw, int oldh) {
- super.onSizeChanged(w, h, oldw, oldh);
- if (w != oldw || h != oldh) {
- initSnow(w, h);
- }
- }
- private void initSnow(int width, int height) {
- Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); // 抗锯齿
- paint.setColor(getResources().getColor(R.color.colorWater)); // 雨滴的颜色
- paint.setStyle(Paint.Style.FILL); // 填充;
- mSnowFlakes = new RainFlake[NUM_SNOWFLAKES];
- //mSnowFlakes所有的雨滴都生成放到这里面
- for (int i = 0; i < NUM_SNOWFLAKES; ++i) {
- mSnowFlakes[i] = RainFlake.create(width, height, paint);
- }
- }
- @Override
- protected void onDraw(Canvas canvas) {
- super.onDraw(canvas);
- //for返回SnowFlake
- for (RainFlake s : mSnowFlakes) {
- //然后进行绘制
- s.draw(canvas);
- }
- // 隔一段时间重绘一次, 动画效果
- getHandler().postDelayed(runnable, DELAY);
- }
- // 重绘线程
- private Runnable runnable = new Runnable() {
- @Override
- public void run() {
- //自动刷新
- invalidate();
- }
- };
- }
RainFlake
- package com.example.raindrop.view;
- import com.example.raindrop.RandomGenerator;
- import android.graphics.Canvas;
- import android.graphics.Paint;
- /**
- * 雨滴的类, 移动, 移出屏幕会重新设置位置.
- */
- public class RainFlake {
- // 雨滴的移动速度
- private static final float INCREMENT_LOWER = 6f;
- private static final float INCREMENT_UPPER = 8f;
- // 雨滴的大小
- private static final float FLAKE_SIZE_LOWER = 2f;
- private static final float FLAKE_SIZE_UPPER = 5f;
- private final float mIncrement; // 雨滴的速度
- private final float mFlakeSize; // 雨滴的大小
- private final Paint mPaint; // 画笔
- private Line mLine; // 雨滴
- private RandomGenerator mRandom;
- private RainFlake(RandomGenerator random,Line line, float increment, float flakeSize, Paint paint) {
- mRandom = random;
- mLine = line;
- mIncrement = increment;
- mFlakeSize = flakeSize;
- mPaint = paint;
- }
- //生成雨滴
- public static RainFlake create(int width, int height, Paint paint) {
- RandomGenerator random = new RandomGenerator();
- int [] nline;
- nline = random.getLine(width, height);
- Line line = new Line(nline[0], nline[1], nline[2], nline[3]);
- float increment = random.getRandom(INCREMENT_LOWER, INCREMENT_UPPER);
- float flakeSize = random.getRandom(FLAKE_SIZE_LOWER, FLAKE_SIZE_UPPER);
- return new RainFlake(random,line, increment, flakeSize, paint);
- }
- // 绘制雨滴
- public void draw(Canvas canvas) {
- int width = canvas.getWidth();
- int height = canvas.getHeight();
- drawLine(canvas, width, height);
- }
- /**
- * 改成线条,类似于雨滴效果
- * @param canvas
- * @param width
- * @param height
- */
- private void drawLine(Canvas canvas, int width, int height) {
- //设置线宽
- mPaint.setStrokeWidth(mFlakeSize);
- //y是竖直方向,就是下落
- double y1 = mLine.y1 + (mIncrement * Math.sin(1.5));
- double y2 = mLine.y2 + (mIncrement * Math.sin(1.5));
- //这个是设置雨滴位置,如果在很短时间内刷新一次,就是连起来的动画效果
- mLine.set(mLine.x1,(int) y1,mLine.x2 ,(int) y2);
- if (!isInsideLine(height)) {
- resetLine(width,height);
- }
- canvas.drawLine(mLine.x1, mLine.y1, mLine.x2, mLine.y2, mPaint);
- }
- // 判断是否在其中
- private boolean isInsideLine(int height) {
- return mLine.y1 < height && mLine.y2 < height;
- }
- // 重置雨滴
- private void resetLine(int width, int height) {
- int [] nline;
- nline = mRandom.getLine(width, height);
- mLine.x1 = nline[0];
- mLine.y1 = nline[1];
- mLine.x2 = nline[2];
- mLine.y2 = nline[3];
- }
- }
3、效果图
在这里我说一下为什么是没有gif效果图,android手机录制屏幕太太麻烦了,还要转为gif。以前我是用腾讯应用宝截图做成gif效果图。但是这次效果不好我就直接截图了。
需要看动画效果,下载我demo。或者去中文翻译那片文章也有效果图。
还有各位有什么推荐工具,关于android 机器录制gif工具或者软件。
再次说明以下:
英文原文地址:https://blog.stylingandroid.com/snowfall/
中文翻译地址:http://www.open-open.com/lib/view/open1452263908573.html
国外大神实现效果youtube视频地址:https://www.youtube.com/watch?v=pk66ZziTfOw
中文翻译是open开发者经验库一位作者翻译,翻译的很好。在那篇文章也能看到实现的最原始的效果。
实现漫天飞舞的雪花下载地址:http://download.csdn.net/detail/qq_16064871/9420804
实现下雨天效果的下载地址:http://download.csdn.net/detail/qq_16064871/9420808
android 经典下雨效果的更多相关文章
- 【Android源代码下载】收集整理android界面UI效果源码
在Android开发中,Android界面UI效果设计一直都是很多童鞋关注的问题,今天给大家分享下大神收集整理的多个android界面UI效果,都是源码,都是干货,贡献给各位网友! 话不多说,直接上效 ...
- Android经典项目开发之天气APP实例分享
原文:Android经典项目开发之天气APP实例分享 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/mzc186/article/details/5 ...
- Android经典完美退出方法
Android经典完美退出方法,使用单例模式创建一个Activity管理对象,该对象中有一个Activity容器(具体实现自己处理,使用LinkedList等)专门负责存储新开启的每一个Activit ...
- 使用 Canvas 和 JavaScript 创建逼真的下雨效果
HTML5 规范引进了很多新特性,其中最令人期待的之一就是 Canvas 元素,HTML5 Canvas 提供了通过 JavaScript 绘制图形的方法,非常强大.这里向大家展示一个使用 Canva ...
- 使用Unity3D自带动画系统制作下雨效果
之前看了以前版本的unity3d demo AngryBots ,觉得里面的下雨效果不错,刚好前段时间学习了,写出来跟大家分享下,直接开始. 使用自带动画系统制作下雨效果. 先制作下雨的雨滴涟漪 步骤 ...
- 50款经典电影效果LR预设
Film Looks LR Presets是一套非常专业的经典电影效果LR预设,包含50个不同效果的Lightroom预设,由专业摄影师和Lightroom专家开发,此套LR预设模拟摄影时代的经典电影 ...
- android经典源码,很不错的开源框架
高仿最美应用项目源码 项目介绍 这是仿最美应用开发的基于mvp+rxjava+retrofit的项目,很值得学 github地址: https://github.com/JJOGGER/Beaut ...
- 6 cocos2dx粒子效果,类图关系,系统原生粒子和自己定义粒子效果,粒子编译器软件,爆炸粒子效果,烟花效果,火焰效果,流星效果,漩涡粒子效果,雪花效果,烟雾效果,太阳效果,下雨效果
1 粒子 演示样例 2 类图关系 3 系统原生粒子 CCParticleSystem 全部粒子系统的父类 CCParticleSystemPoint. CCParticleSystemQuad ...
- Unity3d中使用自带动画系统制作下雨效果(二)
接着昨天的(一),今天上下雨效果的后半部分.在最后附上网盘链接,有使用的素材及本次的工程源文件,想看看的童鞋可以下载~~ 下雨效果分两部分:地上的涟漪和空中的雨滴.那么现在就开始,是使用unity3d ...
随机推荐
- switch-case 执行顺序
switch(expression){ case value : //语句 break; //可选 case value : //语句 break; //可选 //你可以有任意数量的case语句 de ...
- PC上安装多个操作系统
目 录 第1章 绪论 1 1.1 目标 1 1.2 适宜的读者 1 第2章 制作启动U盘 2 2.1 初级安装 2 2.2 启动分析 3 2.3 高级安装 1 ...
- @ResponseStatus
返回一个指定的http response状态码. @ResponseStatus(value = HttpStatus.NOT_FOUND, reason = "IOException oc ...
- js 判断当前的手机系统类型
<script language="javascript">window.onload = function () {alert("1");var ...
- js键盘操作事件
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- jQuery 2.0.3 源码分析 Deferrred概念
转载http://www.cnblogs.com/aaronjs/p/3348569.html JavaScript编程几乎总是伴随着异步操作,传统的异步操作会在操作完成之后,使用回调函数传回结果,而 ...
- 生产订单修改删除组件BDC
可用函数修改:CO_XT_COMPONENT_CHANGE,一次一个 FORM prm_change_bom . DATA:gw_zstypf TYPE zstypf. DATA:lv_rspos T ...
- 怎样打造一个分布式数据库——rocksDB, raft, mvcc,本质上是为了解决跨数据中心的复制
摘自:http://www.infoq.com/cn/articles/how-to-build-a-distributed-database?utm_campaign=rightbar_v2& ...
- ecshop数据库取数据
取出所有数据: test_getAll(); function test_getAll() { global $db; $sql = "SELECT user_id, user_name, ...
- MongoDB Replica Set 选举过程
Replica Set 选举过程 心跳检测 假设我们有三个节点的replica sets:X,Y和Z节点.在replica sets结构中,这三个节点每2秒会各自向其它两个节点发送一个心跳检测请求.比 ...