本文整理汇总了Java中com.watabou.utils.ColorMath类的典型用法代码示例。如果您正苦于以下问题:Java ColorMath类的具体用法?Java ColorMath怎么用?Java ColorMath使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ColorMath类属于com.watabou.utils包,在下文中一共展示了ColorMath类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: WaterParticle
import com.watabou.utils.ColorMath; //导入依赖的package包/类
public WaterParticle() {
super();
acc.y = 50;
am = 0.5f;
color(ColorMath.random(0xb6ccc2, 0x3b6653));
size(2);
}
示例2: update
import com.watabou.utils.ColorMath; //导入依赖的package包/类
@Override
public void update() {
super.update();
if (Random.Float() < Game.elapsed) {
PixelParticle spark = (PixelParticle) sparks
.recycle(PixelParticle.Shrinking.class);
spark.reset(x, y, ColorMath.random(COLOR, 0x66FF66), 2,
Random.Float(0.5f, 1.0f));
spark.speed.set(Random.Float(-40, +40), Random.Float(-60, +20));
spark.acc.set(0, +80);
sparks.add(spark);
}
}
示例3: EarthParticle
import com.watabou.utils.ColorMath; //导入依赖的package包/类
public EarthParticle() {
super();
color(ColorMath.random(0x444444, 0x777766));
angle = Random.Float(-30, 30);
lifespan = 0.5f;
}
示例4: update
import com.watabou.utils.ColorMath; //导入依赖的package包/类
@Override
public void update() {
super.update();
// alpha: 1 -> 0; size: 1 -> 4
size(4 - (am = left / lifespan) * 3);
// color: 0x8844FF -> 0x00FF00
color(ColorMath.interpolate(0x00FF00, 0x8844FF, am));
}
示例5: emit
import com.watabou.utils.ColorMath; //导入依赖的package包/类
@Override
public void emit(Emitter emitter, int index, float x, float y) {
LeafParticle p = ((LeafParticle) emitter
.recycle(LeafParticle.class));
p.color(ColorMath.random(0x004400, 0x88CC44));
p.reset(x, y);
}
示例6: update
import com.watabou.utils.ColorMath; //导入依赖的package包/类
@Override
public void update() {
super.update();
float p = left / lifespan;
// alpha: 0 -> 1 -> 0; size: 6 -> 0; color: 0x660044 -> 0x000000
color(ColorMath.interpolate(0x000000, 0x440044, p));
am = p < 0.5f ? p * p * 4 : (1 - p) * 2;
}
示例7: update
import com.watabou.utils.ColorMath; //导入依赖的package包/类
@Override
public void update() {
super.update();
// alpha: 1 -> 0; size: 1 -> 5
size(5 - (am = left / lifespan) * 4);
// color: 0xFF0044 -> 0x220066
color(ColorMath.interpolate(0x220066, 0xFF0044, am));
}
示例8: WaterParticle
import com.watabou.utils.ColorMath; //导入依赖的package包/类
public WaterParticle() {
super();
acc.y = 50;
am = 0.5f;
color( ColorMath.random( 0xb6ccc2, 0x3b6653 ) );
size( 2 );
}
示例9: update
import com.watabou.utils.ColorMath; //导入依赖的package包/类
@Override
public void update() {
super.update();
if (Random.Float() < Game.elapsed) {
PixelParticle spark = (PixelParticle)sparks.recycle( PixelParticle.Shrinking.class );
spark.reset( x, y, ColorMath.random( COLOR, 0x66FF66 ), 2, Random.Float( 0.5f, 1.0f ) );
spark.speed.set(
Random.Float( -40, +40 ),
Random.Float( -60, +20 ) );
spark.acc.set( 0, +80 );
sparks.add( spark );
}
}
示例10: EarthParticle
import com.watabou.utils.ColorMath; //导入依赖的package包/类
public EarthParticle() {
super();
color( ColorMath.random( 0x444444, 0x777766 ) );
angle = Random.Float( -30, 30 );
lifespan = 0.5f;
}
示例11: update
import com.watabou.utils.ColorMath; //导入依赖的package包/类
@Override
public void update() {
super.update();
// alpha: 1 -> 0; size: 1 -> 4
size( 4 - (am = left / lifespan) * 3 );
// color: 0x8844FF -> 0x00FF00
color( ColorMath.interpolate( 0x00FF00, 0x8844FF, am ) );
}
示例12: update
import com.watabou.utils.ColorMath; //导入依赖的package包/类
@Override
public void update() {
super.update();
float p = left / lifespan;
// alpha: 0 -> 1 -> 0; size: 6 -> 0; color: 0x660044 -> 0x000000
color( ColorMath.interpolate( 0x000000, 0x440044, p ) );
am = p < 0.5f ? p * p * 4 : (1 - p) * 2;
}
示例13: update
import com.watabou.utils.ColorMath; //导入依赖的package包/类
@Override
public void update() {
super.update();
// alpha: 1 -> 0; size: 1 -> 5
size( 5 - (am = left / lifespan) * 4 );
// color: 0xFF0044 -> 0x220066
color( ColorMath.interpolate( 0x220066, 0xFF0044, am ) );
}
示例14: staffFx
import com.watabou.utils.ColorMath; //导入依赖的package包/类
@Override
public void staffFx(MagesStaff.StaffParticle particle) {
particle.color( ColorMath.random(0x004400, 0x88CC44) );
particle.am = 1f;
particle.setLifespan(1f);
particle.setSize( 1f, 1.5f);
particle.shuffleXY(0.5f);
float dst = Random.Float(11f);
particle.x -= dst;
particle.y += dst;
}
示例15: staffFx
import com.watabou.utils.ColorMath; //导入依赖的package包/类
@Override
public void staffFx(MagesStaff.StaffParticle particle) {
particle.color( ColorMath.random( 0x8844FF, 0x00FF00) );
particle.am = 0.6f;
particle.setLifespan( 1f );
particle.acc.set(0, 20);
particle.setSize( 0.5f, 2f);
particle.shuffleXY( 1f );
}