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


Java Table.setFillParent方法代碼示例

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


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

示例1: show

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void show() {
    super.show();

    //Table containing all the possibles Ball appearances
    Table skins = new Table();

    //Table containing the screen elements that shall not move with the scroller
    Table staticElements = new Table();
    staticElements.setFillParent(true);

    createSkins(skins);
    createStaticElements(staticElements, skins);

    stage.addActor(staticElements);
    Gdx.input.setInputProcessor(stage);
}
 
開發者ID:AndreFCruz,項目名稱:feup-lpoo-armadillo,代碼行數:21,代碼來源:CustomizeMenuScreen.java

示例2: initHUD

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
/**
 * Function used to initialize all the elements of the HUD and add the respective Listeners.
 */
private void initHUD() {
    Table hudTable = new Table();
    hudTable.setFillParent(true);

    Button pauseButton = new Button(new TextureRegionDrawable(
            new TextureRegion(game.getAssetManager().get("pause.png", Texture.class))));

    scoreText = new Label("0:00", skin);
    scoreText.setFontScale(FONT_SCALE, FONT_SCALE);

    pauseButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            model.togglePause();
        }
    });

    hudTable.top();
    hudTable.add(scoreText).size(HUD_ELEMENTS_SIZE, HUD_ELEMENTS_SIZE).expandX()
            .left().fill().padLeft(HORIZONTAL_PAD).padTop(VERTICAL_PAD);
    hudTable.add(pauseButton).size(HUD_ELEMENTS_SIZE, HUD_ELEMENTS_SIZE).fill()
            .padRight(HORIZONTAL_PAD).padTop(VERTICAL_PAD);

    this.addActor(hudTable);
}
 
開發者ID:AndreFCruz,項目名稱:feup-lpoo-armadillo,代碼行數:29,代碼來源:HudMenu.java

示例3: HudScene

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
public HudScene(SpriteBatch batch, ShapeRenderer shapeRenderer, ArcRenderer arcRenderer) {
    this.batch = batch;
    stage = new Stage();

    VisUI.load();

    Table table = new Table();
    table.top();
    table.setFillParent(true);

    scoreLabel = new Label("", new Label.LabelStyle(new BitmapFont(), Color.VIOLET));
    setScore(score);
    balanceLabel = new Label("", new Label.LabelStyle(new BitmapFont(), Color.VIOLET));
    setBalance(balance);

    table.add(scoreLabel).align(Align.left).expandX();
    table.add(balanceLabel).align(Align.right).expandX();

    stage.addActor(table);


    ringButton = new RingButton(shapeRenderer, arcRenderer);
    ringButton.setBounds(10, 10, 100, 100);
    stage.addActor(ringButton);
}
 
開發者ID:MiniDigger,項目名稱:projecttd,代碼行數:26,代碼來源:HudScene.java

示例4: start

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
@Override
public void start() {
    finishedLoading = false;
    
    stage = new Stage(new ScreenViewport());
    
    skin = createSkin();
    
    Image image= new Image(skin, "bg");
    image.setScaling(Scaling.stretch);
    image.setFillParent(true);
    stage.addActor(image);
    
    root = new Table();
    root.setFillParent(true);
    stage.addActor(root);
    
    progressBar = new ProgressBar(0, 1, .01f, false, skin);
    progressBar.setAnimateDuration(.1f);
    root.add(progressBar).growX().expandY().pad(20.0f);
}
 
開發者ID:raeleus,項目名稱:bobbybird,代碼行數:22,代碼來源:LoadingState.java

示例5: MenuScreen

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
public MenuScreen(MainGameClass game) {
    this.game = game;

    stage = new Stage(new ScreenViewport());
    Gdx.input.setInputProcessor(stage);

    skin = new Skin(Gdx.files.internal("skins/Flat_Earth_UI_Skin/flatearthui/flat-earth-ui.json"));

    progressBarStyle = skin.get("fancy", ProgressBar.ProgressBarStyle.class);
    TiledDrawable tiledDrawable = skin.getTiledDrawable("slider-fancy-knob").tint(skin.getColor("selection"));
    tiledDrawable.setMinWidth(0);
    progressBarStyle.knobBefore = tiledDrawable;

    sliderStyle = skin.get("fancy", Slider.SliderStyle.class);
    sliderStyle.knobBefore = tiledDrawable;

    layoutTable = new Table();
    layoutTable.top();
    layoutTable.setFillParent(true);
    layoutTable.pad(getPixelSizeFromDensityIndependentPixels(50));
}
 
開發者ID:johannesmols,項目名稱:GangsterSquirrel,代碼行數:22,代碼來源:MenuScreen.java

示例6: initLoseStage

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
private void initLoseStage() {
	
	setViewport(new ScreenViewport(getCamera()));
	getViewport().update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
	getViewport().apply(true);
	
	Label youLoseLbl = new Label("You lost" , Assets._skin , "fontVeraBd24" ,"white");
	playAgainBtn = new TextButton("Play Again", Assets._skin , "menu");
	mainMenuBtn = new TextButton("Main Menu", Assets._skin ,  "menu");
	Table container = new Table(Assets._skin);
	youLoseLbl.setColor(Color.RED);
	container.add(youLoseLbl).spaceBottom(100).row();
	container.add(playAgainBtn).align(Align.left).spaceBottom(20).row();
	container.add(mainMenuBtn).align(Align.left);
	container.setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
	container.setFillParent(true);
	addActor(container);
}
 
開發者ID:JoakimRW,項目名稱:ExamensArbeteTD,代碼行數:19,代碼來源:LoseStage.java

示例7: addchatlocation

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
public void addchatlocation(){
    grchatlocation = new VerticalGroup();
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd/HH:mm:ss");
    try {
        grchatlocation.addActor(addComment(sdf.parse("2016/5/17/13:34:23"),"adrian", Color.RED,"Welcome Chat!"));
        grchatlocation.addActor(addComment(sdf.parse("2016/5/17/13:34:23"),"adrian", Color.GREEN,"Location!"));
        grchatlocation.addActor(labelTest);
    } catch (ParseException e) {
        e.printStackTrace();
        Gdx.app.log("eroare","intra");
    }
    scrollchatpublic = new ScrollPane(grchatlocation);
    scrollchatpublic.layout();
    scrollchatpublic.setScrollingDisabled(true, false);
    scrollchatpublic.setFillParent(true);
    scrollchatpublic.setLayoutEnabled(true);
    tablechatpublic = new Table();
    tablechatpublic.setFillParent(false);
    tablechatpublic.add(scrollchatpublic).fill().expand();
    tablechatpublic.setBounds(WIDTH *0.05f,background1.getY(), WIDTH*0.9f,background1.getHeight() * 1.05f);
    groupbotttom.addActor(tablechatpublic);
    scrollchatpublic.setScrollPercentY(100);
    scrollchatpublic.act(Gdx.graphics.getDeltaTime());
    scrollchatpublic.updateVisualScroll();
}
 
開發者ID:TudorRosca,項目名稱:enklave,代碼行數:26,代碼來源:ScreenChat.java

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

示例9: addTitle

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
private void addTitle() {
    mainTitle = new Label("   Multiplayer   ", game.getSkin());
    mainTitle.setFontScale(1);

    titleTable = new Table();
    titleTable.setFillParent(true);
    titleTable.top();
    titleTable.add(mainTitle).center().padTop(120);

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

示例10: create_selectsorah_texture

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
private void create_selectsorah_texture() {

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

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

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

示例11: show

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void show() {
    super.show();

    Table table = new Table();
    table.setFillParent(true);

    createMenuButtons(table);

    stage.addActor(table);
}
 
開發者ID:AndreFCruz,項目名稱:feup-lpoo-armadillo,代碼行數:15,代碼來源:MainMenuScreen.java

示例12: Hud

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
public Hud(SpriteBatch batch){
    viewport = new FillViewport(Config.SCREEN_WIDTH,Config.SCREEN_HEIGHT,new OrthographicCamera());
    stage = new Stage(viewport,batch);
    labelHP = new Label("HP: 100/100", Assets.getInstance().getSkin());
    labelVP = new Label("VP: 100/100",Assets.getInstance().getSkin());

    table = new Table();
    table.setFillParent(true);
    table.top().right().padTop(20).padRight(20).setDebug(false);
    table.add(labelHP);
    table.row();
    table.add(labelVP);
    stage.addActor(table);
}
 
開發者ID:guojiank,項目名稱:skycity,代碼行數:15,代碼來源:Hud.java

示例13: addTitle

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
private void addTitle() {
    mainTitle = new Label("Difficulty", game.getSkin());
    mainTitle.setFontScale(2);

    titleTable = new Table();
    titleTable.setFillParent(true);
    titleTable.top();
    titleTable.add(mainTitle).center().padTop(70);

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

示例14: show

import com.badlogic.gdx.scenes.scene2d.ui.Table; //導入方法依賴的package包/類
@Override
public void show() {
    stage = new Stage();
    Gdx.input.setInputProcessor(stage);

    VisUI.load();

    CenteredTableBuilder tableBuilder = new CenteredTableBuilder(new Padding(2, 3));

    VisLabel heading = new VisLabel("Credits");
    heading.setColor(Color.BLACK);
    tableBuilder.append(heading).row();
    stage.addActor(heading);

    VisLabel temp = new VisLabel("To Be Implemented");
    temp.setColor(Color.BLACK);
    tableBuilder.append(temp).row();
    stage.addActor(temp);

    VisTextButton backButton = new VisTextButton("Back");
    backButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            ((Game) Gdx.app.getApplicationListener()).setScreen(new MainMenuScreen());
        }
    });
    tableBuilder.append(backButton).row();
    stage.addActor(backButton);

    Table table = tableBuilder.build();
    table.setFillParent(true);
    stage.addActor(table);
}
 
開發者ID:MiniDigger,項目名稱:projecttd,代碼行數:34,代碼來源:CreditsScreen.java

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


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