本文整理了Java中com.badlogic.gdx.scenes.scene2d.ui.Table.getPrefHeight()
方法的一些代码示例,展示了Table.getPrefHeight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getPrefHeight()
方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.ui.Table
类名称:Table
方法名:getPrefHeight
暂无
代码示例来源:origin: libgdx/libgdx
public float getPrefHeight () {
float height = super.getPrefHeight();
if (style.up != null) height = Math.max(height, style.up.getMinHeight());
if (style.down != null) height = Math.max(height, style.down.getMinHeight());
if (style.checked != null) height = Math.max(height, style.checked.getMinHeight());
return height;
}
代码示例来源:origin: libgdx/libgdx
public float getPrefHeight () {
float height = super.getPrefHeight();
if (style.up != null) height = Math.max(height, style.up.getMinHeight());
if (style.down != null) height = Math.max(height, style.down.getMinHeight());
if (style.checked != null) height = Math.max(height, style.checked.getMinHeight());
return height;
}
代码示例来源:origin: libgdx/libgdx
table2.setTransform(true);
table2.setScaleX(1.5f);
table2.setOrigin(table2.getPrefWidth() / 2, table2.getPrefHeight() / 2);
代码示例来源:origin: mbrlabs/Mundus
@Override
public float getPrefHeight() {
if (table == null) return 0;
if (actionRunning == false) {
if (collapsed)
return 0;
else
return table.getPrefHeight();
}
return currentHeight;
}
代码示例来源:origin: kotcrab/vis-ui
@Override
public float getPrefHeight () {
if (table == null) return 0;
if (actionRunning == false) {
if (collapsed)
return 0;
else
return table.getPrefHeight();
}
return currentHeight;
}
代码示例来源:origin: kotcrab/vis-ui
@Override
public float getPrefHeight () {
return table == null ? 0 : table.getPrefHeight();
}
代码示例来源:origin: jsjolund/GdxDemo3D
public float getPrefHeight() {
return super.getPrefHeight() * scale;
}
};
代码示例来源:origin: kotcrab/vis-ui
@Override
public boolean act (float delta) {
if (collapsed) {
currentHeight -= delta * 1000;
if (currentHeight <= 0) {
currentHeight = 0;
collapsed = true;
actionRunning = false;
}
} else {
currentHeight += delta * 1000;
if (currentHeight > table.getPrefHeight()) {
currentHeight = table.getPrefHeight();
collapsed = false;
actionRunning = false;
}
}
invalidateHierarchy();
return !actionRunning;
}
}
代码示例来源:origin: kotcrab/vis-ui
@Override
public void layout () {
if (table == null) return;
table.setBounds(0, 0, table.getPrefWidth(), table.getPrefHeight());
if (actionRunning == false) {
if (collapsed)
currentHeight = 0;
else
currentHeight = table.getPrefHeight();
}
}
代码示例来源:origin: mbrlabs/Mundus
@Override
public boolean act(float delta) {
if (collapsed) {
currentHeight -= delta * 1000;
if (currentHeight <= 0) {
currentHeight = 0;
collapsed = true;
actionRunning = false;
}
} else {
currentHeight += delta * 1000;
if (currentHeight > table.getPrefHeight()) {
currentHeight = table.getPrefHeight();
collapsed = false;
actionRunning = false;
}
}
invalidateHierarchy();
return !actionRunning;
}
}
代码示例来源:origin: dsaltares/libgdx-cookbook
public float getPrefHeight () {
float height = super.getPrefHeight();
if (style.background != null) height = Math.max(height, style.background.getMinHeight());
return height;
}
代码示例来源:origin: com.badlogicgames.gdx/gdx
public float getPrefHeight () {
float height = super.getPrefHeight();
if (style.up != null) height = Math.max(height, style.up.getMinHeight());
if (style.down != null) height = Math.max(height, style.down.getMinHeight());
if (style.checked != null) height = Math.max(height, style.checked.getMinHeight());
return height;
}
代码示例来源:origin: kotcrab/vis-ui
@Override
public float get (Actor actor) {
if (actor instanceof Widget) {
Widget widget = (Widget) actor;
return widget.isVisible() ? widget.getPrefHeight() : 0;
}
if (actor instanceof Table) {
Table table = (Table) actor;
return table.isVisible() ? table.getPrefHeight() : 0;
}
throw new IllegalStateException("Unsupported actor type for PrefHeightIfVisibleValue: " + actor.getClass());
}
}
代码示例来源:origin: kotcrab/vis-ui
@Override
public void layout () {
if (table == null) return;
table.setBounds(0, 0, table.getPrefWidth(), table.getPrefHeight());
if (actionRunning == false) {
if (collapsed)
currentWidth = 0;
else
currentWidth = table.getPrefWidth();
}
}
代码示例来源:origin: mbrlabs/Mundus
@Override
public void layout() {
if (table == null) return;
table.setBounds(0, 0, getWidth(), getHeight());
if (actionRunning == false) {
if (collapsed)
currentHeight = 0;
else
currentHeight = table.getPrefHeight();
}
}
代码示例来源:origin: kotcrab/vis-ui
public void setCollapsed (boolean collapse, boolean withAnimation) {
this.collapsed = collapse;
updateTouchable();
if (table == null) return;
actionRunning = true;
if (withAnimation) {
addAction(collapseAction);
} else {
if (collapse) {
currentHeight = 0;
collapsed = true;
} else {
currentHeight = table.getPrefHeight();
collapsed = false;
}
actionRunning = false;
invalidateHierarchy();
}
}
代码示例来源:origin: mbrlabs/Mundus
public void setCollapsed(boolean collapse, boolean withAnimation) {
this.collapsed = collapse;
updateTouchable();
if (table == null) return;
actionRunning = true;
if (withAnimation) {
addAction(collapseAction);
} else {
if (collapse) {
currentHeight = 0;
collapsed = true;
} else {
currentHeight = table.getPrefHeight();
collapsed = false;
}
actionRunning = false;
invalidateHierarchy();
}
}
代码示例来源:origin: jsjolund/GdxDemo3D
bottomRightTable.add(speedController);
bottomRightTable.setTransform(true);
bottomRightTable.setOrigin(bottomRightTable.getPrefWidth() * scale, bottomRightTable.getPrefHeight() * scale);
bottomRightTable.setScale(scale);
rootTable.add(bottomRightTable).width(bottomRightTable.getPrefWidth()).height(bottomRightTable.getPrefHeight()).bottom().right();
内容来源于网络,如有侵权,请联系作者删除!