本文整理了Java中com.badlogic.gdx.scenes.scene2d.ui.Table.setFillParent()
方法的一些代码示例,展示了Table.setFillParent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.setFillParent()
方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.ui.Table
类名称:Table
方法名:setFillParent
暂无
代码示例来源:origin: libgdx/libgdx
private void setupUI () {
Skin skin = assets.get(DEFAULT_SKIN);
Table table = new Table();
table.setFillParent(true);
table.top().left().add(new Label("FPS ", skin)).left();
table.add(fpsLabel = new Label("", skin)).left().expandX().row();
ui.addActor(table);
}
代码示例来源:origin: libgdx/libgdx
public void create () {
stage = new Stage();
Gdx.input.setInputProcessor(stage);
root = new Table();
root.setFillParent(true);
stage.addActor(root);
skin = new Skin(Gdx.files.internal("data/uiskin.json"));
Table labels = new Table();
root.add(new ScrollPane(labels, skin)).expand().fill();
root.row();
root.add(drawnLabel = new Label("", skin));
for (int i = 0; i < count; i++) {
labels.add(new Label("Label: " + i, skin) {
public void draw (Batch batch, float parentAlpha) {
super.draw(batch, parentAlpha);
drawn++;
}
});
labels.row();
}
}
代码示例来源:origin: libgdx/libgdx
public void setupUI () {
ui = new Stage();
skin = new Skin(Gdx.files.internal("data/uiskin.json"));
TextButton reload = new TextButton("Reload Shaders", skin.get(TextButtonStyle.class));
camera = new SelectBox(skin.get(SelectBoxStyle.class));
camera.setItems("Camera", "Light");
fps = new Label("fps: ", skin.get(LabelStyle.class));
Table table = new Table();
table.setFillParent(true);
table.top().padTop(15);
table.add(reload).spaceRight(5);
table.add(camera).spaceRight(5);
table.add(fps);
ui.addActor(table);
reload.addListener(new ClickListener() {
public void clicked (InputEvent event, float x, float y) {
ShaderProgram prog = new ShaderProgram(Gdx.files.internal("data/shaders/projtex-vert.glsl").readString(), Gdx.files
.internal("data/shaders/projtex-frag.glsl").readString());
if (prog.isCompiled() == false) {
Gdx.app.log("GLSL ERROR", "Couldn't reload shaders:\n" + prog.getLog());
} else {
projTexShader.dispose();
projTexShader = prog;
}
}
});
}
代码示例来源:origin: libgdx/libgdx
stage.addActor(container);
container.setFillParent(true);
container.pad(10).defaults().expandX().fillX().space(4);
代码示例来源:origin: libgdx/libgdx
private void setupUI () {
ui = new Stage(new ExtendViewport(640, 480));
Skin skin = new Skin(Gdx.files.internal("data/uiskin.json"));
skipCleanup = new CheckBox("Skip blend function clean-up", skin);
skipCleanup.addListener(listener);
logLabel = new Label("", skin.get(LabelStyle.class));
clearEmitters = new TextButton("Clear screen", skin);
clearEmitters.addListener(listener);
scaleEffects = new TextButton("Scale existing effects", skin);
scaleEffects.addListener(listener);
Table table = new Table();
table.setTransform(false);
table.setFillParent(true);
table.defaults().padTop(5).left();
table.top().left().padLeft(5);
table.add(skipCleanup).colspan(2).row();
table.add(clearEmitters).spaceRight(10);
table.add(scaleEffects).row();
table.add(logLabel).colspan(2);
ui.addActor(table);
}
代码示例来源:origin: libgdx/libgdx
table2.setFillParent(true);
table2.bottom();
代码示例来源:origin: libgdx/libgdx
public void create () {
stage = new Stage();
Gdx.input.setInputProcessor(stage);
Skin skin = new Skin(Gdx.files.internal("data/uiskin.json"));
Table table = new Table();
table.setFillParent(true);
stage.addActor(table);
final Tree tree = new Tree(skin);
final Node moo1 = new Node(new TextButton("moo1", skin));
final Node moo2 = new Node(new TextButton("moo2", skin));
final Node moo3 = new Node(new TextButton("moo3", skin));
final Node moo4 = new Node(new TextButton("moo4", skin));
final Node moo5 = new Node(new TextButton("moo5", skin));
tree.add(moo1);
tree.add(moo2);
moo2.add(moo3);
moo3.add(moo4);
tree.add(moo5);
moo5.getActor().addListener(new ClickListener() {
public void clicked (InputEvent event, float x, float y) {
tree.remove(moo4);
}
});
table.add(tree).fill().expand();
}
代码示例来源:origin: libgdx/libgdx
table.setFillParent(true);
stage.addActor(table);
代码示例来源:origin: libgdx/libgdx
public void create () {
stage = new Stage();
Skin skin = new Skin(Gdx.files.internal("data/uiskin.json"));
label = new Label("", skin);
Table root = new Table(skin);
root.setFillParent(true);
root.setBackground(skin.getDrawable("default-pane"));
root.debug().defaults().space(6);
root.add(new TextButton("Button 1", skin));
root.add(new TextButton("Button 2", skin)).row();
root.add("Press spacebar to change the viewport:").colspan(2).row();
root.add(label).colspan(2);
stage.addActor(root);
viewports = getViewports(stage.getCamera());
names = getViewportNames();
stage.setViewport(viewports.first());
label.setText(names.first());
Gdx.input.setInputProcessor(new InputMultiplexer(new InputAdapter() {
public boolean keyDown (int keycode) {
if (keycode == Input.Keys.SPACE) {
int index = (viewports.indexOf(stage.getViewport(), true) + 1) % viewports.size;
label.setText(names.get(index));
Viewport viewport = viewports.get(index);
stage.setViewport(viewport);
resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
}
return false;
}
}, stage));
}
代码示例来源:origin: libgdx/libgdx
table.add(musicBox);
table.add(btLoop);
table.setFillParent(true);
stage.addActor(table);
代码示例来源:origin: libgdx/libgdx
table.setFillParent(true);
table.add(scroll).expandX().left().width(100);
stage.addActor(table);
代码示例来源:origin: libgdx/libgdx
root.setFillParent(true);
root.setBackground(skin.getDrawable("default-pane"));
root.defaults().space(6);
代码示例来源:origin: libgdx/libgdx
root.setFillParent(true);
root.add(new Label("meow meow meow meow meow meow meow meow meow meow meow meow", skin)).colspan(3).expandX();
root.add(new TextButton("Text Button", skin));
代码示例来源:origin: libgdx/libgdx
pan.setValue(0);
final Label panValue = new Label("0.0", skin);
table.setFillParent(true);
代码示例来源:origin: libgdx/libgdx
private void populateTable (){
Table root = new Table();
stage.addActor(root);
root.setFillParent(true);
root.pad(5);
root.defaults().left().space(5);
代码示例来源:origin: libgdx/libgdx
container.setFillParent(true);
代码示例来源:origin: libgdx/libgdx
root.setFillParent(true);
代码示例来源:origin: libgdx/libgdx
root.setFillParent(true);
root.debug().defaults().space(6).size(110);
stage.addActor(root);
代码示例来源:origin: libgdx/libgdx
table.setFillParent(true);
table.pad(5);
table.add(fpsLabel).expandX().left().row();
代码示例来源:origin: libgdx/libgdx
table.setFillParent(true);
table.pad(5);
table.add(fpsLabel).expandX().left().row();
内容来源于网络,如有侵权,请联系作者删除!