本文整理汇总了Java中com.badlogic.gdx.graphics.Pixmap.fill方法的典型用法代码示例。如果您正苦于以下问题:Java Pixmap.fill方法的具体用法?Java Pixmap.fill怎么用?Java Pixmap.fill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.graphics.Pixmap
的用法示例。
在下文中一共展示了Pixmap.fill方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createToolTip
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
private void createToolTip()
{
Skin skin = new Skin();
Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
pixmap.setColor(Color.WHITE);
pixmap.fill();
skin.add("white", new Texture(pixmap));
skin.add("default", new BitmapFont());
TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
textButtonStyle.up = skin.newDrawable("white", new Color(0, 0, 0, 1));
textButtonStyle.font = skin.getFont("default");
skin.add("default", textButtonStyle);
labelToolTip = new TextButton("TEST", skin);
labelToolTip.setX(5);
labelToolTip.setY(5);
labelToolTip.setWidth(125);
labelToolTip.setVisible(false);
labelToolTip.getLabel().setWrap(true);
labelToolTip.setHeight(labelToolTip.getLabel().getHeight());
group.addActor(labelToolTip);
}
示例2: createResetButton
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
private void createResetButton()
{
Skin skin = new Skin();
Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
pixmap.setColor(Color.WHITE);
pixmap.fill();
skin.add("white", new Texture(pixmap));
skin.add("default", new BitmapFont());
TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
textButtonStyle.up = skin.newDrawable("white", new Color(0, 0, 0, 1));
textButtonStyle.font = skin.getFont("default");
skin.add("default", textButtonStyle);
btnReset = new TextButton("RESET", skin);
btnReset.setX(5);
btnReset.setY(Gdx.graphics.getHeight() - 25);
btnReset.setWidth(60);
btnReset.setVisible(true);
group.addActor(btnReset);
}
示例3: createUndoButton
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
private void createUndoButton()
{
Skin skin = new Skin();
Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
pixmap.setColor(Color.WHITE);
pixmap.fill();
skin.add("white", new Texture(pixmap));
skin.add("default", new BitmapFont());
TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
textButtonStyle.up = skin.newDrawable("white", new Color(0, 0, 0, 1));
textButtonStyle.font = skin.getFont("default");
skin.add("default", textButtonStyle);
btnUndo = new TextButton("UNDO", skin);
btnUndo.setX(70);
btnUndo.setY(Gdx.graphics.getHeight() - 25);
btnUndo.setWidth(60);
btnUndo.setVisible(true);
group.addActor(btnUndo);
}
示例4: setColor
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
public void setColor(int color) {
Pixmap pix = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
pix.setColor(color);
pix.fill();
Texture tex = new Texture(pix);
TextureRegion region = new TextureRegion(tex);
Point p1 = (Point) parent.getPoints().toArray()[0];
Point p2 = (Point) parent.getPoints().toArray()[1];
Point p3 = (Point) parent.getPoints().toArray()[2];
Point p4 = (Point) parent.getPoints().toArray()[3];
Point p5 = (Point) parent.getPoints().toArray()[4];
Point p6 = (Point) parent.getPoints().toArray()[5];
float[] vertices = new float[]{(
float) p1.getCoordinateX(), (float)p1.getCoordinateY(),
(float)p2.getCoordinateX(), (float)p2.getCoordinateY(),
(float)p3.getCoordinateX(), (float)p3.getCoordinateY(),
(float) p4.getCoordinateX(), (float)p4.getCoordinateY(),
(float)p5.getCoordinateX(), (float)p5.getCoordinateY(),
(float)p6.getCoordinateX(), (float)p6.getCoordinateY()};
EarClippingTriangulator triangulator = new EarClippingTriangulator();
ShortArray triangleIndices = triangulator.computeTriangles(vertices);
PolygonRegion polygonRegion = new PolygonRegion(region, vertices, triangleIndices.toArray());
sprite = new PolygonSprite(polygonRegion);
}
示例5: GameObjectMap
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
GameObjectMap(AssetMap assetMap) {
this.assetMap = assetMap;
batch = new PolygonSpriteBatch();
shapeRenderer = new ShapeRenderer();
Pixmap pix = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
pix.setColor(Color.WHITE);
pix.fill();
texture = new Texture(pix);
regionMap = new HashMap<>();
regionNameMap = new HashMap<>();
initPolygonRegions();
}
示例6: updateVisual
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
public void updateVisual(){
Skin skin = new Skin();
Pixmap pixmap = new Pixmap(1,(int)(Gdx.graphics.getHeight()*0.0175), Pixmap.Format.RGBA8888);
switch (infoProfile.getDateUserGame().getFaction()){
case 1:{
pixmap.setColor(1, 0f, 0f, 1);
break;
}
case 2:{
pixmap.setColor(0f, 0.831f, 0.969f,1f);
break;
}
case 3:{
pixmap.setColor(0.129f, 0.996f, 0.29f,1);
break;
}
}
pixmap.fill();
skin.add("blue", new Texture(pixmap));
ProgressBar.ProgressBarStyle style = new ProgressBar.ProgressBarStyle(bar.getStyle().background,skin.newDrawable("blue",Color.WHITE));
style.knobBefore = style.knob;
bar.setStyle(style);
}
示例7: createSolid
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
public static SmartTexture createSolid( int color ) {
String key = "1x1:" + color;
if (all.containsKey( key )) {
return all.get( key );
} else {
final Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
// In the rest of the code ARGB is used
pixmap.setColor( (color << 8) | (color >>> 24) );
pixmap.fill();
GdxTexture bmp = new GdxTexture( pixmap );
SmartTexture tx = new SmartTexture( bmp );
all.put(key, tx);
return tx;
}
}
示例8: createBasicSkin
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
private void createBasicSkin() {
// Create a font
BitmapFont font = new BitmapFont();
skin = new Skin();
skin.add("default", font);
// Create a texture
Pixmap pixmap = new Pixmap(Gdx.graphics.getWidth() / 4, Gdx.graphics.getHeight() / 10, Pixmap.Format.RGB888);
pixmap.setColor(Color.WHITE);
pixmap.fill();
skin.add("background", new Texture(pixmap));
// Create a button style
TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
textButtonStyle.up = skin.newDrawable("background", Color.GRAY);
textButtonStyle.down = skin.newDrawable("background", Color.DARK_GRAY);
textButtonStyle.checked = skin.newDrawable("background", Color.DARK_GRAY);
textButtonStyle.over = skin.newDrawable("background", Color.LIGHT_GRAY);
textButtonStyle.font = skin.getFont("default");
skin.add("default", textButtonStyle);
// Create a window style
Window.WindowStyle windowStyle = new Window.WindowStyle();
windowStyle.background = skin.newDrawable("background", Color.DARK_GRAY);
// Dim background
windowStyle.stageBackground = skin.newDrawable("background", Color.valueOf("#00000099"));
windowStyle.titleFont = skin.getFont("default");
windowStyle.titleFontColor = Color.WHITE;
skin.add("default", windowStyle);
}
示例9: createProceduralPixmap
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
private Pixmap createProceduralPixmap(int width, int height) {
Pixmap pixmap = new Pixmap(width, height, Pixmap.Format.RGBA8888);
pixmap.setColor(1, 0, 0, 0.5f);
pixmap.fill();
pixmap.setColor(1, 1, 0, 1);
pixmap.drawLine(0, 0, width, height);
pixmap.drawLine(width, 0, 0, height);
pixmap.setColor(0, 1, 1, 1);
pixmap.drawRectangle(0, 0, width, height);
return pixmap;
}
示例10: setRegionColor
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
/**
* Re-color a given region
* @param color New Color for the Region
* @param region Region to re-color
*/
private void setRegionColor(Color color, AssetMap.Region region) {
Pixmap pix = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
pix.setColor(color);
pix.fill();
Texture regionTexture = new Texture(pix);
PolygonRegion polygonRegion = regionMap.get(region);
polygonRegion.getRegion().setTexture(regionTexture);
}
示例11: createPixMapTexture
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
/**
* Create 1x1 pixel pixmap texture for given color.
* @param color The color used to fill the texture with.
* @return Newly created pixmap texture.
*/
private static Texture createPixMapTexture(Color color) {
Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
pixmap.setColor(color);
pixmap.fill();
return new Texture(new PixmapTextureData(pixmap, null, false, true));
}
示例12: getBlankTexture
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
public static Texture getBlankTexture() {
final Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
pixmap.setColor(Color.WHITE);
pixmap.fill();
final Texture result = new Texture(pixmap);
pixmap.dispose();
return result;
}
示例13: DisplayManager
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
public DisplayManager(SpriteBatch sprite_batch, PlayerCamera camera) {
this.sprite_batch = sprite_batch;
this.camera = camera;
pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
pixmap.setColor(Color.WHITE);
pixmap.fill();
texture = new Texture(pixmap);
}
示例14: IntroScreen
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
IntroScreen(final ParticleGame game) {
particle_game = game;
stage = new Stage();
table = new Table();
table.setFillParent(true);
table.setDebug(true);
stage.addActor(table);
Skin skin = new Skin();
Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
pixmap.setColor(Color.WHITE);
pixmap.fill();
skin.add("white", new Texture(pixmap));
skin.add("font", game.getFont());
TextButton.TextButtonStyle text_button_style = new TextButton.TextButtonStyle();
final Color button_color = new Color(226 / 255f, 226 / 255f, 226 / 255f, 1f);
final Color hover_color = new Color(162 / 255f, 162 / 255f, 162 / 255f, 1f);
text_button_style.up = skin.newDrawable("white", button_color);
text_button_style.down = skin.newDrawable("white", button_color);
text_button_style.over = skin.newDrawable("white", hover_color);
text_button_style.font = skin.getFont("font");
skin.add("default", text_button_style);
TextButton play_button = new TextButton("play", skin);
play_button.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
particle_game.setScreen(particle_game.getGameSetupScreen());
}
});
table.add(play_button);
}
示例15: createCursorTexture
import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
/**
* 创建文本框中的光标纹理
*/
private Texture createCursorTexture() {
Pixmap pixmap = new Pixmap(3, 10, Pixmap.Format.RGBA8888);
pixmap.setColor(0.047f, 0.047f, 0.047f, 1);
pixmap.fill();
Texture texture = new Texture(pixmap);
pixmap.dispose();
return texture;
}