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


Java Pixmap.fillRectangle方法代碼示例

本文整理匯總了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;
}
 
開發者ID:opensourcegamedev,項目名稱:SpaceChaos,代碼行數:27,代碼來源:PixmapUtils.java

示例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);
	}
}
 
開發者ID:RedTroop,項目名稱:Cubes_2,代碼行數:24,代碼來源:AOTextureGenerator.java

示例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;
}
 
開發者ID:elitej13,項目名稱:project-divine-intervention,代碼行數:18,代碼來源:UIManager.java

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

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

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

示例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);
}
 
開發者ID:RedTroop,項目名稱:Cubes,代碼行數:15,代碼來源:AOTextureGenerator.java


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