Example usage for com.badlogic.gdx.graphics Color WHITE

List of usage examples for com.badlogic.gdx.graphics Color WHITE

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics Color WHITE.

Prototype

Color WHITE

To view the source code for com.badlogic.gdx.graphics Color WHITE.

Click Source Link

Usage

From source file:com.bsencan.openchess.view.GameRenderer.java

License:Apache License

private void initUpperUI() {
    this.upperTextHud = new Table(Assets.skin);
    this.upperTextHud.add(this.scoreLabel);
    this.upperTextHud.setTransform(true);
    this.upperTextHud.setScale(0.5f / this.resetButton.getHeight());
    this.scoreLabel.setColor(Color.WHITE);
    this.scoreLabel.setAlignment(Align.left);
    this.upperTextHud.align(Align.left);
    this.upperTextHud.setPosition(0.7f, VIEWPORT_HEIGHT - 0.52f);
    this.stage.addActor(this.upperTextHud);

    Table highScoreTable = new Table(Assets.skin);
    highScoreTable.add(this.highScoreLabel);
    highScoreTable.setTransform(true);//from   w w  w. j av  a 2s.  c  o m
    highScoreTable.setScale(0.5f / this.resetButton.getHeight());
    highScoreLabel.setColor(Color.WHITE);
    highScoreLabel.setAlignment(Align.left);
    highScoreTable.align(Align.left);
    highScoreTable.setPosition(VIEWPORT_WIDTH / 2 + 0.7f, VIEWPORT_HEIGHT - 0.52f);
    stage.addActor(highScoreTable);
}

From source file:com.coder5560.game.ui.MyDialog.java

License:Apache License

/**
 * Adds a text button to the button table. The dialog must have been
 * constructed with a skin to use this method.
 * /*from   w ww.  j av  a2  s .  c  om*/
 * @param object
 *            The object that will be passed to {@link #result(Object)} if
 *            this button is clicked. May be null.
 */
public MyDialog button(String text, Object object) {
    if (skin == null)
        throw new IllegalStateException(
                "This method may only be used if the dialog was constructed with a Skin.");
    TextButtonStyle style = skin.get(TextButtonStyle.class);
    style.font = Assets.instance.fontFactory.getFont(20);
    style.fontColor = Color.WHITE;
    return button(text, object, style);
}

From source file:com.cookbook.samples.client.GwtSampleWrapper.java

License:Apache License

@Override
public void create() {
    Gdx.app.setLogLevel(Application.LOG_DEBUG);
    Gdx.app.log("GdxSampleGwt", "Setting up for " + tests.length + " tests.");

    ui = new Stage();
    skin = new Skin(Gdx.files.internal("data/uiskin.json"));
    font = new BitmapFont(Gdx.files.internal("data/arial-15.fnt"), false);
    container = new Table();
    ui.addActor(container);//ww w. j  av a2 s  . co m
    container.debug();
    Table table = new Table();
    ScrollPane scroll = new ScrollPane(table);
    container.add(scroll).expand().fill();
    table.pad(10).defaults().expandX().space(4);
    for (final Instancer instancer : tests) {
        table.row();
        TextButton button = new TextButton(instancer.instance().getClass().getName(), skin);
        button.addListener(new ClickListener() {
            @Override
            public void clicked(InputEvent event, float x, float y) {
                ((InputWrapper) Gdx.input).multiplexer.removeProcessor(ui);
                test = instancer.instance();
                Gdx.app.log("GdxSampleGwt", "Clicked on " + test.getClass().getName());
                test.create();
                test.setPlatformResolver(new WebResolver());
                test.resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
            }
        });
        table.add(button).expandX().fillX();
    }
    container.row();
    container.add(
            new Label("Click on a test to start it, press ESC to close it.", new LabelStyle(font, Color.WHITE)))
            .pad(5, 5, 5, 5);

    Gdx.input = new InputWrapper(Gdx.input) {
        @Override
        public boolean keyUp(int keycode) {
            if (keycode == Keys.ESCAPE) {
                if (test != null) {
                    Gdx.app.log("GdxSampleGwt", "Exiting current test.");
                    dispose = true;
                }
            }
            return false;
        }

        @Override
        public boolean touchDown(int screenX, int screenY, int pointer, int button) {
            if (screenX < Gdx.graphics.getWidth() / 10.0 && screenY < Gdx.graphics.getHeight() / 10.0) {
                if (test != null) {
                    dispose = true;
                }
            }
            return false;
        }
    };
    ((InputWrapper) Gdx.input).multiplexer.addProcessor(ui);

    Gdx.app.log("GdxSampleGwt", "Test picker UI setup complete.");
}

From source file:com.cyphercove.dayinspace.gameplayscene.rendering.Border.java

License:Apache License

/**
 * @param doorOpenTime Use 0 for closed door
 *//*from  ww  w .j a va2 s.  co  m*/
public void drawBackground(Batch batch, int exitDoorY, float doorOpenTime, int entryDoorY) {
    batch.setColor(Color.WHITE);
    batch.draw(left, -129, 0);
    batch.draw(right, 242, 0);

    if (doorOpenTime != 0)
        batch.draw(exitDoorBehindTile, -SCALE, exitDoorY);

    batch.draw(entryDoor, Board.WIDTH * SCALE, entryDoorY);
}

From source file:com.cyphercove.dayinspace.gameplayscene.rendering.Border.java

License:Apache License

/**
 * @param doorOpenTime Use 0 for closed door
 *//*from  w  w  w  .j a va2  s.c  o  m*/
public void drawForeground(Batch batch, int exitDoorY, float doorOpenTime) {
    batch.setColor(Color.WHITE);
    batch.draw(exitDoor.getKeyFrame(doorOpenTime), -SCALE, exitDoorY + EXIT_DOOR_Y_OFFSET);
    batch.draw(top, -129, 132);
    batch.draw(bottom, -129, -27);
}

From source file:com.cyphercove.dayinspace.gameplayscene.rendering.Border.java

License:Apache License

public void drawLight(Batch batch, int exitDoorY, float doorOpenTime, int entryDoorY) {
    //top and bottom space
    batch.setColor(Color.WHITE);
    batch.draw(white, -129, 158, 500, 18);
    batch.draw(white, -129, -44, 500, 18);
    for (GlowSpot spot : beams) {
        spot.drawLight(batch, assets, 0, 0);
    }/*from  w  ww. j a v  a 2s.c om*/

    exitDoorGlow.lightColor = doorOpenTime > DOOR_ANIMATION_GREEN_TIME ? DOOR_LIGHT_OPEN : DOOR_LIGHT_CLOSED;
    exitDoorGlow.drawLight(batch, assets, -SCALE, exitDoorY);
    entryDoorGlow.drawLight(batch, assets, Board.WIDTH * SCALE, entryDoorY);
}

From source file:com.cyphercove.dayinspace.gameplayscene.rendering.TextureRegionActor.java

License:Apache License

public void draw(Batch batch, float parentAlpha) {
    if (region == null)
        return;/*  www  .  j a va2s. co m*/

    batch.setColor(Color.WHITE);

    int width = (int) (region.getRegionWidth() * getScaleX());
    int height = (int) (region.getRegionHeight() * getScaleY());

    batch.draw(region, getX() - width / 2, getY() - height / 2, width, height);
}

From source file:com.cyphercove.doublehelix.ParticleGroupStrategy.java

License:Apache License

@Override
public void beforeGroup(int group, Array<Decal> contents) {
    Gdx.gl.glEnable(GL20.GL_BLEND);/*from w ww  . j a v a 2s .  c  om*/
    Gdx.gl.glBlendFunc(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_COLOR);
    contents.sort(cameraSorter);

    tmpColor.set(Settings.backgroundColor).lerp(Color.WHITE, WHITENESS);

    shader.begin();
    shader.setUniformMatrix("u_projTrans", camera.combined);
    shader.setUniformi("u_texture", 0);
    shader.setUniformf("u_baseColor", tmpColor);
}

From source file:com.cyphercove.doublehelix.ParticleGroupStrategy.java

License:Apache License

@Override
public void beforeBillboardGroup(int group, Array<BillboardDecal> contents) {
    Gdx.gl.glEnable(GL20.GL_BLEND);//from w  ww .  j  av  a 2  s.  com
    Gdx.gl.glBlendFunc(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_COLOR);
    contents.sort(billboardCameraSorter);

    tmpColor.set(Settings.backgroundColor).lerp(Color.WHITE, WHITENESS);

    billboardShader.begin();
    billboardShader.setUniformMatrix("u_projTrans", camera.combined);
    billboardShader.setUniformi("u_texture", 0);
    billboardShader.setUniformf("u_baseColor", tmpColor);
}

From source file:com.dagondev.drop.GameScreen.java

License:Apache License

/**
 * Handles player death. Can be only called in {@link #postRenderUpdate(float)} because of destroying physical body
 * @param i which player. can be 1 or 2//from  www .j a v a  2s  .co m
 */
private void playerDie(int i) {
    Vector2 pos;
    switch (i) {
    case 1:
        pos = player1Body.getPosition();
        player1Light.remove();
        player1Light = null;
        world.destroyBody(player1Body);
        player1Body = null;
        //    player1Died=false;
        sunLight.setColor(COLOR_PLAYER2);
        break;
    case 2:
        pos = player2Body.getPosition();
        player2Light.remove();
        player2Light = null;
        world.destroyBody(player2Body);
        player2Body = null;
        //   player2Died=false;
        sunLight.setColor(COLOR_PLAYER1);
        break;
    default:
        return;

    }
    endOfRound = true;
    PointLight pointLight = new PointLight(rayHandler, 60, Color.WHITE, MIN_DEATH_LIGHT_RADIUS, pos.x, pos.y);
    deathLights.add(pointLight);
    pointLight.setStaticLight(true);
    //createPlayer(i);

}