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


Java TweenManager类代码示例

本文整理汇总了Java中aurelienribon.tweenengine.TweenManager的典型用法代码示例。如果您正苦于以下问题:Java TweenManager类的具体用法?Java TweenManager怎么用?Java TweenManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TweenManager类属于aurelienribon.tweenengine包,在下文中一共展示了TweenManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: show

import aurelienribon.tweenengine.TweenManager; //导入依赖的package包/类
@Override
public void show() {
    tweenManager = new TweenManager();
    Tween.registerAccessor(Sprite.class, new SpriteAccessor());

    splash = new Sprite(new Texture(Gdx.files.internal("inferno_duck.png")));
    //splash.setPosition(Gdx.graphics.getWidth()/2 - splash.getWidth() / 2, Gdx.graphics.getHeight()/2 - splash.getHeight() /2);

    Tween.set(splash, SpriteAccessor.ALPHA).target(0).start(tweenManager);
    Tween.to(splash, SpriteAccessor.ALPHA, 2).target(1).repeatYoyo(1, 15f).setCallback(new TweenCallback() {
        @Override
        public void onEvent(int type, BaseTween<?> source) {
            game.setScreen(new MenuScreen(game));
        }
    }).start(tweenManager);
}
 
开发者ID:edwardszczepanski,项目名称:QuackHack,代码行数:17,代码来源:SplashScreen.java

示例2: onAddCollectible

import aurelienribon.tweenengine.TweenManager; //导入依赖的package包/类
@Override
public void onAddCollectible(PlayerManager.Collectible collectible) {
    if (collectible.getType() == type) {
        if (collectible.getMaxAmount() > 0) {
            text.setText(collectible.getCurrentAmount() + "/" + collectible.getMaxAmount());
            if (collectible.getCurrentAmount() == collectible.getMaxAmount()) {
                setColor(Colors.SUCCESS);
            } else {
                setColor(Color.WHITE.cpy());
            }
        } else {
            text.setText(String.valueOf(collectible.getCurrentAmount()));
        }
        TweenManager mgr = SharedTweenManager.getInstance();
        mgr.killTarget(this);
        getColor().a = 1f;
        if (collectible.getCurrentAmount() != collectible.getMaxAmount()) {
            Tween.to(this, ActorTween.ALPHA, .7f).target(defaultAlpha).start(mgr);
        }
    }
}
 
开发者ID:bitbrain,项目名称:rbcgj-2016,代码行数:22,代码来源:CollectibleWidget.java

示例3: Candy

import aurelienribon.tweenengine.TweenManager; //导入依赖的package包/类
public Candy(float x, float y, int size, float speed, TweenManager tweenManager) {
	sprite = new Sprite(Resources.CANDY);
	this.x = x - size / 2;
	this.y = y - size / 2;
	this.size = size;
	this.speed = speed;
	velocity = generateRandomVelocity();
	this.color = getRandomColor();
	this.rotationFactor = getRandomRotationFactor();
	
	if (tweenManager != null) {
		Tween.to(color, ColorTween.A, 2f)
			 .target(1f)
			 .ease(TweenEquations.easeInExpo)
			 .start(tweenManager);
	} else {
		color.a = 1f;
	}
}
 
开发者ID:tamzi,项目名称:sophia,代码行数:20,代码来源:Candy.java

示例4: create

import aurelienribon.tweenengine.TweenManager; //导入依赖的package包/类
@Override
public void create () {
	Env.init(this);
	
	camera = new OrthographicCamera();
	viewport = new ExtendViewport(960, 720, 1280, 720, camera);
	assets = new Assets();
	
	tweenManager = new TweenManager();
	Tween.setCombinedAttributesLimit(4);
	Tween.registerAccessor(Actor.class, new ActorTweener());
	
	screens = new ObjectMap<Class<? extends Screen>, Screen>();
	screens.put(GameScreen.class, new GameScreen());
	
	setScreen(GameScreen.class);
}
 
开发者ID:saltares,项目名称:ludumdare-29,代码行数:18,代码来源:LudumDare.java

示例5: LifeBar

import aurelienribon.tweenengine.TweenManager; //导入依赖的package包/类
public LifeBar(GameObject target, TweenManager tweenManager) {
	this.target = target;

	Texture lifeTexture = Resources.get(Resources.LIFE, Texture.class);

	currentPoints = target.getCurrentLife();
	this.tweenManager = tweenManager;

	Pixmap map = new Pixmap(20, 100, Format.RGBA8888);
	map.setColor(Color.BLACK);
	map.fill();

	Texture backgroundTexture = new Texture(map);
	map.dispose();
	life = new Sprite(lifeTexture);
	background = new Sprite(backgroundTexture);

	padding = 10;

	getColor().a = 0.5f;
}
 
开发者ID:bitbrain,项目名称:plox,代码行数:22,代码来源:LifeBar.java

示例6: show

import aurelienribon.tweenengine.TweenManager; //导入依赖的package包/类
@Override
public void show() {
	tweenManager = new TweenManager();
	background = new Sprite(Resources.get(Resources.BACKGROUND, Texture.class));
	logo = new Sprite(Resources.get(Resources.LOGO, Texture.class));
	logoWidth = logo.getWidth();
	logoHeight = logo.getHeight();
	batch = new SpriteBatch();

	float scaleFactor = Gdx.graphics.getWidth() / 800f;

	logo.setBounds(0, 0, scaleFactor * logoWidth, scaleFactor * logoHeight);

	logo.setX(Gdx.graphics.getWidth() / 2f - logo.getWidth() / 2f);
	logo.setY(Gdx.graphics.getHeight() - logo.getHeight() - 70);

	animateLogo();
}
 
开发者ID:bitbrain,项目名称:plox,代码行数:19,代码来源:MenuScreen.java

示例7: animate

import aurelienribon.tweenengine.TweenManager; //导入依赖的package包/类
public void animate(TweenManager tweenManager, float delay) {
  refresh();
  tweenManager.killTarget(shadow);
  tweenManager.killTarget(background);
  // Alpha fading
  shadow.setAlpha(0f);
  background.setAlpha(0f);
  Tween.to(background, TweenType.ALPHA.ordinal(), 0.4f).target(1f).ease(TweenEquations.easeInCubic).start(tweenManager);
  Tween.to(shadow, TweenType.ALPHA.ordinal(), 0.4f).target(1f).ease(TweenEquations.easeInCubic).start(tweenManager);
  // vertical bounce
  float originalY = background.getY();
  background.setY(Gdx.graphics.getHeight() + getHeight());
  Tween.to(background, TweenType.POS_Y.ordinal(), 1.0f).target(originalY).ease(TweenEquations.easeOutBounce).delay(delay)
      .start(tweenManager);
  // Shadow scaling
  shadow.setOrigin(shadow.getWidth() / 2f, shadow.getHeight() / 2f);
  shadow.setScale(0.0f);
  Tween.to(shadow, TweenType.SCALE.ordinal(), 1.0f).target(1f).ease(TweenEquations.easeOutBounce).delay(delay).delay(0.2f)
      .start(tweenManager);
}
 
开发者ID:bitbrain,项目名称:craft,代码行数:21,代码来源:CraftingWidget.java

示例8: configure

import aurelienribon.tweenengine.TweenManager; //导入依赖的package包/类
@Override
protected void configure() {
  install(PostConstructModule.INSTANCE);
  StateScope scope = new StateScope();
  bindScope(StateScoped.class, scope);
  bind(StateScope.class).annotatedWith(Names.named("stateScope")).toInstance(scope);
  bind(OrthographicCamera.class).in(StateScoped.class);
  bind(Camera.class).to(OrthographicCamera.class).in(StateScoped.class);
  bind(ShaderManager.class).to(SimpleShaderManager.class).in(StateScoped.class);
  bind(ParticleRenderer.class);
  bind(EventBus.class).to(MBassadorEventBus.class);
  bind(DragDropHandler.class);
  bind(IconManager.class);
  bind(TweenManager.class).in(StateScoped.class);
  bind(CraftGame.class).asEagerSingleton();
  bind(CommandLineInterface.class).asEagerSingleton();
  bind(TooltipManager.class).asEagerSingleton();
  bind(LoadingScreen.class);
  bind(TitleScreen.class);
  bind(IngameScreen.class);
  bind(ProfessionScreen.class);
  bind(DataMigrator.class);
}
 
开发者ID:bitbrain,项目名称:craft,代码行数:24,代码来源:StateModule.java

示例9: getNRuntimeTweens

import aurelienribon.tweenengine.TweenManager; //导入依赖的package包/类
private int getNRuntimeTweens(TweenSystem tweenSystem) {
	try {
		Field tweenManagerField = ClassReflection.getDeclaredField(
				TweenSystem.class, "tweenManager");
		tweenManagerField.setAccessible(true);
		TweenManager tweenManager = (TweenManager) tweenManagerField
				.get(tweenSystem);
		return tweenManager.getRunningTweensCount();
	} catch (Exception e) {
		Gdx.app.debug(
				"RemoveEntityTest",
				"An exception occurred checking ig tweens are automatically killed when an entity is removed",
				e);
		fail("An unexpected exception occurred");
	}
	return -1;
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:18,代码来源:RemoveEntityTest.java

示例10: create

import aurelienribon.tweenengine.TweenManager; //导入依赖的package包/类
@Override
public void create()
{
	Gdx.app.log(XesEffects.LOG, "Creating game object..");

	this.fpsLogger = new FPSLogger();
	this.tweenManager = new TweenManager();

	Tween.setCombinedAttributesLimit(4);
	Tween.registerAccessor(Color.class, new ColorAccessor());

	this.skin = new Skin(Gdx.files.internal("ui/uiskin.json"));
	
	int index = 1;
	this.effectsCollection = new ScreenFactory<EffectScreenConfig>(this);
	this.effectsCollection.add(
		(new EffectScreenConfig(String.format("Effect %d", index++), EffectScreen.class))
		.setTitle("Test subject number 1")
	);

	this.setScreen(this.getSplashScreen());
}
 
开发者ID:Xesenix,项目名称:libgdx-template-project,代码行数:23,代码来源:XesEffects.java

示例11: show

import aurelienribon.tweenengine.TweenManager; //导入依赖的package包/类
@Override
public void show() {
	batch = new SpriteBatch();
	tweenManager = new TweenManager();
	Tween.registerAccessor(Sprite.class, new SpriteAccessor());

	float widthScale = Gdx.graphics.getWidth() / Config.WIDTH;
	float heightScale = Gdx.graphics.getHeight() / Config.HEIGHT;

	Texture splashTexture = new Texture("icons/nolatorg.png");
	splashTexture.setFilter(TextureFilter.Nearest, TextureFilter.Nearest);
	splash = new Sprite(splashTexture);
	splash.setSize(widthScale * splash.getWidth(), heightScale * splash.getHeight());
	splash.setOrigin(splash.getWidth() / 2, splash.getWidth() / 2);
	splash.setPosition(Gdx.graphics.getWidth() / 2 - splash.getWidth() / 2,
			Gdx.graphics.getHeight() / 2 - splash.getHeight() / 2);

	Tween.set(splash, SpriteAccessor.ALPHA).target(0f).start(tweenManager);
	Tween.to(splash, SpriteAccessor.ALPHA, 1f).target(1f).repeatYoyo(1, 1f).setCallback(new TweenCallback() {
		@Override
		public void onEvent(int type, BaseTween<?> source) {
			((Game) Gdx.app.getApplicationListener()).setScreen(new MainMenu());
		}
	}).start(tweenManager);
	tweenManager.update(Float.MIN_VALUE);
}
 
开发者ID:Talon876,项目名称:explosions,代码行数:27,代码来源:Splash.java

示例12: initAnimations

import aurelienribon.tweenengine.TweenManager; //导入依赖的package包/类
private void initAnimations() {
    tweenManager = new TweenManager();

    Tween.registerAccessor(Sprite.class, new SpriteAccessor());
    Tween.registerAccessor(Image.class, new ImageAccessor());
    Tween.registerAccessor(ParticleEffect.class, new ParticleEffectAccessor());

    Tween.set(splash, SpriteAccessor.ALPHA).target(0).start(tweenManager);
    Tween.set(startImageButton, ImageAccessor.ALPHA).target(0).start(tweenManager);
    Tween.set(closeImageButton, ImageAccessor.ALPHA).target(0).start(tweenManager);
    Tween.set(settingsImageButton, ImageAccessor.ALPHA).target(0).start(tweenManager);

    Tween.to(splash, SpriteAccessor.ALPHA, Config.ANIMATION_DURATION).target(1).start(tweenManager);
    Tween.to(startImageButton, ImageAccessor.ALPHA, Config.ANIMATION_DURATION).target(1).delay(Config.ANIMATION_DURATION / 2f).start(tweenManager);
    Tween.to(closeImageButton, ImageAccessor.ALPHA, Config.ANIMATION_DURATION).target(1).delay(Config.ANIMATION_DURATION / 2f).start(tweenManager);
    Tween.to(settingsImageButton, ImageAccessor.ALPHA, Config.ANIMATION_DURATION).target(1).delay(Config.ANIMATION_DURATION / 2f).start(tweenManager);

    tweenManager.update(Float.MIN_VALUE);
}
 
开发者ID:Drusy,项目名称:Wisper,代码行数:20,代码来源:MainMenu.java

示例13: preLoad

import aurelienribon.tweenengine.TweenManager; //导入依赖的package包/类
public void preLoad()
{
	input = new InputManager(se);
	Controllers.addListener(input);
	
	atlas = new TextureAtlas("main.atlas");
	titleScreenAtlas = new TextureAtlas("titlescreen.atlas");
	menuControlsAtlas = new TextureAtlas("menu.atlas");
	menuFont = new BitmapFont(Gdx.files.internal("data/cgcfont.fnt"), atlas.findRegion("cgcfont"), false);
	titleFont = new BitmapFont(Gdx.files.internal("data/cgctitlefont.fnt"), atlas.findRegion("cgctitlefont"), false);
	sBatch = new SpriteBatch(1625);
	shapes = new ShapeRenderer();
	tManager = new TweenManager();

	FileHandle baseFileHandle = Gdx.files.internal("i18n/CGCLang");
	I18NBundle myBundle = I18NBundle.createBundle(baseFileHandle, locale);

	lang = myBundle;
	ChaseApp.alert("lang loaded");
}
 
开发者ID:ChainGangChase,项目名称:cgc-game,代码行数:21,代码来源:ChaseApp.java

示例14: init

import aurelienribon.tweenengine.TweenManager; //导入依赖的package包/类
public void init(){
	tweenManager = new TweenManager();
	instances = new ArrayList<ModelInstance>();
	endFade = new FadeRenderer();
	laser = new LaserRenderer();
	
	setupSound();
	setupEnviroment();
	setupScreen();
	setupUi();
}
 
开发者ID:raphaelbruno,项目名称:ZombieInvadersVR,代码行数:12,代码来源:ScreenBase.java

示例15: show

import aurelienribon.tweenengine.TweenManager; //导入依赖的package包/类
@Override
public void show() {
    //initialize sprite batch
    batch = new SpriteBatch();
    //initialize splash sprite
    splash = new Sprite(TextureLoader.getSplash());
    //set splash size
    splash.setSize(Gdx.graphics.getWidth(),Gdx.graphics.getHeight());


    //setup animation
    tween = new TweenManager();
    Tween.registerAccessor(Sprite.class, new SpriteAccessor());

    //FadeIN
    Tween.set(splash,SpriteAccessor.ALPHA).target(0).start(tween);
    Tween.to(splash,SpriteAccessor.ALPHA,1.5f).target(1).start(tween);

    //FadeOut
    Tween.to(splash,SpriteAccessor.ALPHA,2f).target(0).delay(1.25f).setCallback(new TweenCallback() {
        @Override
        public void onEvent(int type, BaseTween<?> source) {
            ((Game)Gdx.app.getApplicationListener()).setScreen(new MainMenu());
        }
    }).start(tween);


}
 
开发者ID:msk610,项目名称:Chemtris,代码行数:29,代码来源:Splash.java


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