當前位置: 首頁>>代碼示例>>Java>>正文


Java Drawable.getMinWidth方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.scenes.scene2d.utils.Drawable.getMinWidth方法的典型用法代碼示例。如果您正苦於以下問題:Java Drawable.getMinWidth方法的具體用法?Java Drawable.getMinWidth怎麽用?Java Drawable.getMinWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.scenes.scene2d.utils.Drawable的用法示例。


在下文中一共展示了Drawable.getMinWidth方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
	
}
 
開發者ID:mganzarcik,項目名稱:fabulae,代碼行數:22,代碼來源:BorderedWindow.java

示例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;
}
 
開發者ID:raeleus,項目名稱:bobbybird,代碼行數:10,代碼來源:BouncingImage.java

示例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();
}
 
開發者ID:Longri,項目名稱:cachebox3.0,代碼行數:10,代碼來源:EmptyDrawable.java

示例4: 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());

}
 
開發者ID:Longri,項目名稱:cachebox3.0,代碼行數:16,代碼來源:SelectBox.java

示例5: getDrawableMinWidth

import com.badlogic.gdx.scenes.scene2d.utils.Drawable; //導入方法依賴的package包/類
private float getDrawableMinWidth(Drawable drawable) {
    if (drawable instanceof SvgNinePatchDrawable) {
        return ((SvgNinePatchDrawable) drawable).getPatch().getTotalWidth();
    }
    return drawable.getMinWidth();
}
 
開發者ID:Longri,項目名稱:cachebox3.0,代碼行數:7,代碼來源:ProgressBar.java


注:本文中的com.badlogic.gdx.scenes.scene2d.utils.Drawable.getMinWidth方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。