本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.utils.Drawable.getMinHeight方法的典型用法代码示例。如果您正苦于以下问题:Java Drawable.getMinHeight方法的具体用法?Java Drawable.getMinHeight怎么用?Java Drawable.getMinHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.utils.Drawable
的用法示例。
在下文中一共展示了Drawable.getMinHeight方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawStageBackground
import com.badlogic.gdx.scenes.scene2d.utils.Drawable; //导入方法依赖的package包/类
@Override
protected void drawStageBackground(Batch batch, float parentAlpha, float x,
float y, float width, float height) {
Drawable background = getStyle().stageBackground;
float drawableWidth = background.getMinWidth();
float drawableHeight = background.getMinHeight();
if (drawableWidth < width || drawableHeight < height) {
Vector2 tempVector = MathUtil.getVector2();
Stage stage = getStage();
x = stage.getWidth()/2 - drawableWidth/2;
y = stage.getHeight()/2 - drawableHeight/2;
//stageToLocalCoordinates(tempVector.set(x, y));
//x = tempVector.x;
//y = tempVector.y;
MathUtil.freeVector2(tempVector);
width = background.getMinWidth();
height = background.getMinHeight();
}
super.drawStageBackground(batch, parentAlpha, x, y, width, height);
}
示例2: setDrawable
import com.badlogic.gdx.scenes.scene2d.utils.Drawable; //导入方法依赖的package包/类
/** @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;
}
示例3: EmptyDrawable
import com.badlogic.gdx.scenes.scene2d.utils.Drawable; //导入方法依赖的package包/类
/** Creates a new empty drawable with the same sizing information as the specified drawable. */
public EmptyDrawable(Drawable drawable) {
leftWidth = drawable.getLeftWidth();
rightWidth = drawable.getRightWidth();
topHeight = drawable.getTopHeight();
bottomHeight = drawable.getBottomHeight();
minWidth = drawable.getMinWidth();
minHeight = drawable.getMinHeight();
}
示例4: setIcon
import com.badlogic.gdx.scenes.scene2d.utils.Drawable; //导入方法依赖的package包/类
protected void setIcon(Drawable drawableIcon) {
image.setDrawable(drawableIcon);
if (drawableIcon != null) {
this.preferredHeight = drawableIcon.getMinHeight() + CB.scaledSizes.MARGINx2;
this.preferredWidth = super.getPrefWidth() + this.preferredHeight;
} else {
this.preferredHeight = 0;
this.preferredWidth = 0;
}
}
示例5: layout
import com.badlogic.gdx.scenes.scene2d.utils.Drawable; //导入方法依赖的package包/类
@Override
public void layout() {
super.layout();
Drawable imageDrawable = image.getDrawable();
if (imageDrawable != null) {
float x = this.getWidth() - (imageDrawable.getMinWidth() + CB.scaledSizes.MARGINx2 + style.selectIcon.getMinWidth());
float y = (this.getHeight() - imageDrawable.getMinHeight()) / 2;
image.setBounds(x, y, imageDrawable.getMinWidth(), imageDrawable.getMinHeight());
}
selectIcon.setBounds(this.getWidth() - (style.selectIcon.getMinWidth() + CB.scaledSizes.MARGIN),
(this.getHeight() - style.selectIcon.getMinHeight()) / 2,
style.selectIcon.getMinWidth(),
style.selectIcon.getMinHeight());
}
示例6: getKnobMinHeight
import com.badlogic.gdx.scenes.scene2d.utils.Drawable; //导入方法依赖的package包/类
private float getKnobMinHeight(Drawable drawable) {
if (drawable instanceof SvgNinePatchDrawable) {
return ((SvgNinePatchDrawable) drawable).getPatch().getTotalHeight();
}
return drawable.getMinHeight();
}