當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。