本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Image.setBounds方法的典型用法代码示例。如果您正苦于以下问题:Java Image.setBounds方法的具体用法?Java Image.setBounds怎么用?Java Image.setBounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.ui.Image
的用法示例。
在下文中一共展示了Image.setBounds方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: _init
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
public void _init(Drawable[] textures, int depth, Vector2[] bias) {
if (bias != null && bias.length != textures.length)
throw new IllegalArgumentException();
group = new Group();
images = new Image[textures.length];
for (int i=0; i<textures.length; i++) {
Drawable texture = textures[i];
Image image = new Image(texture);
images[i] = image;
image.setBounds(0, 0, texture.getMinWidth(), texture.getMinHeight());
if (bias != null)
image.setPosition(bias[i].x, bias[i].y, Align.center);
else
image.setPosition(0, 0, Align.center);
group.addActor(image);
}
mDepth = depth;
biases = bias;
}
示例2: setDieNumber
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
/**
* Set the number on the die image
* @param number 1-6
*/
public void setDieNumber(int number) {
if (number < 1 || number > MAX_DIE_NUMBER) {
return;
}
dieImage = new Image(dieTextures[number-1]);
dieImage.setBounds(x,y,width,height);
}
示例3: createHealthBar
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
private HealthBar createHealthBar(TextureAtlas textureAtlas) {
Image barImage = new Image(textureAtlas.findRegion("hpbar-empty"));
barImage.setBounds(Polymorph.WORLD_WIDTH/35, Polymorph.WORLD_HEIGHT/5.3f,
Polymorph.WORLD_WIDTH/6, 3*Polymorph.WORLD_HEIGHT/4);
Image healthImage = new Image(textureAtlas.findRegion("hpbar-full"));
return new HealthBar(polyGame.getPlayer(), barImage, healthImage);
}
示例4: ImageRenderer
import com.badlogic.gdx.scenes.scene2d.ui.Image; //导入方法依赖的package包/类
public ImageRenderer(Texture texture, int depth,int width,int height) {
image = new Image(texture);
image.setBounds(0, 0, width, height);
mDepth = depth;
}