当前位置: 首页>>代码示例>>Java>>正文


Java Stack类代码示例

本文整理汇总了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);
}
 
开发者ID:Mignet,项目名称:Inspiration,代码行数:19,代码来源:InventorySlot.java

示例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);
}
 
开发者ID:GameDevWeek,项目名称:CodeBase,代码行数:20,代码来源:MenuManager.java

示例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());
}
 
开发者ID:pyros2097,项目名称:GdxStudio,代码行数:27,代码来源:Serializer.java

示例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();
}
 
开发者ID:libgdx,项目名称:gdx-ai,代码行数:18,代码来源:MessageTestBase.java

示例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();
}
 
开发者ID:libgdx,项目名称:gdx-ai,代码行数:19,代码来源:Scene2dSteeringTest.java

示例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);
}
 
开发者ID:ratrecommends,项目名称:dice-heroes,代码行数:30,代码来源:CreatureQueueWindow.java

示例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();
	}
 
开发者ID:infinity8,项目名称:Roguelike,代码行数:39,代码来源:TabPanel.java

示例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);
		}
	};
}
 
开发者ID:adketuri,项目名称:umbracraft,代码行数:15,代码来源:TilesetListModule.java

示例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();
    }
 
开发者ID:langurmonkey,项目名称:gaiasky,代码行数:39,代码来源:TabbedPane.java

示例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);
}
 
开发者ID:libgdx,项目名称:gdx-ai,代码行数:36,代码来源:BehaviorTreeTests.java

示例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));
}
 
开发者ID:libgdx,项目名称:gdx-ai,代码行数:33,代码来源:PathFinderTests.java

示例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();
	}
 
开发者ID:libgdx,项目名称:gdx-ai,代码行数:39,代码来源:TabbedPane.java

示例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);
    }

}
 
开发者ID:Rubentxu,项目名称:DreamsLibGdx,代码行数:34,代码来源:BaseScreen.java

示例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();
  }
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:16,代码来源:PortalInfoDialog.java

示例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);
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:12,代码来源:b.java


注:本文中的com.badlogic.gdx.scenes.scene2d.ui.Stack类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。