本文整理汇总了Java中aurelienribon.tweenengine.TweenEquation类的典型用法代码示例。如果您正苦于以下问题:Java TweenEquation类的具体用法?Java TweenEquation怎么用?Java TweenEquation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TweenEquation类属于aurelienribon.tweenengine包,在下文中一共展示了TweenEquation类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toColor
import aurelienribon.tweenengine.TweenEquation; //导入依赖的package包/类
/**
* Fades the source color object into the target color in the given time
*
* @param sourceColor the source color
* @param targetColor the target color
* @param time given decimal time (in seconds)
* @param equation tween equation
*/
public static void toColor(Color sourceColor, Color targetColor, float time, TweenEquation equation) {
tweenManager.killTarget(sourceColor, ColorTween.R);
tweenManager.killTarget(sourceColor, ColorTween.G);
tweenManager.killTarget(sourceColor, ColorTween.B);
Tween.to(sourceColor, ColorTween.R, time).ease(equation).target(targetColor.r).start(tweenManager);
Tween.to(sourceColor, ColorTween.G, time).ease(equation).target(targetColor.g).start(tweenManager);
Tween.to(sourceColor, ColorTween.B, time).ease(equation).target(targetColor.b).start(tweenManager);
}
示例2: fadeOut
import aurelienribon.tweenengine.TweenEquation; //导入依赖的package包/类
public void fadeOut(float duration, TweenEquation equation, TweenCallback callback) {
flash.setAlpha(0f);
tweenManager.killTarget(flash);
Tween tween = Tween.to(flash, SpriteTween.ALPHA, duration).target(1f).ease(equation);
if (callback != null) {
tween.setCallback(callback).setCallbackTriggers(TweenCallback.COMPLETE);
}
tween.start(tweenManager);
}
示例3: tween
import aurelienribon.tweenengine.TweenEquation; //导入依赖的package包/类
private void tween(float duration, int target, TweenEquation equation) {
stopAllTweens();
int i = 0;
tweens = new Tween[weatherEffect.getEmitters().size];
for (WeatherParticleEmitter pe : weatherEffect.getEmitters()) {
tweens[i++] = Tween
.to(pe, WeatherParticleEmitterTweenAccessor.MAX_PARTICLE_COUNT, duration)
.ease(equation)
.target(target)
.setCallback(this).start(weatherManager.getTweenManager());
}
}
示例4: toColor
import aurelienribon.tweenengine.TweenEquation; //导入依赖的package包/类
/**
* Fades the source color object into the target color in the given time
*
* @param sourceColor the source color
* @param targetColor the target color
* @param time given decimal time (in seconds)
* @param equation tween equation
*/
public static void toColor(Color sourceColor, Color targetColor, float time, TweenEquation equation) {
tweenManager.killTarget(sourceColor, ColorTween.R);
tweenManager.killTarget(sourceColor, ColorTween.G);
tweenManager.killTarget(sourceColor, ColorTween.B);
Tween.to(sourceColor, ColorTween.R, time).ease(equation).target(targetColor.r).start(tweenManager);
Tween.to(sourceColor, ColorTween.G, time).ease(equation).target(targetColor.g).start(tweenManager);
Tween.to(sourceColor, ColorTween.B, time).ease(equation).target(targetColor.b).start(tweenManager);
}
示例5: startEntryAnimation
import aurelienribon.tweenengine.TweenEquation; //导入依赖的package包/类
public void startEntryAnimation(float duration, TweenEquation te)
{
Tween.to(this.def, ParticleAccessor.SCALE_XY, duration).
target(1f).
ease(te).
start(tm);
Tween.to(this.def, ParticleAccessor.ANGLEorALPHA, duration).
target(1f).
ease(te).
start(tm);
}
示例6: startEntryAnimation
import aurelienribon.tweenengine.TweenEquation; //导入依赖的package包/类
/**
* Inicia la animaci�n de entrada por defecto establecida segun los datos del constructor, con una duraci�n.
*
* @param tm puntero al manager de tween.
* @param duration �cu�ntos segundos quieres que dure?
*/
public void startEntryAnimation(float duration, TweenEquation te)
{
Tween.to(this.def, ParticleAccessor.POSITION_XY, duration).
target(this.xStartExit, this.yStartExit).
ease(te).
start(tm);
}
示例7: fadeIn
import aurelienribon.tweenengine.TweenEquation; //导入依赖的package包/类
public void fadeIn(float duration, TweenEquation equation) {
flash.setAlpha(1f);
tweenManager.killTarget(flash);
Tween.to(flash, SpriteTween.ALPHA, duration).target(0f).ease(equation).start(tweenManager);
}
示例8: setTweenEquation
import aurelienribon.tweenengine.TweenEquation; //导入依赖的package包/类
public void setTweenEquation(TweenEquation equation) {
this.equation = equation;
}
示例9: fadeIn
import aurelienribon.tweenengine.TweenEquation; //导入依赖的package包/类
public void fadeIn(float duration, TweenEquation equation) {
flash.setAlpha(1f);
tweenManager.killTarget(flash);
Tween.to(flash, SpriteTween.ALPHA, duration).target(0f).ease(equation).start(tweenManager);
}
示例10: fadeOut
import aurelienribon.tweenengine.TweenEquation; //导入依赖的package包/类
public void fadeOut(float duration, TweenEquation equation) {
flash.setAlpha(0f);
tweenManager.killTarget(flash);
Tween.to(flash, SpriteTween.ALPHA, duration).target(1f).ease(equation).start(tweenManager);
}
示例11: moveTo
import aurelienribon.tweenengine.TweenEquation; //导入依赖的package包/类
public void moveTo(float x, float y, TweenEquation te) {
Tween.to(sprite, 0, 0.385f)
.target(x, y)
.ease(te)
.start(BaseScreen.tm);
}
示例12: ease
import aurelienribon.tweenengine.TweenEquation; //导入依赖的package包/类
public TweenAnimation ease(TweenEquation equation) {
tween.ease(equation);
return this;
}
示例13: getTweenEquation
import aurelienribon.tweenengine.TweenEquation; //导入依赖的package包/类
/**
* @return tween equation for the given parameters
*/
private TweenEquation getTweenEquation(EaseEquation easeEquation,
EaseType easeType) {
TweenEquation equation;
int type = easeType == EaseType.IN ? 0 : easeType == EaseType.OUT ? 1
: 2;
switch (easeEquation) {
case LINEAR:
equation = TweenEquations.easeNone;
break;
case QUAD:
equation = type == 0 ? TweenEquations.easeInQuad
: type == 1 ? TweenEquations.easeOutQuad
: TweenEquations.easeInOutQuad;
break;
case CUBIC:
equation = type == 0 ? TweenEquations.easeInCubic
: type == 1 ? TweenEquations.easeOutCubic
: TweenEquations.easeInOutCubic;
break;
case QUART:
equation = type == 0 ? TweenEquations.easeInQuart
: type == 1 ? TweenEquations.easeOutQuart
: TweenEquations.easeInOutQuart;
break;
case QUINT:
equation = type == 0 ? TweenEquations.easeInQuint
: type == 1 ? TweenEquations.easeOutQuint
: TweenEquations.easeInOutQuint;
break;
case CIRC:
equation = type == 0 ? TweenEquations.easeInCirc
: type == 1 ? TweenEquations.easeOutCirc
: TweenEquations.easeInOutCirc;
break;
case SINE:
equation = type == 0 ? TweenEquations.easeInSine
: type == 1 ? TweenEquations.easeOutSine
: TweenEquations.easeInOutSine;
break;
case EXPO:
equation = type == 0 ? TweenEquations.easeInExpo
: type == 1 ? TweenEquations.easeOutExpo
: TweenEquations.easeInOutExpo;
break;
case BACK:
equation = type == 0 ? TweenEquations.easeInBack
: type == 1 ? TweenEquations.easeOutBack
: TweenEquations.easeInOutBack;
break;
case BOUNCE:
equation = type == 0 ? TweenEquations.easeInBounce
: type == 1 ? TweenEquations.easeOutBounce
: TweenEquations.easeInOutBounce;
break;
case ELASTIC:
equation = type == 0 ? TweenEquations.easeInElastic
: type == 1 ? TweenEquations.easeOutElastic
: TweenEquations.easeInOutElastic;
break;
default:
equation = TweenEquations.easeNone;
}
return equation;
}