本文整理匯總了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);
}