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


Java Stack.add方法代码示例

本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Stack.add方法的典型用法代码示例。如果您正苦于以下问题:Java Stack.add方法的具体用法?Java Stack.add怎么用?Java Stack.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.scenes.scene2d.ui.Stack的用法示例。


在下文中一共展示了Stack.add方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: EditorLayout

import com.badlogic.gdx.scenes.scene2d.ui.Stack; //导入方法依赖的package包/类
public EditorLayout() {
	Editor.publisher().subscribe(this);
	modules = new Array<Module<?>>();
	addModules();
	Gdx.input.setInputProcessor(stage);
	Table root = new Table();
	root.setFillParent(true);
	final Table menu = new Table();
	content = new Table();
	tooltip = new Table();
	for (final Module<?> m : modules) {
		menu.defaults().uniformX().expandX().fillX();
		menu.add(m.getButton()).row();
		m.getButton().addListener(new ClickListener() {
			@Override
			public void clicked(InputEvent event, float x, float y) {
				content.clear();
				m.populate(content);
			}
		});
	}
	Stack stack = new Stack();
	stack.add(content);
	stack.add(tooltip);
	final ScrollPane scroll = new ScrollPane(stack) {
		@Override
		public void act(float delta) {
			if (!Gdx.input.isKeyPressed(Keys.SHIFT_LEFT)) {
				super.act(delta);
			}
		}

	};
	root.add(topnav()).expandX().fill().height(40).padBottom(10).row();
	root.add(new Table() {
		{
			add(menu).expandY().top();
			add(scroll).expand().fill();
		}
	}).expand().fill().padLeft(5);
	stage.addActor(root);
	tooltipWindow = new Table();
	tooltipWindow.setTransform(true);
	tooltipWindow.getColor().a = 0;
	tooltipWindow.add(tooltipLabel = new VisLabel(""));
	tooltipWindow.setBackground(Drawables.get("blue"));
	tooltip.addActor(tooltipWindow);
}
 
开发者ID:adketuri,项目名称:umbracraft,代码行数:49,代码来源:EditorLayout.java

示例10: a

import com.badlogic.gdx.scenes.scene2d.ui.Stack; //导入方法依赖的package包/类
public final void a(Skin paramSkin, Stage paramStage)
{
  Table localTable1 = new Table();
  localTable1.setWidth(paramStage.getWidth());
  localTable1.setHeight(paramStage.getHeight());
  Label localLabel = new Label("Select Agent Avatar", (Label.LabelStyle)paramSkin.get("profiles-avatar-title", Label.LabelStyle.class));
  Table localTable2 = new Table();
  localTable2.setBackground(new NinePatchDrawable(paramSkin.getPatch("default-panel")));
  float f1 = localLabel.getStyle().font.getCapHeight();
  localTable2.add(localLabel).o().k().c(1.35F * f1).h(0.2F * -f1).i(0.2F * f1);
  localTable1.add(localTable2).o().g();
  localTable1.row();
  this.h = new Table();
  Table localTable3 = new Table();
  int i1 = (int)(0.2F * paramStage.getWidth());
  this.m = new h(paramSkin, this.a);
  this.n = new h(paramSkin, this.a);
  float f2 = l.a(6.0F);
  this.o = new a(com.nianticproject.ingress.shared.playerprofile.a.b, paramSkin, this, f2);
  this.p = new a(com.nianticproject.ingress.shared.playerprofile.a.a, paramSkin, this, f2);
  this.k = new WidgetCarousel(i1, i1, (WidgetCarousel.WidgetCarouselStyle)paramSkin.get("profiles-avatar-carousel", WidgetCarousel.WidgetCarouselStyle.class), this.m);
  localTable3.add(a(com.nianticproject.ingress.shared.playerprofile.a.b, paramSkin, this.k, new e(this), this.o)).o().g();
  localTable3.row();
  localTable3.add(new Image(com.nianticproject.ingress.common.b.c.a(paramSkin, 16755791))).b(l.a(2.0F)).c(l.a(8.0F));
  localTable3.row();
  this.l = new WidgetCarousel(i1, i1, (WidgetCarousel.WidgetCarouselStyle)paramSkin.get("profiles-avatar-carousel", WidgetCarousel.WidgetCarouselStyle.class), this.n);
  localTable3.add(a(com.nianticproject.ingress.shared.playerprofile.a.a, paramSkin, this.l, new e(this), this.p)).o().g();
  this.h.add(localTable3).o().g().j().h(l.a(8.0F));
  this.h.row();
  Stack localStack = new Stack();
  Table localTable4 = new Table();
  Table localTable5 = new Table();
  this.f = new AvatarView(this.q, this.b, this.c, this.a, paramSkin);
  this.f.setTouchable(Touchable.disabled);
  localTable4.add(this.f).a(l.a(116.0F), l.a(116.0F)).j(l.a(24.0F));
  localTable5.add(localTable4).n().f().i();
  com.nianticproject.ingress.common.ui.widget.f localf1 = new com.nianticproject.ingress.common.ui.widget.f("DONE", paramSkin);
  localf1.addListener(new p(this));
  Table localTable6 = new Table();
  Table localTable7 = new Table();
  localTable6.add(localf1).b(3.5F * f1).c(1.85F * f1);
  localTable7.add(localTable6).n().m().l().j(l.a(8.0F));
  localStack.add(localTable4);
  localStack.add(localTable7);
  this.h.add(localStack).n().f().h(l.a(8.0F));
  this.i = new Table();
  ProgressIndicator localProgressIndicator = new ProgressIndicator(paramSkin);
  localProgressIndicator.a(true);
  this.i.add(localProgressIndicator);
  this.j = new Table();
  this.g = new Label("", (Label.LabelStyle)paramSkin.get("profiles-avatar-error-label", Label.LabelStyle.class));
  com.nianticproject.ingress.common.ui.widget.f localf2 = new com.nianticproject.ingress.common.ui.widget.f("RETRY", paramSkin);
  localf2.addListener(new q(this));
  this.j.add(this.g);
  this.j.row();
  this.j.add(localf2).h(l.a(8.0F));
  Actor[] arrayOfActor = new Actor[3];
  arrayOfActor[0] = this.h;
  arrayOfActor[1] = this.i;
  arrayOfActor[2] = this.j;
  localTable1.stack(arrayOfActor).n().f().i(l.a(24.0F)).k(l.a(24.0F));
  paramStage.addActor(localTable1);
  a(t.c);
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:65,代码来源:o.java


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