当前位置: 首页>>代码示例>>Java>>正文


Java Pixmap.fill方法代码示例

本文整理汇总了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);
}
 
开发者ID:MartensCedric,项目名称:LD38-Compo,代码行数:24,代码来源:LudumDare38.java

示例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);
}
 
开发者ID:MartensCedric,项目名称:LD38-Compo,代码行数:22,代码来源:LudumDare38.java

示例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);
}
 
开发者ID:MartensCedric,项目名称:LD38-Compo,代码行数:22,代码来源:LudumDare38.java

示例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);
}
 
开发者ID:MartensCedric,项目名称:LD38-Compo,代码行数:27,代码来源:TileData.java

示例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();
    }
 
开发者ID:cpppwner,项目名称:NoRiskNoFun,代码行数:17,代码来源:GameObjectMap.java

示例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);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:24,代码来源:ProgressBarEnergy.java

示例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;
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:22,代码来源:TextureCache.java

示例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);
}
 
开发者ID:teobaranga,项目名称:Catan,代码行数:31,代码来源:SignUpScreen.java

示例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;
}
 
开发者ID:davyjoneswang,项目名称:libgdx-learnlib,代码行数:14,代码来源:WorldController.java

示例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);
}
 
开发者ID:cpppwner,项目名称:NoRiskNoFun,代码行数:15,代码来源:GameScene.java

示例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));
}
 
开发者ID:cpppwner,项目名称:NoRiskNoFun,代码行数:14,代码来源:LibGdxAssetCache.java

示例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;
}
 
开发者ID:LonamiWebs,项目名称:Klooni1010,代码行数:9,代码来源:Theme.java

示例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);
}
 
开发者ID:treeman1111,项目名称:Particles,代码行数:10,代码来源:DisplayManager.java

示例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);
}
 
开发者ID:treeman1111,项目名称:Particles,代码行数:37,代码来源:IntroScreen.java

示例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;
}
 
开发者ID:heyzqt,项目名称:libGdx-xiyou,代码行数:12,代码来源:InputnameDialog.java


注:本文中的com.badlogic.gdx.graphics.Pixmap.fill方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。