本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Image.setScale方法的典型用法代码示例。如果您正苦于以下问题:Java Image.setScale方法的具体用法?Java Image.setScale怎么用?Java Image.setScale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.ui.Image
的用法示例。
在下文中一共展示了Image.setScale方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MenuScreen
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
/**
* Menu Screen's constructor.
* It initializes all the Menu elements.
*
* @param game The current game session.
*/
protected MenuScreen(final Armadillo game) {
this.game = game;
batch = game.getBatch();
gameServices = game.getGameServices();
skin1 = game.getPrimarySkin();
skin2 = game.getSecondarySkin();
viewport = new FitViewport(VIEWPORT_WIDTH, VIEWPORT_HEIGHT);
viewport.apply();
stage = new Stage(viewport, batch);
backgroundImg = new Image(game.getAssetManager().get("background.png", Texture.class));
backgroundImg.setScale(VIEWPORT_WIDTH / backgroundImg.getWidth(), VIEWPORT_HEIGHT / backgroundImg.getHeight());
titleImg = new Image(game.getAssetManager().get("armadillo_title.png", Texture.class));
titleImg.setSize(0.8f * titleImg.getWidth(), 0.8f * titleImg.getHeight());
titleImg.setPosition(VIEWPORT_WIDTH / 2 - titleImg.getWidth() / 2, VIEWPORT_HEIGHT * 0.98f - titleImg.getHeight());
}
示例2: visualize
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
@Override public IFuture<Void> visualize(ITargetOwner result) {
final Future<Void> future = new Future<Void>();
SoundManager.instance.playSoundIfExists(soundName);
Image image = new Image(Config.skin, "effect-luck-image");
image.setColor(color);
image.setScale(0, 0);
image.setOrigin(image.getWidth() / 2, image.getHeight() / 2);
image.setPosition(
result.getTarget().getX() * ViewController.CELL_SIZE + (ViewController.CELL_SIZE - image.getWidth()) * 0.5f,
result.getTarget().getY() * ViewController.CELL_SIZE + (ViewController.CELL_SIZE - image.getHeight()) * 0.5f + 6
);
visualizer.viewController.effectLayer.addActor(image);
image.addAction(
Actions.sequence(
Actions.parallel(
Actions.scaleTo(0.75f, 0.75f, 0.5f, Interpolation.sine),
Actions.rotateBy(135, 0.5f)
),
Actions.parallel(
Actions.scaleTo(0, 0, 0.5f, Interpolation.sine),
Actions.rotateBy(135, 0.5f)
),
Actions.run(future),
Actions.removeActor()
)
);
return future;
}