本文整理了Java中com.badlogic.gdx.scenes.scene2d.ui.Table.layout()
方法的一些代码示例,展示了Table.layout()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.layout()
方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.ui.Table
类名称:Table
方法名:layout
[英]Positions and sizes children of the table using the cell associated with each child. The values given are the position within the parent and size of the table.
[中]使用与每个子项关联的单元格来定位和调整表的子项。给出的值是父对象中的位置和表的大小。
代码示例来源:origin: libgdx/libgdx
float height = getHeight();
layout(0, 0, width, height);
代码示例来源:origin: libgdx/libgdx
float height = getHeight();
layout(0, 0, width, height);
代码示例来源:origin: libgdx/libgdx
t.add(myLabel);
t.layout();
代码示例来源:origin: com.badlogicgames.gdx/gdx
float height = getHeight();
layout(0, 0, width, height);
代码示例来源:origin: dingjibang/GDX-RPG
public void send(Console.ConsoleLog log){
if(log.text == null)
return;
cursor = history.size();
String command = "";
if(log.from != null){
command = "[#aaaaaaff][[" + log.time + "][] [#" + log.from.color() + "]<" + log.from.name() + ">[]";
}
if(log.color != null){
command += "[#" + log.color + "]" + log.text.replaceAll("\\[", "[[") + "[]";
}else{
command += log.text;
}
Label label = new Label(command, 18).maxWidth(Game.width() - 10).warp(true).markup(true).left();
out.add(label).left().width(Game.width() - 10).pad(4, 5, 4, 5).row();
out.layout();
pane.layout();
pane.setScrollPercentY(100);
}
代码示例来源:origin: kotcrab/vis-ui
/**
* Sets chooser selected files. Compared to {@link #setSelectedFiles(FileHandle...)} does not remove invalid files
* from selection.
*/
public void highlightFiles (FileHandle... files) {
for (FileHandle file : files) {
FileItem item = fileListAdapter.getViews().get(file);
if (item != null) {
item.select(false);
}
}
if (files.length > 0) {
FileItem item = fileListAdapter.getViews().get(files[0]);
if (item != null) {
if (item.getParent() instanceof Table) { //table at this point may need additional layout to calculate proper target scroll cords
((Table) item.getParent()).layout();
}
item.localToParentCoordinates(tmpVector.setZero());
fileListView.getScrollPane().scrollTo(tmpVector.x, tmpVector.y, item.getWidth(), item.getHeight(), false, true);
}
}
updateSelectedFileFieldText();
}
代码示例来源:origin: LonamiWebs/Klooni1010
private void loadShop() {
showcaseIndex = 0; // Reset the index
final GameLayout layout = new GameLayout();
shopGroup.clear();
if (showingEffectsShop)
for (IEffectFactory effect : Klooni.EFFECTS)
addCard(new EffectCard(game, layout, effect));
else // showingThemesShop
for (Theme theme : Theme.getThemes())
addCard(new ThemeCard(game, layout, theme));
// Scroll to the currently selected item
table.layout();
for (Actor a : shopGroup.getChildren()) {
ShopCard c = (ShopCard) a;
if (c.isUsed()) {
shopScroll.scrollTo(
c.getX(), c.getY() + c.getHeight(),
c.getWidth(), c.getHeight());
break;
}
c.usedItemUpdated();
}
}
内容来源于网络,如有侵权,请联系作者删除!