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