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


Java Pixmap.setColor方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.graphics.Pixmap.setColor方法的典型用法代碼示例。如果您正苦於以下問題:Java Pixmap.setColor方法的具體用法?Java Pixmap.setColor怎麽用?Java Pixmap.setColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.graphics.Pixmap的用法示例。


在下文中一共展示了Pixmap.setColor方法的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: Halo

import com.badlogic.gdx.graphics.Pixmap; //導入方法依賴的package包/類
public Halo() {
	super();

	if (!TextureCache.contains( CACHE_KEY )) {
		Pixmap pixmap = new Pixmap(RADIUS * 2, RADIUS * 2, Pixmap.Format.RGBA8888);
		pixmap.setColor( 0xFFFFFFFF );
		pixmap.fillCircle( RADIUS, RADIUS, (int) (RADIUS * 0.75f));
		pixmap.setColor( 0xFFFFFF88 );
		pixmap.fillCircle( RADIUS, RADIUS, RADIUS );
		GdxTexture bmp = new GdxTexture(pixmap);
		TextureCache.add( CACHE_KEY, new SmartTexture( bmp ) );
	}

	texture( CACHE_KEY );

	origin.set( RADIUS );
}
 
開發者ID:kurtyu,項目名稱:PixelDungeonTC,代碼行數:18,代碼來源:Halo.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: generateScreenshot

import com.badlogic.gdx.graphics.Pixmap; //導入方法依賴的package包/類
public Pixmap generateScreenshot(ParticleSystem particleSystem, Player player) {
    final float cam_width = camera.getCameraWidth();
    final float cam_height = camera.getCameraHeight();
    final int current_x = camera.getCameraX();
    final int current_y = camera.getCameraY();
    final Pixmap screen_shot = new Pixmap((int) cam_width, (int) cam_height, Pixmap.Format.RGB888);

    for (int i = current_x; i < current_x + cam_width; i++) {
        for (int j = current_y; j < current_y + cam_height; j++) {
            Particle current_particle = particleSystem.getParticle(i, j);

            if (current_particle != null) {
                screen_shot.setColor(current_particle.getProperties().getColor());
                screen_shot.drawPixel(i - current_x, ((int) cam_height - 1) - (j - current_y));
            }
        }
    }

    return screen_shot;
}
 
開發者ID:treeman1111,項目名稱:Particles,代碼行數:21,代碼來源:DisplayManager.java

示例6: 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

示例7: 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

示例8: 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

示例9: createMoonSprite

import com.badlogic.gdx.graphics.Pixmap; //導入方法依賴的package包/類
public Sprite createMoonSprite(int size) {
        Pixmap pixmap = new Pixmap(size, size, Pixmap.Format.RGBA8888);
//        pixmap.setColor(color);
        pixmap.setColor(Color.WHITE);
        pixmap.fillCircle(pixmap.getWidth()/2, pixmap.getHeight()/2, size / 2 - 1);
        Sprite sprite = new Sprite(new Texture(pixmap));
        pixmap.dispose();
        return sprite;
    }
 
開發者ID:ZKasica,項目名稱:Planet-Generator,代碼行數:10,代碼來源:ObjectGenerator.java

示例10: 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

示例11: 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

示例12: 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

示例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: 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

示例15: 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.setColor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。