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