本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Stack类的典型用法代码示例。如果您正苦于以下问题:Java Stack类的具体用法?Java Stack怎么用?Java Stack使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Stack类属于com.badlogic.gdx.scenes.scene2d.ui包,在下文中一共展示了Stack类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: InventorySlot
import com.badlogic.gdx.scenes.scene2d.ui.Stack; //导入依赖的package包/类
public InventorySlot(){
_filterItemType = 0; //filter nothing
_defaultBackground = new Stack();
_customBackgroundDecal = new Image();
Image image = new Image(Assets.instance.STATUSUI_SKIN,"cell");
numItemsLabel = new Label(String.valueOf(numItemsVal), Assets.instance.STATUSUI_SKIN);
numItemsLabel.setAlignment(Align.bottomRight);
numItemsLabel.setVisible(false);
_defaultBackground.add(image);
_defaultBackground.setName("background");
numItemsLabel.setName("numitems");
this.add(_defaultBackground);
this.add(numItemsLabel);
}
示例2: MenuManager
import com.badlogic.gdx.scenes.scene2d.ui.Stack; //导入依赖的package包/类
public MenuManager(int width, int height, Runnable onEmptyPop) {
this.stage = new Stage(new ExtendScreenViewport(width, height), DrawUtil.batch);
this.onEmptyPop = onEmptyPop;
this.width = width;
this.height = height;
stack = new Stack();
table = new Table();
table.setFillParent(true);
table.setTransform(false);
table.row().expand().fill();
table.add().colspan(3).expand().fill();
table.row();
table.add().expandX().fillX();
table.add(stack).minSize(width, height).maxSize(width, height);
table.add().expandX().fillX();
table.row().expand().fill();
table.add().colspan(3).expand().fill();
stage.addActor(table);
}
示例3: setup
import com.badlogic.gdx.scenes.scene2d.ui.Stack; //导入依赖的package包/类
public static void setup(){
registerSerializer(Actor.class, new ActorSerializer());
registerSerializer(Scene.class, new SceneSerializer());
registerSerializer(ImageJson.class, new ImageJson());
registerSerializer(Label.class, new LabelSerializer());
registerSerializer(Button.class, new ButtonSerializer());
registerSerializer(TextButton.class, new TextButtonSerializer());
registerSerializer(Table.class, new TableSerializer());
registerSerializer(CheckBox.class, new CheckBoxSerializer());
registerSerializer(SelectBox.class, new SelectBoxSerializer());
registerSerializer(List.class, new ListSerializer());
registerSerializer(Slider.class, new SliderSerializer());
registerSerializer(TextField.class, new TextFieldSerializer());
registerSerializer(Touchpad.class, new TouchpadSerializer());
registerSerializer(Sprite.class, new SpriteSerializer());
registerSerializer(Dialog.class, new DialogSerializer());
registerSerializer(SplitPane.class, new SplitPaneSerializer());
registerSerializer(ScrollPane.class, new ScrollPaneSerializer());
registerSerializer(Stack.class, new StackSerializer());
registerSerializer(Tree.class, new TreeSerializer());
registerSerializer(Table.class, new TableSerializer());
registerSerializer(ButtonGroup.class, new ButtonGroupSerializer());
registerSerializer(HorizontalGroup.class, new HorizontalGroupSerializer());
registerSerializer(VerticalGroup.class, new VerticalGroupSerializer());
}
示例4: create
import com.badlogic.gdx.scenes.scene2d.ui.Stack; //导入依赖的package包/类
public void create () {
lastUpdateTime = 0;
testStack = new Stack();
container.stage.getRoot().addActorAt(0, testStack);
testStack.setSize(container.stageWidth, container.stageHeight);
testStack.add(testTable = new Table() {
@Override
public void act (float delta) {
float time = GdxAI.getTimepiece().getTime();
if (lastUpdateTime != time) {
lastUpdateTime = time;
super.act(GdxAI.getTimepiece().getDeltaTime());
}
}
});
testStack.layout();
}
示例5: create
import com.badlogic.gdx.scenes.scene2d.ui.Stack; //导入依赖的package包/类
@Override
public void create () {
lastUpdateTime = 0;
testStack = new Stack();
container.stage.getRoot().addActorAt(0, testStack);
testStack.setSize(container.stageWidth, container.stageHeight);
testStack.add(testTable = new Table() {
@Override
public void act (float delta) {
float time = GdxAI.getTimepiece().getTime();
if (lastUpdateTime != time) {
lastUpdateTime = time;
super.act(GdxAI.getTimepiece().getDeltaTime());
}
}
});
testStack.layout();
}
示例6: initialize
import com.badlogic.gdx.scenes.scene2d.ui.Stack; //导入依赖的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);
}
示例7: initialize
import com.badlogic.gdx.scenes.scene2d.ui.Stack; //导入依赖的package包/类
private void initialize () {
setTouchable(Touchable.enabled);
tabTitleTable = new Table();
tabBodyStack = new Stack();
selectedIndex = -1;
// Create 1st row
Cell<?> leftCell = add(new Image(style.titleBegin));
Cell<?> midCell = add(tabTitleTable);
Cell<?> rightCell = add(new Image(style.titleEnd));
switch (tabTitleAlign) {
case Align.left:
leftCell.width(((Image)leftCell.getActor()).getWidth()).bottom();
midCell.left();
rightCell.expandX().fillX().bottom();
break;
case Align.right:
leftCell.expandX().fillX().bottom();
midCell.right();
rightCell.width(((Image)rightCell.getActor()).getWidth()).bottom();
break;
case Align.center:
leftCell.expandX().fillX().bottom();
midCell.center();
rightCell.expandX().fillX().bottom();
break;
default:
throw new IllegalArgumentException("TabbedPane align must be one of left, center, right");
}
// Create 2nd row
row();
Table t = new Table();
t.setBackground(style.bodyBackground);
t.add(tabBodyStack).expand().fill();
add(t).colspan(3).expand().fill();
}
示例8: getTilesetPreview
import com.badlogic.gdx.scenes.scene2d.ui.Stack; //导入依赖的package包/类
private Actor getTilesetPreview(TilesetDefinition definition) {
FileHandle handle = Gdx.files.absolute(Editor.db().config().projectPath + Editor.db().config().tilesetPath + definition.filename + ".png");
if (definition != null && StringUtils.isNotEmpty(definition.filename) && handle.exists()) {
Stack stack = new Stack();
stack.add(new Image(new Texture(handle)));
stack.add(new Image(new Texture(Gdx.files.internal("engine/numbers.png"))));
return stack;
}
return new Table() {
{
add().expand().fill().size(256);
}
};
}
示例9: initialize
import com.badlogic.gdx.scenes.scene2d.ui.Stack; //导入依赖的package包/类
private void initialize() {
setTouchable(Touchable.enabled);
tabTitleTable = new Table();
tabBodyStack = new Stack();
selectedIndex = -1;
// Create 1st row
Cell<?> leftCell = add(new Image(style.titleBegin));
Cell<?> midCell = add(tabTitleTable);
Cell<?> rightCell = add(new Image(style.titleEnd));
switch (tabTitleAlign) {
case Align.left:
leftCell.width(((Image) leftCell.getActor()).getWidth()).bottom();
midCell.left();
rightCell.expandX().fillX().bottom();
break;
case Align.right:
leftCell.expandX().fillX().bottom();
midCell.right();
rightCell.width(((Image) rightCell.getActor()).getWidth()).bottom();
break;
case Align.center:
leftCell.expandX().fillX().bottom();
midCell.center();
rightCell.expandX().fillX().bottom();
break;
default:
throw new IllegalArgumentException("TabbedPane align must be one of left, center, right");
}
// Create 2nd row
row();
Table t = new Table();
t.setBackground(style.bodyBackground);
t.add(tabBodyStack);
add(t).colspan(3).expand().fill();
}
示例10: changeTest
import com.badlogic.gdx.scenes.scene2d.ui.Stack; //导入依赖的package包/类
private void changeTest (int testIndex) {
// Dispose the previous test (if any)
if (currentTest != null) currentTest.dispose();
// Add the new test
currentTest = tests[testIndex];
Gdx.app.log("BehaviorTreeTests", "***********************************************");
Gdx.app.log("BehaviorTreeTests", "Starting test " + currentTest.getName());
Gdx.app.log("BehaviorTreeTests", "***********************************************");
String description = currentTest.getDescription();
if (description != null) {
Gdx.app.log("BehaviorTreeTests", description);
Gdx.app.log("BehaviorTreeTests", "***********************************************");
testDescriptionLabel.setText(description);
} else {
testDescriptionLabel.setText("Run the tree, look at the log and see what happens");
}
Stack testStack = new Stack() {
@Override
public void act (float delta) {
boolean paused = pauseButton.isChecked();
getChildren().peek().setVisible(paused);
if (!paused) {
// Update AI time
GdxAI.getTimepiece().update(delta);
// Call super
super.act(delta);
}
}
};
testStack.add(currentTest.createActor(skin));
testStack.add(new Image(skin, "translucent"));
splitPane.setSecondWidget(testStack);
}
示例11: create
import com.badlogic.gdx.scenes.scene2d.ui.Stack; //导入依赖的package包/类
@Override
public void create () {
Gdx.gl.glClearColor(.3f, .3f, .3f, 1);
skin = new Skin(Gdx.files.internal("data/uiskin.json"));
// Enable color markup
BitmapFont font = skin.get("default-font", BitmapFont.class);
font.getData().markupEnabled = true;
stage = new Stage();
stage.setDebugAll(DEBUG_STAGE);
stageWidth = stage.getWidth();
stageHeight = stage.getHeight();
Gdx.input.setInputProcessor(new InputMultiplexer(stage));
Stack stack = new Stack();
stage.addActor(stack);
stack.setSize(stageWidth, stageHeight);
testsTable = new Table();
stack.add(testsTable);
// Create behavior selection window
List<String> testList = createTestList();
algorithmSelectionWindow = addBehaviorSelectionWindow("Path Finder Tests", testList, 0, -1);
// Set selected test
changeTest(0);
stage.addActor(new FpsLabel("FPS: ", skin));
}
示例12: initialize
import com.badlogic.gdx.scenes.scene2d.ui.Stack; //导入依赖的package包/类
private void initialize () {
setTouchable(Touchable.enabled);
tabTitleTable = new Table();
tabBodyStack = new Stack();
selectedIndex = -1;
// Create 1st row
Cell<?> leftCell = add(new Image(style.titleBegin));
Cell<?> midCell = add(tabTitleTable);
Cell<?> rightCell = add(new Image(style.titleEnd));
switch (tabTitleAlign) {
case Align.left:
leftCell.width(((Image)leftCell.getActor()).getWidth()).bottom();
midCell.left();
rightCell.expandX().fillX().bottom();
break;
case Align.right:
leftCell.expandX().fillX().bottom();
midCell.right();
rightCell.width(((Image)rightCell.getActor()).getWidth()).bottom();
break;
case Align.center:
leftCell.expandX().fillX().bottom();
midCell.center();
rightCell.expandX().fillX().bottom();
break;
default:
throw new IllegalArgumentException("TabbedPane align must be one of left, center, right");
}
// Create 2nd row
row();
Table t = new Table();
t.setBackground(style.bodyBackground);
t.add(tabBodyStack);
add(t).colspan(3).expand().fill();
}
示例13: showMessage
import com.badlogic.gdx.scenes.scene2d.ui.Stack; //导入依赖的package包/类
public void showMessage(String text, float time, final GameState gameState) {
Gdx.app.debug(Constants.LOG, "Show Message !");
if (message == null) {
message = new Label(text, game.getResourcesManager().getStyles().skin, "header", Color.ORANGE);
container = new Stack();
container.add(message);
container.setPosition(Gdx.graphics.getWidth() / 2- container.getWidth() / 2,
Gdx.graphics.getHeight() + container.getHeight());
container.setVisible(false);
stage.addActor(container);
} else if (!container.isVisible()) {
message.setText(text);
container.pack();
MoveToAction action = Actions.action(MoveToAction.class);
action.setPosition(Gdx.graphics.getWidth() / 2 - container.getWidth() / 2,
Gdx.graphics.getHeight() / 2 - container.getHeight() / 2);
action.setDuration(time);
action.setInterpolation(Interpolation.bounceIn);
container.addAction(Actions.sequence(action, Actions.delay(1f),
Actions.run(new Runnable() {
public void run() {
Gdx.app.log(Constants.LOG, "Show Message Actions complete!");
DreamsGame.setGameState(gameState);
container.setVisible(false);
}
})
));
container.setVisible(true);
}
}
示例14: m
import com.badlogic.gdx.scenes.scene2d.ui.Stack; //导入依赖的package包/类
private Actor m()
{
try
{
com.nianticproject.ingress.shared.aj.a("createActionButtonTable");
this.O = new Stack();
n();
Stack localStack = this.O;
return localStack;
}
finally
{
com.nianticproject.ingress.shared.aj.b();
}
}
示例15: b
import com.badlogic.gdx.scenes.scene2d.ui.Stack; //导入依赖的package包/类
b(String paramString1, String paramString2, String paramString3, ActionButton.ActionButtonStyle paramActionButtonStyle)
{
this.d = paramActionButtonStyle;
this.a = new Label(paramString1, paramActionButtonStyle.mainLabelStyle);
this.b = new Label(paramString2, paramActionButtonStyle.subLabelStyle);
this.c = new Label(paramString3, paramActionButtonStyle.errorLabelStyle);
this.f = new ScrollLabel("", paramActionButtonStyle.mainLabelStyle);
this.g = new Stack();
this.g.addActor(this.a);
this.e = ActionButton.a(this.g, this.b, paramActionButtonStyle);
}