当前位置: 首页>>代码示例>>Java>>正文


Java Quad类代码示例

本文整理汇总了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;
}
 
开发者ID:mini2Dx,项目名称:universal-tween-engine,代码行数:31,代码来源:TweenUtils.java

示例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);
}
 
开发者ID:randombot,项目名称:bar,代码行数:20,代码来源:Play.java

示例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);
    }
}
 
开发者ID:justinmeister,项目名称:PongWithLibgdx,代码行数:21,代码来源:PongBoard.java

示例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);
}
 
开发者ID:Drusy,项目名称:freebox-v6-monitor,代码行数:22,代码来源:TaskPanel.java

示例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);
}
 
开发者ID:matachi,项目名称:slashat-the-game,代码行数:21,代码来源:Game.java

示例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);
	}
}
 
开发者ID:Drusy,项目名称:freebox-v6-monitor,代码行数:13,代码来源:TaskPanel.java

示例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);
}
 
开发者ID:Drusy,项目名称:freebox-v6-monitor,代码行数:10,代码来源:TaskPanel.java

示例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);
}
 
开发者ID:Drusy,项目名称:Wisper,代码行数:15,代码来源:Wisper.java

示例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");
    }
}
 
开发者ID:Drusy,项目名称:Wisper,代码行数:41,代码来源:Wisper.java

示例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);
	
}
 
开发者ID:Portals,项目名称:DropTheCube-LD32,代码行数:25,代码来源:SplashScreen.java

示例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;
}
 
开发者ID:mini2Dx,项目名称:universal-tween-engine,代码行数:39,代码来源:Tween.java

示例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;
}
 
开发者ID:mini2Dx,项目名称:universal-tween-engine,代码行数:39,代码来源:Tween.java

示例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;
}
 
开发者ID:mini2Dx,项目名称:universal-tween-engine,代码行数:36,代码来源:Tween.java


注:本文中的aurelienribon.tweenengine.equations.Quad类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。