当前位置: 首页>>代码示例>>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;未经允许,请勿转载。