本文整理汇总了Java中com.badlogic.gdx.graphics.Pixmap.fillRectangle方法的典型用法代码示例。如果您正苦于以下问题:Java Pixmap.fillRectangle方法的具体用法?Java Pixmap.fillRectangle怎么用?Java Pixmap.fillRectangle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.graphics.Pixmap
的用法示例。
在下文中一共展示了Pixmap.fillRectangle方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fillFormWithConstantColor
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
public static Pixmap fillFormWithConstantColor(Pixmap pixmap, Color fillColor) {
// set fill color
pixmap.setColor(fillColor);
Color color = new Color();
for (int x = 0; x < pixmap.getWidth(); x++) {
for (int y = 0; y < pixmap.getHeight(); y++) {
int colorInt = pixmap.getPixel(x, y);
color.set(colorInt);
// get color alpha value
float alpha = color.a;
if (alpha > 0) {
pixmap.setColor(fillColor);
pixmap.fillRectangle(x, y, 1, 1);
} else {
pixmap.setColor(new Color(0, 0, 0, 0));
pixmap.fillRectangle(x, y, 1, 1);
}
}
}
return pixmap;
}
示例2: setupPixmap
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
private static void setupPixmap(Pixmap p, int i, Color c) {
p.setColor(c);
setupPixMapA(i, p);
if ((i & AmbientOcclusion.E) == AmbientOcclusion.E) {
p.fillRectangle(AmbientOcclusion.INDIVIDUAL_SIZE * 2, AmbientOcclusion.INDIVIDUAL_SIZE,
AmbientOcclusion.INDIVIDUAL_SIZE, AmbientOcclusion.INDIVIDUAL_SIZE);
}
if ((i & AmbientOcclusion.F) == AmbientOcclusion.F) {
p.fillRectangle(0, AmbientOcclusion.INDIVIDUAL_SIZE * 2, AmbientOcclusion.INDIVIDUAL_SIZE,
AmbientOcclusion.INDIVIDUAL_SIZE);
}
if ((i & AmbientOcclusion.G) == AmbientOcclusion.G) {
p.fillRectangle(AmbientOcclusion.INDIVIDUAL_SIZE, AmbientOcclusion.INDIVIDUAL_SIZE * 2,
AmbientOcclusion.INDIVIDUAL_SIZE, AmbientOcclusion.INDIVIDUAL_SIZE);
}
if ((i & AmbientOcclusion.H) == AmbientOcclusion.H) {
p.fillRectangle(AmbientOcclusion.INDIVIDUAL_SIZE * 2, AmbientOcclusion.INDIVIDUAL_SIZE * 2,
AmbientOcclusion.INDIVIDUAL_SIZE, AmbientOcclusion.INDIVIDUAL_SIZE);
}
}
示例3: UIManager
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
public UIManager() {
healthBar = new Pixmap(1, 1, Pixmap.Format.RGB888);
healthBar.setColor(1f, 0, 0, 1f);
healthBar.fillRectangle(0, 0, 1, 1);
fenrirHealth = new Texture(healthBar);
jormundandrHealth = new Texture(healthBar);
fTitle = SpriteSheet.fTitle;
jTitle = SpriteSheet.jTitle;
fWin = SpriteSheet.fWins;
jWin = SpriteSheet.jWins;
mHealth = SpriteSheet.mHealth;
fFill = 1f;
jFill = 1f;
}
示例4: createSquare
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
public Sprite createSquare(int size) {
Pixmap pixmap = new Pixmap(size, size, Pixmap.Format.RGBA8888);
// pixmap.setColor(color);
pixmap.setColor(Color.WHITE);
pixmap.fillRectangle(0, 0, size, size);
Sprite sprite = new Sprite(new Texture(pixmap));
pixmap.dispose();
return sprite;
}
示例5: TileTexture
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
public TileTexture(int width, int height) {
Pixmap pixmap = new Pixmap(width, height, Pixmap.Format.RGBA8888);
pixmap.setColor(Color.LIGHT_GRAY);
pixmap.fillRectangle(0, 0, width, height);
pixmap.setColor(Color.WHITE);
pixmap.fillRectangle(1, 1, width - 2, height - 2);
texture = new Texture(pixmap);
pixmap.dispose();
}
示例6: createDrawable
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
private Drawable createDrawable(int width, int height, Color color) {
Pixmap pixmap = new Pixmap(width, height, Pixmap.Format.RGBA8888);
pixmap.setColor(color);
pixmap.fillRectangle(0, 0, width, height);
Texture texture = new Texture(pixmap);
return new TextureRegionDrawable(new TextureRegion(texture));
}
示例7: setupPixmap
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
private static void setupPixmap(Pixmap p, int i, Color c) {
p.setColor(c);
if ((i & AmbientOcclusion.A) == AmbientOcclusion.A) p.fillRectangle(0, 0, AmbientOcclusion.INDIVIDUAL_SIZE, AmbientOcclusion.INDIVIDUAL_SIZE);
if ((i & AmbientOcclusion.B) == AmbientOcclusion.B) p.fillRectangle(AmbientOcclusion.INDIVIDUAL_SIZE, 0, AmbientOcclusion.INDIVIDUAL_SIZE, AmbientOcclusion.INDIVIDUAL_SIZE);
if ((i & AmbientOcclusion.C) == AmbientOcclusion.C) p.fillRectangle(AmbientOcclusion.INDIVIDUAL_SIZE * 2, 0, AmbientOcclusion.INDIVIDUAL_SIZE, AmbientOcclusion.INDIVIDUAL_SIZE);
if ((i & AmbientOcclusion.D) == AmbientOcclusion.D) p.fillRectangle(0, AmbientOcclusion.INDIVIDUAL_SIZE, AmbientOcclusion.INDIVIDUAL_SIZE, AmbientOcclusion.INDIVIDUAL_SIZE);
if ((i & AmbientOcclusion.E) == AmbientOcclusion.E) p.fillRectangle(AmbientOcclusion.INDIVIDUAL_SIZE * 2, AmbientOcclusion.INDIVIDUAL_SIZE, AmbientOcclusion.INDIVIDUAL_SIZE, AmbientOcclusion.INDIVIDUAL_SIZE);
if ((i & AmbientOcclusion.F) == AmbientOcclusion.F) p.fillRectangle(0, AmbientOcclusion.INDIVIDUAL_SIZE * 2, AmbientOcclusion.INDIVIDUAL_SIZE, AmbientOcclusion.INDIVIDUAL_SIZE);
if ((i & AmbientOcclusion.G) == AmbientOcclusion.G) p.fillRectangle(AmbientOcclusion.INDIVIDUAL_SIZE, AmbientOcclusion.INDIVIDUAL_SIZE * 2, AmbientOcclusion.INDIVIDUAL_SIZE, AmbientOcclusion.INDIVIDUAL_SIZE);
if ((i & AmbientOcclusion.H) == AmbientOcclusion.H) p.fillRectangle(AmbientOcclusion.INDIVIDUAL_SIZE * 2, AmbientOcclusion.INDIVIDUAL_SIZE * 2, AmbientOcclusion.INDIVIDUAL_SIZE, AmbientOcclusion.INDIVIDUAL_SIZE);
}