本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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));*/
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
});
}