本文整理汇总了Java中aurelienribon.tweenengine.equations.Quad类的典型用法代码示例。如果您正苦于以下问题:Java Quad类的具体用法?Java Quad怎么用?Java Quad使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Quad类属于aurelienribon.tweenengine.equations包,在下文中一共展示了Quad类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseEasing
import aurelienribon.tweenengine.equations.Quad; //导入依赖的package包/类
/**
* Takes an easing name and gives you the corresponding TweenEquation.
* You probably won't need this, but tools will love that.
*
* @param easingName The name of an easing, like "Quad.INOUT".
* @return The parsed equation, or null if there is no match.
*/
public static TweenEquation parseEasing(String easingName) {
if (easings == null) {
easings = new TweenEquation[] {Linear.INOUT,
Quad.IN, Quad.OUT, Quad.INOUT,
Cubic.IN, Cubic.OUT, Cubic.INOUT,
Quart.IN, Quart.OUT, Quart.INOUT,
Quint.IN, Quint.OUT, Quint.INOUT,
Circ.IN, Circ.OUT, Circ.INOUT,
Sine.IN, Sine.OUT, Sine.INOUT,
Expo.IN, Expo.OUT, Expo.INOUT,
Back.IN, Back.OUT, Back.INOUT,
Bounce.IN, Bounce.OUT, Bounce.INOUT,
Elastic.IN, Elastic.OUT, Elastic.INOUT
};
}
for (int i=0; i<easings.length; i++) {
if (easingName.equals(easings[i].toString()))
return easings[i];
}
return null;
}
示例2: show
import aurelienribon.tweenengine.equations.Quad; //导入依赖的package包/类
@Override
public void show() {
Gdx.input.setInputProcessor(this);
generatePersons();
if(!teaching && !hasTicket)levelGraph.circularLevelAnimation();
restartTouch();
table.startEntryAnimation(.5f, Quad.OUT);
if(!hasOffer && !hasTicket)seconds = INITIAL_SECONDS;
timeDelta = 0f;
time.setText(String.valueOf(seconds));
time.startEntryAnimation(1f);
points = 0;
score.setText("0");
score.startEntryAnimation(2f);
}
示例3: startScreenShake
import aurelienribon.tweenengine.equations.Quad; //导入依赖的package包/类
private void startScreenShake() {
if (allowScreenShake) {
Gdx.input.vibrate(150);
Timeline.createSequence()
.push(Tween.set(camera, CameraAccessor.POSITION_XY)
.target(400, 240))
.push(Tween.to(camera, CameraAccessor.POSITION_XY, 0.035f)
.targetRelative(8, 0)
.ease(Quad.IN))
.push(Tween.to(camera, CameraAccessor.POSITION_XY, 0.035f)
.targetRelative(-8, 0)
.ease(Quad.IN))
.push(Tween.to(camera, CameraAccessor.POSITION_XY, 0.0175f)
.target(400, 240)
.ease(Quad.IN))
.repeatYoyo(2, 0)
.start(game.tweenManager);
}
}
示例4: addDownloadTile
import aurelienribon.tweenengine.equations.Quad; //导入依赖的package包/类
private void addDownloadTile(HttpUtils.DownloadTask task) {
final DownloadTile tile = new DownloadTile(task);
Style.registerCssClasses(tile, ".tile");
if (style != null) Style.apply(tile, style, styleStack);
tile.setLocation(getNextTileX() + getWidth(), 2);
Tween.to(tile, SLAnimator.ComponentAccessor.X, 2)
.target(getNextTileX())
.ease(Quad.OUT)
.start(tweenManager);
task.addListener(new DownloadListener() {
@Override public void onUpdate(int length, int totalLength) {tile.setCurrentSize(length, totalLength);}
@Override public void onComplete() {tile.setToComplete(); tile.disappear(3.5f);}
@Override public void onError(IOException ex) {tile.setToError("IOException: " + ex.getMessage());}
});
add(tile);
tiles.add(tile);
}
示例5: movingLabel
import aurelienribon.tweenengine.equations.Quad; //导入依赖的package包/类
private void movingLabel(Label label) {
Tween.registerAccessor(Label.class, new LabelAccessor());
Timeline.createSequence()
.push(Tween.set(label, LabelAccessor.POSITION_XY).target(0, 540))
.push(Tween.set(label, LabelAccessor.SCALE).target(0.5f))
.beginParallel()
.push(Tween.to(label, LabelAccessor.POSITION_X, 1f).target(100).ease(Quad.IN))
.push(Tween.to(label, LabelAccessor.POSITION_Y, 1f).target(300).ease(Linear.INOUT))
.push(Tween.to(label, LabelAccessor.SCALE, 1f).target(1).ease(Bounce.OUT))
.end()
.beginParallel()
.push(Tween.to(label, LabelAccessor.POSITION_X, 2f).target(50).ease(Back.INOUT))
.push(Tween.to(label, LabelAccessor.POSITION_Y, 2f).target(310).ease(Linear.INOUT))
.end()
.beginParallel()
.push(Tween.to(label, LabelAccessor.POSITION_X, 2f).target(1000).ease(Quart.IN))
.push(Tween.to(label, LabelAccessor.POSITION_Y, 2f).target(600).ease(Back.INOUT))
.end()
.start(tweenManager);
}
示例6: onEvent
import aurelienribon.tweenengine.equations.Quad; //导入依赖的package包/类
@Override
public void onEvent(int type, BaseTween<?> source) {
tiles.remove((Tile) source.getUserData());
for (Tile tile : tiles) {
tweenManager.killTarget(tile, SLAnimator.ComponentAccessor.X);
Tween.to(tile, SLAnimator.ComponentAccessor.X, 2)
.target(getTileX(tile))
.ease(Quad.OUT)
.start(tweenManager);
}
}
示例7: disappear
import aurelienribon.tweenengine.equations.Quad; //导入依赖的package包/类
public void disappear(float delay) {
Tween.to(this, SLAnimator.ComponentAccessor.Y, 0.3f)
.targetRelative(50)
.ease(Quad.IN)
.delay(delay)
.setCallback(tileRemovedCallback)
.setUserData(this)
.start(tweenManager);
}
示例8: moveTo
import aurelienribon.tweenengine.equations.Quad; //导入依赖的package包/类
public void moveTo(float x, float y, TweenManager tweenManager, TweenCallback callback) {
//Vector2 particlePos = Config.getProjectedCoordinates(getX(), getY(), viewport);
//Vector2 requestedPos = Config.getProjectedCoordinates(x, y, viewport);
Vector2 particlePos = new Vector2(getX(), getY());
Vector2 requestedPos = new Vector2(x, y);
double distance = Math.sqrt(
(float)Math.pow(particlePos.x - requestedPos.x, 2) +
(float)Math.pow(particlePos.y - requestedPos.y, 2));
double duration = distance / Config.WISPER_SPEED;
moveToWithDuration(x, y, tweenManager, duration, Quad.OUT, callback);
}
示例9: dash
import aurelienribon.tweenengine.equations.Quad; //导入依赖的package包/类
public void dash(final float x, final float y, final TweenManager tweenManager) {
if (isDashUp) {
Vector2 particlePos = new Vector2(getX(), getY());
Vector2 requestedPos = new Vector2(x, y);
double distance = Math.max(
Math.sqrt(Math.pow(particlePos.x - requestedPos.x, 2) + Math.pow(particlePos.y - requestedPos.y, 2)),
1);
double dashDistance = Math.min(distance, Config.WISPER_DASH_DISTANCE);
float alpha = (float)dashDistance / (float)distance;
Vector2 AB = new Vector2(requestedPos.x - particlePos.x, requestedPos.y - particlePos.y);
Vector2 ABPrim = new Vector2(alpha * AB.x, alpha * AB.y);
Vector2 BPrim = new Vector2(ABPrim.x + particlePos.x, ABPrim.y + particlePos.y);
tweenManager.killTarget(particleEffect);
Tween.to(particleEffect, ParticleEffectAccessor.X, Config.WISPER_DASH_DURATION)
.target(BPrim.x - (particleEffect.getEmitters().first().getXOffsetValue().getLowMax() / 2))
.ease(Quad.OUT).start(tweenManager);
Tween.to(particleEffect, ParticleEffectAccessor.Y, Config.WISPER_DASH_DURATION).target(BPrim.y)
.ease(Quad.OUT).setCallback(new TweenCallback() {
@Override
public void onEvent(int type, BaseTween<?> source) {
moveTo(x, y, tweenManager, null);
}
}).start(tweenManager);
timerTask = new Timer.Task() {
@Override
public void run() {
isDashUp = true;
}
};
isDashUp = false;
timer.scheduleTask(timerTask, (long) Config.WISPER_DASH_TIMEOUT);
} else {
moveTo(x, y, tweenManager, null);
Debug.Log("Dash not ready yet, " + (timerTask.getExecuteTimeMillis() - System.nanoTime() / 1000000) + "ms remaining");
}
}
示例10: show
import aurelienribon.tweenengine.equations.Quad; //导入依赖的package包/类
@Override
public void show() {
batch = new SpriteBatch();
manager = new TweenManager();
floatValue = new FloatValue();
libgdx = new Sprite(new Texture(Gdx.files.internal("libgdxsplash.png")));
ludumdare = new Sprite(new Texture(Gdx.files.internal("ludumdaresplash.png")));
portalprogramming = new Sprite(new Texture(Gdx.files.internal("portalprogrammingsplash.png")));
Tween.registerAccessor(FloatValue.class, new FloatTweener());
Tween.to(floatValue, 0, 3.0f).target(1.0f).ease(Quad.INOUT).repeatYoyo(5, 0).setCallback(new TweenCallback(){
@Override
public void onEvent(int arg0, BaseTween<?> arg1) {
game.setScreen(new MainMenuScreen(game));
}
}).start(manager);
}
示例11: to
import aurelienribon.tweenengine.equations.Quad; //导入依赖的package包/类
/**
* Factory creating a new standard interpolation. This is the most common
* type of interpolation. The starting values are retrieved automatically
* after the delay (if any).
* <br/><br/>
*
* <b>You need to set the target values of the interpolation by using one
* of the target() methods</b>. The interpolation will run from the
* starting values to these target values.
* <br/><br/>
*
* The common use of Tweens is "fire-and-forget": you do not need to care
* for tweens once you added them to a TweenManager, they will be updated
* automatically, and cleaned once finished. Common call:
* <br/><br/>
*
* <pre> {@code
* Tween.to(myObject, POSITION, 1.0f)
* .target(50, 70)
* .ease(Quad.INOUT)
* .start(myManager);
* }</pre>
*
* Several options such as delay, repetitions and callbacks can be added to
* the tween.
*
* @param target The target object of the interpolation.
* @param tweenType The desired type of interpolation.
* @param duration The duration of the interpolation, in milliseconds.
* @return The generated Tween.
*/
public static Tween to(Object target, int tweenType, float duration) {
Tween tween = pool.get();
tween.setup(target, tweenType, duration);
tween.ease(Quad.INOUT);
tween.path(TweenPaths.catmullRom);
return tween;
}
示例12: from
import aurelienribon.tweenengine.equations.Quad; //导入依赖的package包/类
/**
* Factory creating a new reversed interpolation. The ending values are
* retrieved automatically after the delay (if any).
* <br/><br/>
*
* <b>You need to set the starting values of the interpolation by using one
* of the target() methods</b>. The interpolation will run from the
* starting values to these target values.
* <br/><br/>
*
* The common use of Tweens is "fire-and-forget": you do not need to care
* for tweens once you added them to a TweenManager, they will be updated
* automatically, and cleaned once finished. Common call:
* <br/><br/>
*
* <pre> {@code
* Tween.from(myObject, POSITION, 1.0f)
* .target(0, 0)
* .ease(Quad.INOUT)
* .start(myManager);
* }</pre>
*
* Several options such as delay, repetitions and callbacks can be added to
* the tween.
*
* @param target The target object of the interpolation.
* @param tweenType The desired type of interpolation.
* @param duration The duration of the interpolation, in milliseconds.
* @return The generated Tween.
*/
public static Tween from(Object target, int tweenType, float duration) {
Tween tween = pool.get();
tween.setup(target, tweenType, duration);
tween.ease(Quad.INOUT);
tween.path(TweenPaths.catmullRom);
tween.isFrom = true;
return tween;
}
示例13: set
import aurelienribon.tweenengine.equations.Quad; //导入依赖的package包/类
/**
* Factory creating a new instantaneous interpolation (thus this is not
* really an interpolation).
* <br/><br/>
*
* <b>You need to set the target values of the interpolation by using one
* of the target() methods</b>. The interpolation will set the target
* attribute to these values after the delay (if any).
* <br/><br/>
*
* The common use of Tweens is "fire-and-forget": you do not need to care
* for tweens once you added them to a TweenManager, they will be updated
* automatically, and cleaned once finished. Common call:
* <br/><br/>
*
* <pre> {@code
* Tween.set(myObject, POSITION)
* .target(50, 70)
* .delay(1.0f)
* .start(myManager);
* }</pre>
*
* Several options such as delay, repetitions and callbacks can be added to
* the tween.
*
* @param target The target object of the interpolation.
* @param tweenType The desired type of interpolation.
* @return The generated Tween.
*/
public static Tween set(Object target, int tweenType) {
Tween tween = pool.get();
tween.setup(target, tweenType, 0);
tween.ease(Quad.INOUT);
return tween;
}