本文整理了Java中com.badlogic.gdx.scenes.scene2d.utils.Drawable.getMinHeight()
方法的一些代码示例,展示了Drawable.getMinHeight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Drawable.getMinHeight()
方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.utils.Drawable
类名称:Drawable
方法名:getMinHeight
暂无
代码示例来源:origin: libgdx/libgdx
public float getScrollBarHeight () {
if (!scrollX) return 0;
float height = 0;
if (style.hScrollKnob != null) height = style.hScrollKnob.getMinHeight();
if (style.hScroll != null) height = Math.max(height, style.hScroll.getMinHeight());
return height;
}
代码示例来源:origin: libgdx/libgdx
public float getScrollBarHeight () {
if (!scrollX) return 0;
float height = 0;
if (style.hScrollKnob != null) height = style.hScrollKnob.getMinHeight();
if (style.hScroll != null) height = Math.max(height, style.hScroll.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
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 () {
if (vertical)
return 140;
else {
final Drawable knob = getKnobDrawable();
final Drawable bg = (disabled && style.disabledBackground != null) ? style.disabledBackground : style.background;
return Math.max(knob == null ? 0 : knob.getMinHeight(), bg == null ? 0 : bg.getMinHeight());
}
}
代码示例来源:origin: libgdx/libgdx
public float getPrefHeight () {
if (vertical)
return 140;
else {
final Drawable knob = getKnobDrawable();
final Drawable bg = (disabled && style.disabledBackground != null) ? style.disabledBackground : style.background;
return Math.max(knob == null ? 0 : knob.getMinHeight(), bg == null ? 0 : bg.getMinHeight());
}
}
代码示例来源:origin: libgdx/libgdx
public float getPrefHeight () {
if (sizeInvalid) computeSize();
float height = tablePrefHeight;
if (background != null) return Math.max(height, background.getMinHeight());
return height;
}
代码示例来源:origin: libgdx/libgdx
public float getPrefHeight () {
if (sizeInvalid) computeSize();
float height = tablePrefHeight;
if (background != null) return Math.max(height, background.getMinHeight());
return height;
}
代码示例来源:origin: libgdx/libgdx
public float getMinHeight () {
float first = firstWidget instanceof Layout ? ((Layout)firstWidget).getMinHeight() : 0;
float second = secondWidget instanceof Layout ? ((Layout)secondWidget).getMinHeight() : 0;
if (!vertical) return Math.max(first, second);
return first + style.handle.getMinHeight() + second;
}
代码示例来源:origin: libgdx/libgdx
public float getMinHeight () {
float first = firstWidget instanceof Layout ? ((Layout)firstWidget).getMinHeight() : 0;
float second = secondWidget instanceof Layout ? ((Layout)secondWidget).getMinHeight() : 0;
if (!vertical) return Math.max(first, second);
return first + style.handle.getMinHeight() + second;
}
代码示例来源:origin: libgdx/libgdx
private void calculateVertBoundsAndPositions () {
Drawable handle = style.handle;
float width = getWidth();
float height = getHeight();
float availHeight = height - handle.getMinHeight();
float topAreaHeight = (int)(availHeight * splitAmount);
float bottomAreaHeight = availHeight - topAreaHeight;
float handleHeight = handle.getMinHeight();
firstWidgetBounds.set(0, height - topAreaHeight, width, topAreaHeight);
secondWidgetBounds.set(0, 0, width, bottomAreaHeight);
handleBounds.set(0, bottomAreaHeight, width, handleHeight);
}
代码示例来源:origin: libgdx/libgdx
private void calculateVertBoundsAndPositions () {
Drawable handle = style.handle;
float width = getWidth();
float height = getHeight();
float availHeight = height - handle.getMinHeight();
float topAreaHeight = (int)(availHeight * splitAmount);
float bottomAreaHeight = availHeight - topAreaHeight;
float handleHeight = handle.getMinHeight();
firstWidgetBounds.set(0, height - topAreaHeight, width, topAreaHeight);
secondWidgetBounds.set(0, 0, width, bottomAreaHeight);
handleBounds.set(0, bottomAreaHeight, width, handleHeight);
}
代码示例来源:origin: libgdx/libgdx
public float getPrefHeight () {
float v = prefHeight.get(actor);
if (background != null) v = Math.max(v, background.getMinHeight());
return Math.max(getMinHeight(), v + padTop.get(this) + padBottom.get(this));
}
代码示例来源:origin: libgdx/libgdx
public float getPrefHeight () {
float v = prefHeight.get(actor);
if (background != null) v = Math.max(v, background.getMinHeight());
return Math.max(getMinHeight(), v + padTop.get(this) + padBottom.get(this));
}
代码示例来源:origin: libgdx/libgdx
@Override
public float getPrefHeight () {
float first = firstWidget == null ? 0
: (firstWidget instanceof Layout ? ((Layout)firstWidget).getPrefHeight() : firstWidget.getHeight());
float second = secondWidget == null ? 0
: (secondWidget instanceof Layout ? ((Layout)secondWidget).getPrefHeight() : secondWidget.getHeight());
if (!vertical) return Math.max(first, second);
return first + style.handle.getMinHeight() + second;
}
代码示例来源:origin: libgdx/libgdx
@Override
public float getPrefHeight () {
float first = firstWidget == null ? 0
: (firstWidget instanceof Layout ? ((Layout)firstWidget).getPrefHeight() : firstWidget.getHeight());
float second = secondWidget == null ? 0
: (secondWidget instanceof Layout ? ((Layout)secondWidget).getPrefHeight() : secondWidget.getHeight());
if (!vertical) return Math.max(first, second);
return first + style.handle.getMinHeight() + second;
}
代码示例来源:origin: libgdx/libgdx
/** Sets a new drawable for the image. The image's pref size is the drawable's min size. If using the image actor's size rather
* than the pref size, {@link #pack()} can be used to size the image to its pref size.
* @param drawable May be null. */
public void setDrawable (Drawable drawable) {
if (this.drawable == drawable) return;
if (drawable != null) {
if (getPrefWidth() != drawable.getMinWidth() || getPrefHeight() != drawable.getMinHeight()) invalidateHierarchy();
} else
invalidateHierarchy();
this.drawable = drawable;
}
代码示例来源:origin: libgdx/libgdx
/** Sets a new drawable for the image. The image's pref size is the drawable's min size. If using the image actor's size rather
* than the pref size, {@link #pack()} can be used to size the image to its pref size.
* @param drawable May be null. */
public void setDrawable (Drawable drawable) {
if (this.drawable == drawable) return;
if (drawable != null) {
if (getPrefWidth() != drawable.getMinWidth() || getPrefHeight() != drawable.getMinHeight()) invalidateHierarchy();
} else
invalidateHierarchy();
this.drawable = drawable;
}
代码示例来源:origin: libgdx/libgdx
/** Creates a new empty drawable with the same sizing information as the specified drawable. */
public BaseDrawable (Drawable drawable) {
if (drawable instanceof BaseDrawable) name = ((BaseDrawable)drawable).getName();
leftWidth = drawable.getLeftWidth();
rightWidth = drawable.getRightWidth();
topHeight = drawable.getTopHeight();
bottomHeight = drawable.getBottomHeight();
minWidth = drawable.getMinWidth();
minHeight = drawable.getMinHeight();
}
代码示例来源:origin: libgdx/libgdx
/** Creates a new empty drawable with the same sizing information as the specified drawable. */
public BaseDrawable (Drawable drawable) {
if (drawable instanceof BaseDrawable) name = ((BaseDrawable)drawable).getName();
leftWidth = drawable.getLeftWidth();
rightWidth = drawable.getRightWidth();
topHeight = drawable.getTopHeight();
bottomHeight = drawable.getBottomHeight();
minWidth = drawable.getMinWidth();
minHeight = drawable.getMinHeight();
}
内容来源于网络,如有侵权,请联系作者删除!