本文整理匯總了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;
}