當前位置: 首頁>>代碼示例>>Java>>正文


Java Table.row方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.scenes.scene2d.ui.Table.row方法的典型用法代碼示例。如果您正苦於以下問題:Java Table.row方法的具體用法?Java Table.row怎麽用?Java Table.row使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.scenes.scene2d.ui.Table的用法示例。


在下文中一共展示了Table.row方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createSkins

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
/**
 * Function used to create the Skins' Buttons and Labels and associate them to a given table, organized.
 * It also adds Listeners to the Skins' Buttons.
 *
 * @param table Table where the Skins' Labels and Buttons will be organized.
 */
private void createSkins(Table table) {
    for (int i = 0; i < game.getNumSkins(); ++i) {

        //Adding Buttons and Labels to the Arrays
        skinButtons.add(new Button(new TextureRegionDrawable(new TextureRegion(game.getAssetManager().get("big_skins/skin" + (i < 10 ? "0" : "") + i + ".png", Texture.class)))));
        skinLabels.add(new Label("Current", skin1));

        final int j = i; //Needed for Listener initialization
        skinButtons.get(i).addListener(new ClickListener() {
            @Override
            public void clicked(InputEvent event, float x, float y) {
                setCurrentLabel(j);
            }
        });

        table.add(skinButtons.get(i)).size(BUTTON_SIZE, BUTTON_SIZE).pad(IMAGE_EDGE);
    }
    table.row();

    for (int i = 0; i < game.getNumSkins(); ++i)
        table.add(skinLabels.get(i));

    initializeCurrentSkin();
}
 
開發者ID:AndreFCruz,項目名稱:feup-lpoo-armadillo,代碼行數:31,代碼來源:CustomizeMenuScreen.java

示例2: AddWindowButton

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
private void AddWindowButton(final UIElement window, String buttonText, Skin skin, Table table)
{
	final TextButton btn = new TextButton(buttonText, skin);

	btn.addListener(new ChangeListener()
	{
		@Override
		public void changed(ChangeEvent event, Actor actor)
		{
			if (window.isShowing())
				window.hide();
			else
				window.show();
		}
	});

	table.add(btn);
	table.row();
}
 
開發者ID:bp2008,項目名稱:blueirisviewer,代碼行數:20,代碼來源:MainOptionsWnd.java

示例3: addButtons

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
private void addButtons() {
    buttonTable = new Table();
    buttonTable.bottom();
    buttonTable.setFillParent(true);

    singlePlayer = new TextButton("\n  Single Player  \n", game.getSkin());
    multiPlayer = new TextButton("\n  Multi Player  \n", game.getSkin());
    achievements = new TextButton("\n  Achievements  \n", game.getSkin());
    sign = new TextButton(game.getPlayServices().isSignedIn() ?  "  Sign Out  " : "  Sign In  ", game.getSkin());
    sign.setColor(game.SECONDARY_COLOR);

    buttonTable.add(singlePlayer).center().padBottom(40);
    buttonTable.row();
    buttonTable.add(multiPlayer).center().padBottom(40);
    buttonTable.row();
    buttonTable.add(achievements).center().padBottom(40);
    buttonTable.row();
    buttonTable.add(sign).center().padBottom(40);

    stage.addActor(buttonTable);
}
 
開發者ID:antonioalmeida,項目名稱:retro-reversi,代碼行數:22,代碼來源:MainMenuView.java

示例4: MessageWindow

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
public MessageWindow(String message, BitmapFont font, float width, float height) {
    setTouchable(Touchable.enabled);
    setBounds(width / 2 - width / 4, height / 2 - height / 10, width / 2, height / 5);
    texture = new Texture("theme/basic/ui/Window.png");
    this.message = message;
    table = new Table();
    table.setSize(getWidth(), getHeight());
    table.align(Align.center | Align.top);
    table.setPosition(getX(), getY());
    Label label = new Label(message, new Label.LabelStyle(font, Color.BLACK));
    label.setWrap(true);
    label.setFontScale(0.7f);
    Label label2 = new Label("Tap to continue", new Label.LabelStyle(font, Color.BLACK));
    label2.setFontScale(0.6f);
    table.add(label).width(getWidth());
    table.row();
    table.add(label2).width(getWidth()).expandY();
    table.pad(0, 30, 0, 30);
}
 
開發者ID:justinmarentette11,項目名稱:Tower-Defense-Galaxy,代碼行數:20,代碼來源:MessageWindow.java

示例5: ScrollInventoryActor

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
public ScrollInventoryActor(Inventory inventory, int slots) {
	defaults().space(4f);

	add(new Label(inventory.getDisplayName(), new LabelStyle(Fonts.hud, Color.WHITE)));
	row();

	inner = new Table();
	inner.defaults().space(4f);
	for (int i = 0; i < inventory.itemStacks.length; i++) {
		SlotActor slotActor = new SlotActor(inventory, i);
		inner.add(slotActor);

		if ((i + 1) % inventory.width == 0) {
			inner.row();
		}
	}
	inner.pack();

	scrollPane = new ScrollPane(inner);
	scrollPane.setScrollingDisabled(true, false);
	add(scrollPane).height(slots * CALIBRATION_PER_ROW).fill();
	row();
	pack();
}
 
開發者ID:RedTroop,項目名稱:Cubes_2,代碼行數:25,代碼來源:ScrollInventoryActor.java

示例6: addOptionsButtons

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
private void addOptionsButtons() {
    buttonTable = new Table();
    buttonTable.bottom();
    buttonTable.setFillParent(true);

    localGameButton = new TextButton("\n  Local  \n", game.getSkin());
    onlineGameButton = new TextButton("\n    Online    \n", game.getSkin());
    checkGamesButton = new TextButton("\n  Check Games  \n", game.getSkin());
    backButton = new TextButton("Back", game.getSkin());

    buttonTable.add(localGameButton).center().padBottom(40);
    buttonTable.row();
    buttonTable.add(onlineGameButton).center().padBottom(40);
    buttonTable.row();
    buttonTable.add(checkGamesButton).center().padBottom(40);
    buttonTable.row();
    buttonTable.add(backButton).center().padBottom(40);
    backButton.setColor(Reversi.SECONDARY_COLOR);

    stage.addActor(buttonTable);
}
 
開發者ID:antonioalmeida,項目名稱:retro-reversi,代碼行數:22,代碼來源:MultiplayerMenuView.java

示例7: create

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
public void create() {
    Stage stage = new Stage(new ScreenViewport());
    getComponentByType(GuiComponent.class).stage = stage;

    Table gameScore = new Table();

    float scorePanelWidth = Gdx.graphics.getWidth() * 0.8f; // 80 % of screen
    float scorePanelHeight = Gdx.graphics.getHeight() * 0.2f; // 20 % of screen

    gameScore.setWidth(scorePanelWidth);
    gameScore.setHeight(scorePanelHeight);
    gameScore.setY(Gdx.graphics.getHeight() - (scorePanelHeight + 30.f));
    gameScore.setX((Gdx.graphics.getWidth() - scorePanelWidth) * 0.5f);

    gameScore.setBackground(new NinePatchDrawable(
            new NinePatch(new Texture(Gdx.files.internal("red_button13.png")), 24, 24, 24, 24)));
    gameScore.pad(32.f);

    Label scoreLabel = new Label("Score", new Label.LabelStyle(
            mFont, COLOR_FONT));
    scoreLabel.setFontScale(1.2f);

    gameScore.add(scoreLabel).expand();

    gameScore.row();

    mScoreLabel = new Label("" + 0, new Label.LabelStyle(mFont, COLOR_FONT));
    mScoreLabel.setFontScale(2.0f);

    gameScore.add(mScoreLabel).expand();

    stage.addActor(gameScore);
}
 
開發者ID:tgobbens,項目名稱:fluffybalance,代碼行數:34,代碼來源:IngameGuiEntity.java

示例8: ConsoleDialog

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
public ConsoleDialog(UserInterface linkedInterface)
{
	super("Console", Settings.DEFAULT_SKIN);
	this.linkedInterface = linkedInterface;
	setBounds(400, 700, 600, 150);
	Button closeButton = new CloseButton(this); 
	getTitleTable().add(closeButton).size(15, 15).padRight(-5).top().right();
	
	Table table = getContentTable(); 
	inputTextField = new TextField("", getSkin());
	inputTextField.addListener(new InputListener(){

		@Override
		public boolean keyDown(InputEvent event, int keycode)
		{
			if(!ConsoleDialog.this.isVisible())
				inputTextField.setDisabled(true);
			if(keycode == Keys.ENTER)
			{
				addMessageToList();
				sendCommandToExecute();
			}
			return false;
		}

	});

	consolePane = new ConsolePane();
	table.add(consolePane).fillX();

	table.row();
	table.add(inputTextField).width(570).align(Align.bottom);
	table.align(Align.bottom);
}
 
開發者ID:MMORPG-Prototype,項目名稱:MMORPG_Prototype,代碼行數:35,代碼來源:ConsoleDialog.java

示例9: InventoryDialog

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
public InventoryDialog(UserInterface linkedInterface, Integer linkedFieldGold)
{
	super("Inventory", Settings.DEFAULT_SKIN);
	this.linkedInterface = linkedInterface;

	Button closeButton = new CloseButton(this);
	getTitleTable().add(closeButton).size(15, 15).padRight(-5).top().right();

	for (int i = 0; i < numberOfPages; i++)
		inventoryPages.add(new InventoryPage(this, i));
	currentPageButtons.addActor(inventoryPages.get(0));
	addActor(currentPageButtons);

	Table contentTable = this.getContentTable();
	contentTable.add(currentPageButtons);
	VerticalGroup switchButtons = new VerticalGroup().space(0).pad(0).top().padTop(-8).fill();

	for (int i = 0; i < numberOfPages; i++)
	{
		InventoryTextField<Item> switchButton = createSwitchButton(i);
		switchButtons.addActor(switchButton);
		switchPageButtons.add(switchButton);
	}
	switchPageButtons.get(0).setColor(0.5f, 0.5f, 0.5f, 1);

	contentTable.add(switchButtons);
	contentTable.row();
	goldLabel.setValue(linkedFieldGold);
	goldLabel.update();
	contentTable.add(goldLabel).left();
	contentTable.row();

	this.setX(1230);
	this.setY(43);
	this.pack();
}
 
開發者ID:MMORPG-Prototype,項目名稱:MMORPG_Prototype,代碼行數:37,代碼來源:InventoryDialog.java

示例10: EquipmentDialog

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
public EquipmentDialog()
{
	super("Equipment", Settings.DEFAULT_SKIN);
	int padding = 10;
	Table content = new Table(Settings.DEFAULT_SKIN);
	content.add().pad(padding);
	ButtonField<Item> helmetField = new ButtonField<Item>();
	helmetField.setHeight(45);
	helmetField.setWidth(45);
	content.add(helmetField).pad(padding);;
	content.add().pad(padding);;
	content.row();
	ButtonField<Item> weaponField = new ButtonField<Item>();
	weaponField.setHeight(110);
	weaponField.setWidth(45);
	content.add(weaponField).pad(padding);;
	ButtonField<Item> armorField = new ButtonField<Item>();
	armorField.setHeight(110);
	armorField.setWidth(55);
	content.add(armorField).pad(padding);;
	ButtonField<Item> shieldField = new ButtonField<Item>();
	shieldField.setHeight(45);
	shieldField.setWidth(45);
	content.add(shieldField).pad(padding);;
	content.row();
	content.add().pad(padding);
	ButtonField<Item> bootsField = new ButtonField<Item>();
	bootsField.setWidth(45);
	bootsField.setHeight(45);
	content.add(bootsField).pad(padding);
	content.add().pad(padding);
	
	this.getContentTable().add(content).center().padLeft(-10).fill();
	setX(1147);
	setY(285);
	setWidth(253);
	setHeight(310);
}
 
開發者ID:MMORPG-Prototype,項目名稱:MMORPG_Prototype,代碼行數:39,代碼來源:EquipmentDialog.java

示例11: ChatDialog

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
public ChatDialog(UserInterface linkedInterface)
{
	super("Chat", Settings.DEFAULT_SKIN);
	this.linkedInterface = linkedInterface;
	setBounds(0, 0, 400, 200);
	Button closeButton = new CloseButton(this); 
	getTitleTable().add(closeButton).size(15, 15).padRight(-5).top().right();
	
	Table table = getContentTable(); 
	chatTextField = new TextField("", getSkin());
	
	chatTextField.addListener(new InputListener(){

		@Override
		public boolean keyDown(InputEvent event, int keycode)
		{
			if(!ChatDialog.this.isVisible())
				chatTextField.setDisabled(true);
			
			if(keycode == Keys.ENTER)
				sendMessage();
			return false;
		}
	});

	chatPane = new ChatPane();
	table.add(chatPane).fillX();

	table.row();
	table.add(chatTextField).fillX().align(Align.bottom);
	table.align(Align.bottom);
}
 
開發者ID:MMORPG-Prototype,項目名稱:MMORPG_Prototype,代碼行數:33,代碼來源:ChatDialog.java

示例12: createMenu

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
private void createMenu() {
    root = new Table();
    root.setFillParent(true);
    stage.addActor(root);
    
    FileHandle fileHandle = Gdx.files.local(Core.DATA_PATH + "/data.json");
    JsonReader reader = new JsonReader();
    JsonValue val = reader.parse(fileHandle);
    
    Label title = new Label(val.getString("title"), skin, "title");
    root.add(title).padTop(50.0f).padBottom(75.0f);
    
    root.row();
    BouncingImage image = new BouncingImage(getCharacter());
    root.add(image);
    
    root.row();
    ImageButton imageButton = new  ImageButton(skin, "play");
    root.add(imageButton).padTop(75.0f).expandY().top();
    imageButton.addListener(new ChangeListener() {
        @Override
        public void changed(ChangeListener.ChangeEvent event, Actor actor) {
            getCore().getAssetManager().get(Core.DATA_PATH + "/sfx/jump.wav", Sound.class).play();
            showCharacterDialog();
        }
    });
}
 
開發者ID:raeleus,項目名稱:bobbybird,代碼行數:28,代碼來源:MenuState.java

示例13: SettingsTabbedPane

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
public SettingsTabbedPane(Skin skin, int x, int y, HashMap<TextButton, Table> componentMap) {
    this.x = x;
    this.y = y;
    this.componentMap = componentMap;
    baseTable = new Table();
    buttonTable = new Table();
    contentTable = new Table();

    baseTable.add(buttonTable);
    baseTable.row();
    baseTable.add(contentTable);

    this.setPosition(x / 2, y / 1.3f);
    this.setActor(baseTable);
}
 
開發者ID:EtherWorks,項目名稱:arcadelegends-gg,代碼行數:16,代碼來源:SettingsTabbedPane.java

示例14: create_selectpart_texture

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
private void create_selectpart_texture() {
	// TODO Auto-generated method stub

			 Table container = new Table();
			 Table table = new Table();
			container.setDebug(debug_pages);
			 table.setDebug(debug_pages);
			 container.setFillParent(true);
				parts_scroll_pane = new ScrollPane(table);

				 container.add(parts_scroll_pane).width(screen_width).height(screen_height);
				 ;
				  
				 
					selectpart_stage.addActor(container);
				    
				    for (int i = 1 ;i <=ajzaa_no ;i++){
						 GozaTap tablea = new GozaTap(i);
						// tablea.setColor((float)Math.random(),(float)Math.random(),(float)Math.random(),1);
						 tablea.setDebug(debug_pages);
						 table.add(tablea).width(GozaTap.tab_width).height(GozaTap.tab_height+GozaTap.tab_pading_height);
						 table.row();
						 /*
						 selectpart_stage.addActor(new PageSeen(i));*/
						}

			
			
}
 
開發者ID:omar6597,項目名稱:alquran-alkarem,代碼行數:30,代碼來源:book.java

示例15: initGuiInGame

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
private void initGuiInGame() {
    mGuiStage = new Stage(new ScreenViewport());

    Table gameScore = new Table();
    if (DEBUG_RENDERER) {
        gameScore.debug();
    }

    float scorePanelWidth = Gdx.graphics.getWidth() * 0.8f; // 80 % of screen
    float scorePanelHeight = Gdx.graphics.getHeight() * 0.2f; // 20 % of screen

    gameScore.setWidth(scorePanelWidth);
    gameScore.setHeight(scorePanelHeight);
    gameScore.setY(Gdx.graphics.getHeight() - (scorePanelHeight + 30.f));
    gameScore.setX((Gdx.graphics.getWidth() - scorePanelWidth) * 0.5f);

    gameScore.setBackground(new NinePatchDrawable(
            new NinePatch(new Texture(Gdx.files.internal("red_button13.png")), 24, 24, 24, 24)));
    gameScore.pad(32.f);

    Label scoreLabel = new Label("Score", new Label.LabelStyle(
            mDefaultFont, COLOR_FONT));
    scoreLabel.setFontScale(1.2f);

    gameScore.add(scoreLabel).expand();

    gameScore.row();

    mScoreLabel = new Label("" + mPointTotal, new Label.LabelStyle(
            mDefaultFont, COLOR_FONT));
    mScoreLabel.setFontScale(2.0f);

    gameScore.add(mScoreLabel).expand();

    mGuiStage.addActor(gameScore);
}
 
開發者ID:tgobbens,項目名稱:fluffybalance,代碼行數:37,代碼來源:Balanceball.java


注:本文中的com.badlogic.gdx.scenes.scene2d.ui.Table.row方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。