本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Image.setAlign方法的典型用法代码示例。如果您正苦于以下问题:Java Image.setAlign方法的具体用法?Java Image.setAlign怎么用?Java Image.setAlign使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.ui.Image
的用法示例。
在下文中一共展示了Image.setAlign方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUpOnResume
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
public void setUpOnResume() {
onResume = new Image(AssetsManager.getTextureRegion(Constants.RESUME_IMAGE_NAME));
onResume.setAlign(Align.center);
onResume.setSize(Constants.ONRESUME_WIDTH, Constants.ONRESUME_HEIGHT);
onResume.setOrigin(onResume.getWidth() / 2, onResume.getHeight() / 2);
onResume.setPosition(Constants.WIDTH / 2 - onResume.getWidth() / 2, Constants.HEIGHT / 2 - onResume.getHeight() * 1.5f);
onResume.addAction(setOnStateImageAction(0.7f));
stage.addActor(onResume);
}
示例2: initialize
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
@Override protected void initialize() {
creaturesList.defaults().pad(2);
creaturesList.padTop(12);
Image left = new Image(Config.skin, "ui-creature-queue-gradient-left");
left.setScaling(Scaling.stretchY);
left.setAlign(Align.left);
left.setTouchable(Touchable.disabled);
Image right = new Image(Config.skin, "ui-creature-queue-gradient-right");
right.setScaling(Scaling.stretchY);
right.setAlign(Align.right);
right.setTouchable(Touchable.disabled);
Stack stack = new Stack();
stack.add(new ScrollPane(creaturesList, new ScrollPane.ScrollPaneStyle()));
stack.add(left);
stack.add(right);
Table content = new Table(Config.skin);
content.setTouchable(Touchable.enabled);
content.setBackground("ui-inventory-ability-window-background");
content.defaults().pad(2);
content.add(new LocLabel("ui-turns-order")).row();
content.add(new Image(Config.skin, "ui-creature-info-line")).width(100).row();
content.add(stack).maxWidth(table.getStage().getWidth() - 45).padRight(4).padLeft(4).row();
table.add(content);
}
示例3: AbilityIconCounter
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
public AbilityIconCounter(Ability ability, int value) {
if (ability == null) {
ability = Config.abilities.get("skip-turn");
}
image = new Image(Config.skin.getDrawable("ability/" + ability.name + "-icon"));
if (ability.cost <0) image.setColor(AbilityIcon.unique);
image.setScaling(Scaling.none);
image.setAlign(Align.left | Align.top);
image.moveBy(0, 1);
counter = new Label("", Config.skin, "default", "inventory-counter");
counter.setAlignment(Align.right | Align.bottom);
setCount(value);
addActor(image);
addActor(counter);
setSize(image.getPrefWidth(), image.getPrefHeight());
}