本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Image.setRotation方法的典型用法代码示例。如果您正苦于以下问题:Java Image.setRotation方法的具体用法?Java Image.setRotation怎么用?Java Image.setRotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.ui.Image
的用法示例。
在下文中一共展示了Image.setRotation方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateImage
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
private void updateImage() {
Image toUse;
Image toRemove;
if (currentIndex % 2 == 0) { // even
toUse = dia;
toRemove = orto;
} else {
toUse = orto;
toRemove = dia;
}
toRemove.remove();
group.addActor(toUse);
toUse.setRotation(getRotation(currentIndex));
}
示例2: visualize
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
@Override public IFuture<Void> visualize(final T result) {
final Future<Void> future = Future.make();
final WorldObjectView actorView = visualizer.viewController.getView(result.getActor());
WorldObjectView targetView = visualizer.viewController.getView(result.getTarget());
visualizer.viewController.world.dispatcher.dispatch(ResultVisualizer.VISUALIZE_ATTACK, result.getActor());
Vector2 direction = tmp
.set(result.getTarget().getX(), result.getTarget().getY())
.sub(result.getActor().getX(), result.getActor().getY());
float dx = targetView.getX() - actorView.getX();
float dy = targetView.getY() - actorView.getY();
visualizer.viewController.scroller.centerOn(result.getTarget());
final Image arrow = new Image(Config.skin,"animation/" + result.getAbility().name + "-shot");
arrow.setPosition(actorView.getX(), actorView.getY());
visualizer.viewController.effectLayer.addActor(arrow);
arrow.setOrigin(13, 14);
arrow.setRotation(direction.angle() - 45);
arrow.addAction(Actions.sequence(
Actions.moveBy(dx, dy, tmp.set(dx, dy).len() * 0.002f),
Actions.run(new Runnable() {
@Override public void run() {
SoundManager.instance.playSoundIfExists(result.getAbility().soundName);
arrow.remove();
future.happen();
}
})
));
return future;
}
示例3: addBackgroundObject
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
private void addBackgroundObject(boolean anywhere) {
final Image image = new Image(backgroundDrawables.random());
backgroundLayer.addActor(image);
float scale = 0.5f * MathUtils.random(1, 2);
image.setSize(image.getPrefWidth() * scale, image.getPrefHeight() * scale);
image.setRotation(MathUtils.random(0, 1) * 180);
image.getColor().a = MathUtils.random(0.1f, 0.3f);
float w = Math.max(world.stage.getWidth(), root.getWidth() + ViewScroller.LEFT + ViewScroller.RIGHT);
float h = Math.max(world.stage.getHeight(), root.getHeight() + ViewScroller.TOP + ViewScroller.BOTTOM);
if (anywhere)
image.setPosition(-root.getX() + w * MathUtils.random(), -root.getY() + h * MathUtils.random());
else
image.setPosition(-root.getX() - image.getWidth(), -root.getY() + h * MathUtils.random());
image.addAction(Actions.sequence(
Actions.moveBy(w + image.getWidth() - image.getX(), 0, 15 + MathUtils.random(6)),
Actions.run(new Runnable() {
@Override public void run() {
image.remove();
addBackgroundObject(false);
}
})
));
}
示例4: addTopRightCornerTransition
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
public static Image addTopRightCornerTransition(String name, int x, int y, Group layer) {
TextureAtlas.AtlasRegion region = Config.findRegions("transitions/" + name + "-corner").random();
if (region == null)
return null;
Image image = new Image(region);
layer.addActor(image);
image.setRotation(-90);
image.setPosition(x * CELL_SIZE, (y + 1) * CELL_SIZE);
return image;
}
示例5: addBottomLeftCornerTransition
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
public static Image addBottomLeftCornerTransition(String name, int x, int y, Group layer) {
TextureAtlas.AtlasRegion region = Config.findRegions("transitions/" + name + "-corner").random();
if (region == null)
return null;
Image image = new Image(region);
layer.addActor(image);
image.setRotation(90);
image.setPosition((x + 1) * CELL_SIZE, (y) * CELL_SIZE);
return image;
}
示例6: addBottomRightCornerTransition
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
public static Image addBottomRightCornerTransition(String name, int x, int y, Group layer) {
TextureAtlas.AtlasRegion region = Config.findRegions("transitions/" + name + "-corner").random();
if (region == null)
return null;
Image image = new Image(region);
layer.addActor(image);
image.setRotation(180);
image.setPosition((x + 1) * CELL_SIZE, (y + 1) * CELL_SIZE);
return image;
}
示例7: addLeftOutline
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
public static Image addLeftOutline(int x, int y, String name, Group layer) {
TextureAtlas.AtlasRegion region = Config.findRegions("tile/" + name + "-outline").random();
if (region == null)
return null;
Image image = new Image(region);
image.setRotation(180);
layer.addActor(image);
image.setPosition(x * CELL_SIZE + image.getWidth(), (y + 1) * CELL_SIZE);
return image;
}
示例8: addBottomOutline
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
public static Image addBottomOutline(int x, int y, String name, Group layer) {
TextureAtlas.AtlasRegion region = Config.findRegions("tile/" + name + "-outline").random();
if (region == null)
return null;
Image image = new Image(region);
image.setRotation(-90);
layer.addActor(image);
image.setPosition(x * CELL_SIZE, y * CELL_SIZE + image.getWidth());
return image;
}
示例9: addTopOutline
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
public static Image addTopOutline(int x, int y, String name, Group layer) {
TextureAtlas.AtlasRegion region = Config.findRegions("tile/" + name + "-outline").random();
if (region == null)
return null;
Image image = new Image(region);
image.setRotation(90);
layer.addActor(image);
image.setPosition((x + 1) * CELL_SIZE, (y + 1) * CELL_SIZE - image.getWidth());
return image;
}