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.github.ykrasik.jaci.cli.libgdx.output.LibGdxCliOutput.java

License:Apache License

@Override
public void println(String text) {
    buffer.println(text, Color.WHITE);
}

From source file:com.github.ykrasik.jerminal.libgdx.impl.LibGdxTerminal.java

License:Apache License

private Color translateColor(TerminalColor color) {
    switch (color) {
    case BLACK:/*from   w w w  .j  a v  a  2s.  co m*/
        return Color.BLACK;
    case WHITE:
        return Color.WHITE;
    case GRAY:
        return Color.DARK_GRAY;
    case RED:
        return Color.PINK;
    case ORANGE:
        return Color.ORANGE;
    case YELLOW:
        return Color.YELLOW;
    case GREEN:
        return Color.GREEN;
    case BLUE:
        return BLUE;
    case VIOLET:
        return Color.MAGENTA;
    default:
        throw new IllegalArgumentException("Invalid color: " + color);
    }
}

From source file:com.hindelid.ld.thirtyfour.HUDDisplay.java

License:Apache License

public void renderStartScreen() {
    mHUDCamera.update();//from   w w  w.  j  ava 2s.  co  m
    mShapeRenderer.setProjectionMatrix(mHUDCamera.combined);

    mShapeRenderer.begin(ShapeRenderer.ShapeType.Line);
    mShapeRenderer.setColor(Color.WHITE);
    mShapeRenderer.polygon(leftArrow);
    mShapeRenderer.polygon(rightArrow);
    mShapeRenderer.end();

    mBatch.begin();
    mFont.setColor(Color.RED);
    mFont.getData().setScale(4f);
    mFont.draw(mBatch, "AnglerFish", 70f, 300f);
    mFont.getData().setScale(1f);
    mFont.draw(mBatch, "by Christoffer Hindelid", 70f, 240f);
    mBatch.end();

}

From source file:com.hindelid.ld.thirtyfour.Main.java

License:Apache License

@Override
public void render() {

    long before = TimeUtils.nanoTime();
    tick();/*from   w ww  .  j a v  a 2 s . c o m*/
    if (TreeBranch.sGlobal.y < 1000f) {
        Gdx.gl.glClearColor(0, 0, TreeBranch.sGlobal.y / 1000f, 1);
    } else if (TreeBranch.sGlobal.y < 2000f) {
        Gdx.gl.glClearColor((TreeBranch.sGlobal.y - 1000f) / 1000f, 0, 1, 1);
    } else {
        Gdx.gl.glClearColor((3000f - TreeBranch.sGlobal.y) / 1000f, 0, (3000f - TreeBranch.sGlobal.y) / 1000f,
                1);
    }

    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    mShapeRenderer.setProjectionMatrix(mCamera.combined);

    mShapeRenderer.begin(ShapeRenderer.ShapeType.Line);
    mShapeRenderer.setColor(Color.BROWN);
    mRoot.render(mShapeRenderer);

    mShapeRenderer.setColor(Color.GREEN);
    mRoot.renderLeefs(mShapeRenderer);

    mShapeRenderer.setColor(Color.WHITE);
    for (Fish f : mFishes) {
        f.render(mShapeRenderer);
    }
    for (Octopus o : mOctopuses) {
        o.render(mShapeRenderer);
    }

    mShapeRenderer.end();

    mHUDDisplay.render((int) mTotalPoints);

    long after = TimeUtils.nanoTime();

    //System.out.println("speed:" + mSpeed + " y:" + TreeBranch.sGlobal.y + " Time:" + (after - before) / 1000); //TODO remove

    if (TreeBranch.sGlobal.y < 15f) {
        mHUDDisplay.renderStartScreen();
    }
    if (mDead) {
        if (mHUDDisplay.renderGameOver((int) mTotalPoints)) {
            resetGame();
        }
    }

    if (Gdx.input.isKeyJustPressed(Input.Keys.ESCAPE)) {
        Gdx.app.exit();
    }
}

From source file:com.holotrash.lazerdeath2.lazerdeath2.java

License:Open Source License

@Override
public void render() {
    delta = Gdx.graphics.getDeltaTime();
    Gdx.gl.glClearColor(0, 0, 0, 1);//from ww  w  .j  av  a  2 s .c o m
    Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    if (scrollingUp && camera.position.y < mapData.scrollUpMax) {
        camera.translate(0, SCROLLING_MULTIPLIER * delta);
    }
    if (scrollingDown && camera.position.y > mapData.scrollDownMax) {
        camera.translate(0, (0 - SCROLLING_MULTIPLIER) * delta);
    }
    if (scrollingLeft && camera.position.x > mapData.scrollLeftMax) {
        camera.translate((0 - SCROLLING_MULTIPLIER) * delta, 0);
    }
    if (scrollingRight && camera.position.x < mapData.scrollRightMax) {
        camera.translate(SCROLLING_MULTIPLIER * delta, 0);
    }
    camera.update();
    tiledMapRenderer.setView(camera);
    tiledMapRenderer.render();
    tiledMapRenderer.getBatch().setProjectionMatrix(camera.combined);

    for (Enemy enemy : enemies) {
        if ((selectedUnit == null || !enemy.name().equals(selectedUnit.name()))
                && enemy.position().equals(lastClickedCell)) {
            selectedUnit = enemy;
            System.out.println("selectedUnit equals enemy: " + enemy.name());
        }

    }

    for (Dude dude : dudes) {
        if ((selectedUnit == null || !dude.name().equals(selectedUnit.name()))
                && dude.position().equals(lastClickedCell)) {
            selectedUnit = dude;
            System.out.println("selectedUnit equals dude: " + dude.name());
        }
    }

    //change states of sprites based on dude/enemy flags here
    for (int i = 0; i < dudes.size(); i++) {
        if (!this.playerAttacking && dudes.get(i).position().equals(lastClickedCell) && gm.dudesTurn()) {
            makeRangeHighlight(dudes.get(i));
        }
    }
    for (int i = 0; i < enemies.size(); i++) {
        if (!this.playerAttacking && enemies.get(i).position().equals(lastClickedCell) && gm.dudesTurn()) {
            makeRangeHighlight(enemies.get(i));
        }
    }

    spriteBatch.begin();

    //draw interacted tiles
    for (InteractedTile it : interactedTiles) {
        spriteBatch.draw(it.sprite, 128 * it.position.x(), 128 * it.position.y());
    }
    //draw items

    for (Coord coord : gm.itemWrangler.items.keySet()) {
        tempItem = gm.itemWrangler.items.get(coord);
        spriteBatch.draw(tempItem.tileSprite(), 128 * coord.x(), 128 * coord.y());
    }

    //draw dudes and enemies
    for (int i = 0; i < dudes.size(); i++) {
        spriteBatch.draw(dudes.get(i).sprite(), 128 * (dudes.get(i).position().x()),
                128 * (dudes.get(i).position().y()));

    }
    for (int i = 0; i < enemies.size(); i++) {
        spriteBatch.draw(enemies.get(i).sprite(), 128 * (enemies.get(i).position().x()),
                128 * (enemies.get(i).position().y()));
    }

    //draw cursor
    if (gm.dudesTurn() && selectedUnit != null) {
        spriteBatch.draw(this.unitCursor, 128 * selectedUnit.position().x(), 128 * selectedUnit.position().y());
    }

    if (gm.dudesTurn()) {
        //spriteBatch.setColor(hlColor);
        for (Coord c : highlightTiles.keySet()) {
            spriteBatch.setColor(highlightTiles.get(c).color);
            spriteBatch.draw(highlightTiles.get(c).sprite, 128 * highlightTiles.get(c).position.x(),
                    128 * highlightTiles.get(c).position.y());
        }
        spriteBatch.setColor(Color.WHITE);
    }

    // get a screen-relative point of reference for drawing ui elements
    tempV3 = new Vector3(0, 768, 0);
    tempV3 = camera.unproject(tempV3);

    // draw left side ui buttons
    spriteBatch.draw(this.endTurnButton, tempV3.x + 10, tempV3.y + 625);
    spriteBatch.draw(this.attackButton, tempV3.x + 10, tempV3.y + 500);
    spriteBatch.draw(this.menuButton, tempV3.x + 10, tempV3.y + 375);
    spriteBatch.draw(this.exitGameButton, tempV3.x + 10, tempV3.y + 250);

    // draw left status dialog stuff
    if (this.selectedUnit != null) {
        this.glamourShot = selectedUnit.glamourShot();
        this.currentUnitStats = selectedUnit.toStringz();
        // change left status box text to relevant unit stats:

    }

    spriteBatch.draw(this.leftStatusBox, tempV3.x, tempV3.y);
    spriteBatch.draw(this.rightStatusBox, tempV3.x + 768, tempV3.y - 64);
    spriteBatch.draw(this.glamourShot, tempV3.x, tempV3.y);
    uiFont.setColor(Color.BLACK);
    for (int i = 0; i < 5; i++) {
        if (currentUnitStats.size() > i)
            uiFont.draw(spriteBatch, currentUnitStats.get(i), tempV3.x + 266, tempV3.y + 182 - (i * 32));
    }

    //draw right side ui status console text
    consoleIterator = uiConsole.iterator();
    for (int i = 0; i < 5; i++) {
        if (consoleIterator.hasNext())
            uiFont.draw(spriteBatch, consoleIterator.next(), tempV3.x + 832, tempV3.y + 32 + (i * 32));
    }
    //draw right side ui status console fade out
    spriteBatch.draw(this.rightStatusBoxFade, tempV3.x + 768, tempV3.y - 64);

    if (dialogBox.enabled()) {
        // draw dialog box
        tempV3 = new Vector3(286, 700, 0);
        tempV3 = camera.unproject(tempV3);
        spriteBatch.draw(dialogBox.background(), tempV3.x, tempV3.y);
        tempV3 = new Vector3(384, 635, 0);
        tempV3 = camera.unproject(tempV3);
        spriteBatch.draw(dialogBox.button(), tempV3.x, tempV3.y);
        tempV3 = new Vector3(725, 635, 0);
        tempV3 = camera.unproject(tempV3);
        spriteBatch.draw(dialogBox.button(), tempV3.x, tempV3.y);
        // draw dialog text
        int numLines = dialogBox.currentMessage().size();
        if (numLines > 6)
            numLines = 6;
        tempV3 = new Vector3(384, 150, 0);
        tempV3 = camera.unproject(tempV3);
        for (int i = 0; i < numLines; i++) {
            //dialogFont.draw(spriteBatch, dialogLines.get(i), 384, 625 - (i*50));
            dialogFont.draw(spriteBatch, dialogBox.currentMessage().get(i), tempV3.x, tempV3.y - (i * 50));
        }
        tempV3 = new Vector3(565, 540, 0);
        tempV3 = camera.unproject(tempV3);
        temp = dialogBox.btn1();
        layout.setText(dialogFont, temp);
        dialogFont.draw(spriteBatch, temp, tempV3.x - layout.width, tempV3.y - layout.height);
        tempV3 = new Vector3(965, 540, 0);
        tempV3 = camera.unproject(tempV3);
        temp = dialogBox.btn2();
        layout.setText(dialogFont, temp);
        dialogFont.draw(spriteBatch, temp, tempV3.x - layout.width, tempV3.y - layout.height);
    } else if (this.menuDialog.enabled()) {
        // show menuDialog
        this.screenOrigin = new Vector3(0, 768, 0);
        this.screenOrigin = camera.unproject(this.screenOrigin);
        spriteBatch.draw(menuDialog.background(), screenOrigin.x + 384, screenOrigin.y + 64);
        spriteBatch.draw(menuDialog.buttons(), screenOrigin.x + 384, screenOrigin.y + 64);
        spriteBatch.draw(menuDialog.tabArrows(), screenOrigin.x + 384, screenOrigin.y + 64);
        // show menuDialog components
        for (MenuComponent mc : menuDialog.menuComponents()) {
            if (!Coord.coordsEqual(mc.position, GameMaster.nullCoord)) {
                spriteBatch.draw(mc.sprite, screenOrigin.x + mc.position.x(), screenOrigin.y + mc.position.y());
            }
        }
        // show menu labels
        for (MenuLabel ml : menuDialog.menuLabels()) {
            if (!Coord.coordsEqual(ml.position, GameMaster.nullCoord)) {
                dialogFont.draw(spriteBatch, ml.text, screenOrigin.x + ml.position.x(),
                        screenOrigin.y + ml.position.y());
            }
        }

    } else if (this.ynDialog.enabled()) {
        //show ynDialog
        if (!ynDialog.resultRecorded()) {
            this.screenOrigin = new Vector3(0, 768, 0);
            this.screenOrigin = camera.unproject(this.screenOrigin);
            spriteBatch.draw(ynDialog.background(), screenOrigin.x + 500, screenOrigin.y + 300);
            spriteBatch.draw(ynDialog.buttons(), screenOrigin.x + 500, screenOrigin.y + 300);
            dialogFont.draw(spriteBatch, ynDialog.line1(), screenOrigin.x + 535, screenOrigin.y + 525);
            dialogFont.draw(spriteBatch, ynDialog.line2(), screenOrigin.x + 535, screenOrigin.y + 490);
            dialogFont.draw(spriteBatch, ynDialog.line3(), screenOrigin.x + 535, screenOrigin.y + 455);
            dialogFont.draw(spriteBatch, ynDialog.choice1(), screenOrigin.x + 600, screenOrigin.y + 380);
            dialogFont.draw(spriteBatch, ynDialog.choice2(), screenOrigin.x + 850, screenOrigin.y + 380);
        } else {
            if (this.ynDialog.type() == BooleanDialogType.EXIT_GAME) {
                if (ynDialog.result()) {
                    Gdx.app.exit();
                } else {
                    ynDialog.disable();
                }
            }
        }
    } else {

        //Text overlay? dudes turn? enemies turn?
        tempV3 = new Vector3(0, 768, 0);
        tempV3 = camera.unproject(tempV3);
        if (gm.dudesTurn() && this.overlayFadeCounter > 0) {
            spriteBatch.draw(this.dudesTurnSprite, tempV3.x + 350, tempV3.y + 275);
            overlayFadeCounter--;
        } else if (gm.enemiesTurn() && this.overlayFadeCounter > 0) {
            spriteBatch.draw(this.enemiesTurnSprite, tempV3.x + 350, tempV3.y + 275);
            overlayFadeCounter--;
        }

    }
    spriteBatch.end();
    if (!dialogBox.enabled()) {
        gm.clockTick();
        gm.advanceGame();
    }

}

From source file:com.idp.engine.ui.graphics.actors.listview.ScrollBar.java

public ScrollBar(ListView parent) {
    if (parent == null)
        throw new NullPointerException();
    this.listView = parent;

    this.thickness = 2;
    this.offset = 4;
    this.tex = new IdpColorPixmap();
    tex.setColor(Color.WHITE);
    this.fadeDuration = 0.2f;
    this.fadeDelay = 0.5f;
    this.normalAlpha = 0.8f;
    setColor(new Color(0.4f, 0.4f, 0.4f, normalAlpha));
}

From source file:com.intrepid.nicge.utilz.graphics.TextureWorks.java

public static Texture createTexture(int sizex, int sizey) {
    return createTexture(sizex, sizey, Color.WHITE);
}

From source file:com.intrepid.studio.component.Button.java

Button(int x, int y, int width, int height, String text, ThreadRunnable command, boolean cmdLockSystem) {
    this.x = x;//from ww w.j a  va2 s  . c  o m
    this.y = y;
    this.width = width;
    this.height = height;
    this.text = text;
    this.command = command;
    this.cmdLockSystem = cmdLockSystem;
    this.mouseOverMe = false;
    this.isClicked = false;
    this.isActived = false;
    this.lockedIn = false;
    this.bitmapFont = new BitmapFont();
    this.texture = TextureWorks.createTexture(width, height, Color.WHITE);

    calculateDiff(width, height, text);
}

From source file:com.ixeption.libgdx.transitions.impl.ColorFadeTransition.java

License:Apache License

/** @param color the {@link Color} to fade to
 * @param interpolation the {@link Interpolation} method */
public ColorFadeTransition(Color color, Interpolation interpolation) {
    this.color = new Color(Color.WHITE);
    this.interpolation = interpolation;

    texture = new Texture(1, 1, Format.RGBA8888);
    Pixmap pixmap = new Pixmap(1, 1, Format.RGBA8888);
    pixmap.setColor(color);/*from w w  w .  j a  v a  2s. c  o m*/
    pixmap.fillRectangle(0, 0, 1, 1);
    texture.draw(pixmap, 0, 0);
}

From source file:com.ixeption.libgdx.transitions.impl.ColorFadeTransition.java

License:Apache License

@Override
public void render(Batch batch, Texture currentScreenTexture, Texture nextScreenTexture, float percent) {
    float width = currentScreenTexture.getWidth();
    float height = currentScreenTexture.getHeight();
    float x = 0;/*from   w  w  w  . j  av a  2  s .  c  om*/
    float y = 0;

    if (interpolation != null)
        percent = interpolation.apply(percent);

    batch.begin();

    float fade = percent * 2;

    if (fade > 1.0f) {
        fade = 1.0f - (percent * 2 - 1.0f);
        color.a = 1.0f - fade;
        batch.setColor(color);

        batch.draw(nextScreenTexture, 0, 0, width / 2, height / 2, nextScreenTexture.getWidth(),
                nextScreenTexture.getHeight(), 1, 1, 0, 0, 0, nextScreenTexture.getWidth(),
                nextScreenTexture.getHeight(), false, true);

    } else {

        color.a = 1.0f - fade;
        batch.setColor(color);

        batch.draw(currentScreenTexture, 0, 0, width / 2, height / 2, width, height, 1, 1, 0, 0, 0, (int) width,
                (int) height, false, true);

    }

    color.a = fade;

    batch.setColor(color);
    batch.draw(texture, 0, 0, width, height);
    batch.end();
    batch.setColor(Color.WHITE);

}