本文整理了Java中com.badlogic.gdx.scenes.scene2d.ui.Table.setBackground()
方法的一些代码示例,展示了Table.setBackground()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.setBackground()
方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.ui.Table
类名称:Table
方法名:setBackground
暂无
代码示例来源:origin: libgdx/libgdx
/** @see #setBackground(String) */
public Table background (String drawableName) {
setBackground(drawableName);
return this;
}
代码示例来源:origin: libgdx/libgdx
/** @see #setBackground(String) */
public Table background (String drawableName) {
setBackground(drawableName);
return this;
}
代码示例来源:origin: libgdx/libgdx
/** @see #setBackground(Drawable) */
public Table background (Drawable background) {
setBackground(background);
return this;
}
代码示例来源:origin: libgdx/libgdx
/** @see #setBackground(Drawable) */
public Table background (Drawable background) {
setBackground(background);
return this;
}
代码示例来源:origin: libgdx/libgdx
/** Sets the background drawable from the skin and adjusts the table's padding to match the background. This may only be called
* if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used.
* @see #setBackground(Drawable) */
public void setBackground (String drawableName) {
if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
setBackground(skin.getDrawable(drawableName));
}
代码示例来源:origin: libgdx/libgdx
/** Sets the background drawable from the skin and adjusts the table's padding to match the background. This may only be called
* if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used.
* @see #setBackground(Drawable) */
public void setBackground (String drawableName) {
if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
setBackground(skin.getDrawable(drawableName));
}
代码示例来源: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
root.setBackground(skin.getDrawable("default-pane"));
root.defaults().space(6);
root.setTransform(true);
代码示例来源:origin: com.badlogicgames.gdx/gdx
/** @see #setBackground(Drawable) */
public Table background (Drawable background) {
setBackground(background);
return this;
}
代码示例来源:origin: com.badlogicgames.gdx/gdx
/** @see #setBackground(String) */
public Table background (String drawableName) {
setBackground(drawableName);
return this;
}
代码示例来源:origin: dingjibang/GDX-RPG
public TypedGdxQuery<T> background(Drawable draw){
if(t instanceof Table)
((Table)t).setBackground(draw);
return this;
}
代码示例来源:origin: com.badlogicgames.gdx/gdx
/** Sets the background drawable from the skin and adjusts the table's padding to match the background. This may only be called
* if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used.
* @see #setBackground(Drawable) */
public void setBackground (String drawableName) {
if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
setBackground(skin.getDrawable(drawableName));
}
代码示例来源:origin: dingjibang/GDX-RPG
public GdxQuery background(Drawable draw){
for(Actor a:list())
if(a instanceof Table)
((Table)a).setBackground(draw);
return this;
}
代码示例来源:origin: crashinvaders/gdx-texture-packer-gui
@Override
public void process(final LmlParser parser, final LmlTag tag, final Table actor, final String rawAttributeData) {
Skin skin = parser.getData().getDefaultSkin();
TiledDrawable drawable = skin.getTiledDrawable(parser.parseString(rawAttributeData, actor));
actor.setBackground(drawable);
}
}
代码示例来源:origin: kotcrab/vis-ui
public MenuBar (MenuBarStyle style) {
menuItems = new VisTable();
mainTable = new VisTable() {
@Override
protected void sizeChanged () {
super.sizeChanged();
closeMenu();
}
};
mainTable.left();
mainTable.add(menuItems);
mainTable.setBackground(style.background);
}
代码示例来源:origin: crashinvaders/gdx-texture-packer-gui
protected void createMainTable () {
mainTable = new VisTable();
mainTable.setBackground(style.background);
VisImageButton closeButton = new VisImageButton(style.closeButtonStyle);
closeButton.addListener(new ChangeListener() {
@Override
public void changed (ChangeEvent event, Actor actor) {
close();
}
});
mainTable.add(contentTable).pad(3).fill().expand();
mainTable.add(closeButton).top();
}
代码示例来源:origin: kotcrab/vis-ui
protected void createMainTable () {
mainTable = new VisTable();
mainTable.setBackground(style.background);
VisImageButton closeButton = new VisImageButton(style.closeButtonStyle);
closeButton.addListener(new ChangeListener() {
@Override
public void changed (ChangeEvent event, Actor actor) {
close();
}
});
mainTable.add(contentTable).pad(3).fill().expand();
mainTable.add(closeButton).top();
}
代码示例来源:origin: narfman0/GDXWorld
public static Table buildTable(Color tableColor, Color pixmapColor){
Pixmap pixmap = new Pixmap(1, 1, Format.RGBA8888);
pixmap.setColor(pixmapColor);
pixmap.fill();
Table table = new Table();
table.setWidth(Gdx.graphics.getWidth());
table.setHeight(Gdx.graphics.getHeight());
Drawable drawable = new TextureRegionDrawable(new TextureRegion(new Texture(pixmap)));
table.setBackground(drawable);
table.setColor(tableColor);
return table;
}
代码示例来源:origin: bladecoder/bladecoder-adventure-engine
public DialogUI(UI ui) {
super(new Table(ui.getSkin()), ui.getSkin());
this.ui = ui;
setFadeScrollBars(true);
setOverscroll(false, false);
up = new Button(ui.getSkin(), "dialog-up");
down = new Button(ui.getSkin(), "dialog-down");
panel = (Table) getActor();
style = ui.getSkin().get(DialogUIStyle.class);
this.recorder = ui.getRecorder();
if (style.background != null)
panel.setBackground(style.background);
panel.top().left();
panel.pad(DPIUtils.getMarginSize());
setVisible(false);
panel.defaults().expandX().fillX().top().left().padBottom(DPIUtils.getSpacing());
up.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
setScrollY(getScrollY() - DPIUtils.getPrefButtonSize());
}
});
down.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
setScrollY(getScrollY() + DPIUtils.getPrefButtonSize());
}
});
}
代码示例来源:origin: 121077313/cocostudio-ui-libgdx
table.setBackground(d);
pixmap.dispose();
内容来源于网络,如有侵权,请联系作者删除!