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.aia.hichef.ui.n.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.
 * /* w w  w  .j  a  va2s.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.getRegular20();
    style.fontColor = Color.WHITE;
    return button(text, object, style);
}

From source file:com.alterego.jelly.screens.PlayGameScreen.java

License:Apache License

private void rebuildStage() {
    buttonPause = new JellyButton(Assets.instance.gameElements.pause);
    buttonPause.setMyScaleSize(1.3f, 1.3f);
    buttonPause.setPosition(8, Const.GAME_HEIGHT - buttonPause.getHeight() - 8);
    buttonPause.addTouchListener(new RunnableAction() {
        public void run() {
            pauseUi.showWindow(true);//w w  w .  ja v  a2  s. c  o m
        }
    }, null);

    buttonReplay = new JellyButton(Assets.instance.gameElements.replay);
    buttonReplay.setMyScaleSize(1.3f, 1.3f);
    buttonReplay.setPosition(8, Const.GAME_HEIGHT - 2 * buttonReplay.getHeight() - 15);
    buttonReplay.addTouchListener(new RunnableAction() {
        public void run() {
            winnerUi.showWindow(true);
            winnerUi.setTime(110);
        }
    }, null);

    Label.LabelStyle labelStyle = new Label.LabelStyle(Assets.instance.fonts.freezers, Color.WHITE);
    gameTime = new Label("0:00", labelStyle);
    gameTime.setAlignment(Align.left);
    gameTime.setPosition(Const.GAME_WIDTH - 135, Const.GAME_HEIGHT - 60);
    gameTime.setWrap(true);
    gameTime.setWidth(350f);

    star = new Image(Assets.instance.gameElements.star);
    star.setScale(0.3f);
    star.setOrigin(star.getWidth() / 2, star.getHeight() / 2);
    star.addAction(Actions.alpha(0f));
    star1 = new Image(Assets.instance.gameElements.star);
    star1.setScale(0.3f);
    star1.setPosition(Const.GAME_WIDTH - 60, Const.GAME_HEIGHT - 92);
    star2 = new Image(Assets.instance.gameElements.star);
    star2.setScale(0.3f);
    star2.setPosition(star1.getX() - 40, Const.GAME_HEIGHT - 92);
    star3 = new Image(Assets.instance.gameElements.star);
    star3.setScale(0.3f);
    star3.setPosition(star2.getX() - 40, Const.GAME_HEIGHT - 92);

    Label.LabelStyle labelStyle2 = new Label.LabelStyle(Assets.instance.fonts.freezers, Color.WHITE);
    freezes = new Label("0", labelStyle2);
    freezes.setText(String.valueOf(LevelData.freezers));
    freezes.setAlignment(Align.right);
    freezes.setPosition(Const.GAME_WIDTH - 200, Const.GAME_HEIGHT - 170);
    freezes.setWrap(true);
    freezes.setWidth(100f);

    freezeFon = new Image(Assets.instance.gameElements.freezeBuyFon);
    freezeFon.setPosition(Const.GAME_WIDTH - 158, Const.GAME_HEIGHT - buttonReplay.getHeight() - 107);
    freezeFon.setScale(0.6f);

    buttonBuyFreeze = new JellyButton(Assets.instance.gameElements.freezeBuy);
    buttonBuyFreeze.setMyScaleSize(1.6f, 1.6f);
    buttonBuyFreeze.setPosition(Const.GAME_WIDTH - buttonBuyFreeze.getWidth() - 15,
            Const.GAME_HEIGHT - buttonReplay.getHeight() - 100);
    buttonBuyFreeze.addTouchListener(new RunnableAction() {
        public void run() {
            marketUi.showWindow(true);
        }
    }, null);

    imgFreeze = new Image(Assets.instance.gameElements.freeze);
    imgFreeze.setOrigin(imgFreeze.getWidth() / 2, imgFreeze.getHeight() / 2);
    imgFreeze.setScale(0.7f);
    imgFreeze.setPosition(freezeFon.getX() - 17, freezeFon.getY() - 25);
    imgFreeze.addAction(Actions.alpha(0f));

    if (addHelp) {
        float delay = 5f;
        if (GamePreferences.instance.isSensorXYZ) {
            delay = 4f;
            helpNavigate = new Image(Assets.instance.menuElements.navigate_tel);
            helpNavigate.setOrigin(helpNavigate.getWidth() / 2, helpNavigate.getHeight() / 2);
            helpNavigate.setScale(0.7f);
            helpNavigate.setPosition(Const.GAME_WIDTH - helpNavigate.getWidth() - 25, Const.GAME_HEIGHT - 500);
            helpNavigate.addAction(sequence(Actions.alpha(0f), Actions.delay(2f), new RunnableAction() {
                public void run() {
                    gameState = GameState.PAUSE;
                }
            }, Actions.alpha(1f, 0.5f), Actions.rotateBy(15f, 0.4f, Interpolation.fade),
                    Actions.rotateBy(-30f, 0.8f, Interpolation.fade),
                    Actions.rotateBy(25f, 0.7f, Interpolation.fade), Actions.alpha(0f, 0.4f)));
        } else {
            helpNavigate = new Image(Assets.instance.menuElements.navigate_finger);
            helpNavigate.setOrigin(helpNavigate.getWidth() / 2, helpNavigate.getHeight() / 2);
            helpNavigate.setScale(0.7f);
            helpNavigate.setPosition(Const.GAME_WIDTH - helpNavigate.getWidth() - 25, Const.GAME_HEIGHT - 500);
            helpNavigate.addAction(sequence(Actions.alpha(0f), Actions.delay(2f), new RunnableAction() {
                public void run() {
                    gameState = GameState.PAUSE;
                }
            }, Actions.alpha(1f, 0.5f), Actions.moveBy(-150f, 0, 0.7f, Interpolation.fade),
                    Actions.moveBy(80f, 0, 0.7f, Interpolation.fade),
                    Actions.moveBy(0, 150f, 0.7f, Interpolation.fade),
                    Actions.moveBy(0, -200f, 0.7f, Interpolation.linear), Actions.alpha(0f, 0.4f)));
        }
        helpFreeze = new Image(Assets.instance.menuElements.navigate_finger);
        helpFreeze.setOrigin(helpFreeze.getWidth() / 2, helpFreeze.getHeight() / 2);
        helpFreeze.setScale(-0.7f, 0.7f);
        helpFreeze.setPosition(helpFreeze.getWidth() + 35, Const.GAME_HEIGHT - 500);
        helpFreeze.addAction(sequence(Actions.alpha(0f), Actions.delay(delay), Actions.alpha(1f, 0.5f),
                Actions.moveBy(LevelData.posX - helpFreeze.getX() + 20,
                        LevelData.posY - helpFreeze.getY() - helpFreeze.getHeight() - 28, 0.7f,
                        Interpolation.fade),
                new RunnableAction() {
                    public void run() {
                        setAnimation(animFreezeOn);
                    }
                }, Actions.alpha(0f, 0.2f)));
    }

    if (addHelp) {
        stage.addActor(helpNavigate);
        stage.addActor(helpFreeze);
    }
    stage.addActor(buttonPause);
    stage.addActor(buttonReplay);
    stage.addActor(gameTime);
    stage.addActor(freezeFon);
    stage.addActor(freezes);
    stage.addActor(buttonBuyFreeze);
    stage.addActor(star1);
    stage.addActor(star2);
    stage.addActor(star3);
    stage.addActor(star);
    stage.addActor(imgFreeze);
    stage.addActor(levelBuilder);
    stage.addActor(winnerUi);
    stage.addActor(marketUi);
    stage.addActor(pauseUi);

}

From source file:com.andgate.ikou.render.PlayerRender.java

License:Open Source License

public PlayerRender() {
    tileMesh = new TileMesh();
    tileMesh.addTile(Color.WHITE, 0, 0, 0);
    tileMesh.setNeedsRebuild();/*from   w  w w .j  a va 2s.  co m*/

    material = new Material(TileStack.TILE_MATERIAL);
    setColor(new Color(1.0f, 1.0f, 1.0f, 1.0f));
}

From source file:com.andgate.ikou.view.LevelSelectScreen.java

License:Open Source License

private Table buildFloorSelectTable() {
    final Table floorSelectTable = new Table();

    final LabelStyle floorProgressStyle = new LabelStyle(game.menuOptionFont, Color.WHITE);
    floorProgressLabel = new ShaderLabel(floorProgressString, floorProgressStyle, game.fontShader);

    final LabelStyle floorsSelectLabelStyle = new LabelStyle(game.menuTitleFont, Color.CYAN);
    final ShaderLabel floorSelectLabel = new ShaderLabel(SELECT_FLOOR_HEADER, floorsSelectLabelStyle,
            game.fontShader);/*w  ww.  j ava  2 s  .  co  m*/
    final ShaderLabel noLevelSelected = new ShaderLabel(SELECT_LEVEL_MESSAGE, floorProgressStyle,
            game.fontShader);

    previewContainer = new Container();

    if (levelNameList.getSelectedIndex() == -1)
        previewContainer.setActor(noLevelSelected);

    float length = (Gdx.graphics.getWidth() < Gdx.graphics.getHeight()) ? Gdx.graphics.getWidth()
            : Gdx.graphics.getHeight();

    length *= 0.70f;
    previewContainer.size(length);

    floorSelectTable.add(floorSelectLabel).row();
    floorSelectTable.add(floorProgressLabel).row();
    floorSelectTable.add(previewContainer);

    return floorSelectTable;
}

From source file:com.andgate.ikou.view.MainMenuScreen.java

License:Open Source License

public void buildStage() {
    stage.clear();/*from   w w w . jav  a  2s. c om*/
    stage.getViewport().setWorldSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    stage.getViewport().update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), true);

    final LabelStyle titleLabelStyle = new LabelStyle(game.logoFont, Color.CYAN);
    final ShaderLabel titleLabel = new ShaderLabel(Constants.GAME_NAME, titleLabelStyle, game.fontShader);

    final LabelStyle buttonLabelStyle = new LabelStyle(game.menuOptionFont, Color.WHITE);
    final ButtonStyle buttonStyle = new ButtonStyle(game.skin.getDrawable("default-round"),
            game.skin.getDrawable("default-round-down"), game.skin.getDrawable("default-round"));

    final ShaderLabel playButtonLabel = new ShaderLabel(PLAY_BUTTON_TEXT, buttonLabelStyle, game.fontShader);
    final Button playButton = new Button(buttonStyle);
    playButton.add(playButtonLabel);

    playButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            //game.buttonPressedSound.play();
            game.setScreen(new LevelSelectScreen(game));
            MainMenuScreen.this.dispose();
        }
    });

    final ShaderLabel buildButtonLabel = new ShaderLabel(BUILD_BUTTON_TEXT, buttonLabelStyle, game.fontShader);
    final Button buildButton = new Button(buttonStyle);
    buildButton.add(buildButtonLabel);

    buildButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            //game.buttonPressedSound.play();
            game.setScreen(new LevelBuilderScreen(game));
            MainMenuScreen.this.dispose();
        }
    });

    Table table = new Table();

    table.add(titleLabel).center().top().spaceBottom(25.0f).row();
    table.add(playButton).fill().spaceBottom(20.0f).center().bottom().row();
    table.add(buildButton).fill().spaceBottom(20.0f).center().bottom().row();

    table.setFillParent(true);

    stage.addActor(table);
}

From source file:com.andgate.pokeadot.GameScreen.java

License:Open Source License

private void buildIntroStage() {
    introStage = new Stage();
    //introStage.getViewport().setCamera(camera);

    Label.LabelStyle labelStyle = new Label.LabelStyle(game.mediumSmallFont, Color.WHITE);
    Label instructionsLabel = new Label(INSTRUCTIONS_TEXT, labelStyle);
    Label pokeAnywhereLabel = new Label(POKE_ANYWHERE_TEXT, labelStyle);

    Table table = new Table();
    table.add(instructionsLabel).center().row();
    table.add(pokeAnywhereLabel).center();

    table.setFillParent(true);/*from ww w.  java  2s  . co m*/

    introStage.addActor(table);
}

From source file:com.badlogic.gdx.tests.BulletTestCollection.java

License:Apache License

@Override
public void create() {
    if (app == null) {
        app = Gdx.app;//w w  w.j  av a  2 s  .c o m
        tests[testIndex].create();
    }

    cameraController = new CameraInputController(tests[testIndex].camera);
    cameraController.activateKey = Keys.CONTROL_LEFT;
    cameraController.autoUpdate = false;
    cameraController.forwardTarget = false;
    cameraController.translateTarget = false;
    Gdx.input.setInputProcessor(new InputMultiplexer(cameraController, this, new GestureDetector(this)));

    font = new BitmapFont(Gdx.files.internal("data/arial-15.fnt"), false);
    hud = new Stage();
    hud.addActor(fpsLabel = new Label(" ", new Label.LabelStyle(font, Color.WHITE)));
    fpsLabel.setPosition(0, 0);
    hud.addActor(titleLabel = new Label(tests[testIndex].getClass().getSimpleName(),
            new Label.LabelStyle(font, Color.WHITE)));
    titleLabel.setY(hud.getHeight() - titleLabel.getHeight());
    hud.addActor(instructLabel = new Label("A\nB\nC\nD\nE\nF", new Label.LabelStyle(font, Color.WHITE)));
    instructLabel.setY(titleLabel.getY() - instructLabel.getHeight());
    instructLabel.setAlignment(Align.top | Align.left);
    instructLabel.setText(tests[testIndex].instructions);
}

From source file:com.badlogic.gdx.tests.dragome.examples.bullet.BulletTestCollection.java

@Override
public void create() {
    if (app == null) {
        app = Gdx.app;/*from w ww  .ja  v  a 2  s.  c o  m*/
        tests[testIndex].create();
    }

    cameraController = new CameraInputController(tests[testIndex].camera);
    cameraController.activateKey = Keys.CONTROL_LEFT;
    cameraController.autoUpdate = false;
    cameraController.forwardTarget = false;
    cameraController.translateTarget = false;
    Gdx.input.setInputProcessor(new InputMultiplexer(cameraController, this, new GestureDetector(this)));

    font = new BitmapFont(false);
    hud = new Stage();
    hud.addActor(fpsLabel = new Label(" ", new Label.LabelStyle(font, Color.WHITE)));
    fpsLabel.setPosition(0, 0);
    hud.addActor(titleLabel = new Label(tests[testIndex].getClass().getSimpleName(),
            new Label.LabelStyle(font, Color.WHITE)));
    titleLabel.setY(hud.getHeight() - titleLabel.getHeight());
    hud.addActor(instructLabel = new Label("A\nB\nC\nD\nE\nF", new Label.LabelStyle(font, Color.WHITE)));
    instructLabel.setY(titleLabel.getY() - instructLabel.getHeight());
    instructLabel.setAlignment(Align.top | Align.left);
    instructLabel.setText(tests[testIndex].instructions);
}

From source file:com.badlogic.gdx.tests.gwt.GwtTestWrapper.java

License:Apache License

@Override
public void create() {
    Gdx.app.setLogLevel(Application.LOG_DEBUG);
    Gdx.app.log("GdxTestGwt", "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 a  v  a 2  s  .c  o  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("GdxTestGwt", "Clicked on " + test.getClass().getName());
                test.create();
                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("GdxTestGwt", "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("GdxTestGwt", "Test picker UI setup complete.");
}

From source file:com.badlogic.invaders.Renderer.java

License:Apache License

public Renderer() {
    try {//from w ww  .  ja  v a 2  s  .c  o m
        lights = new Environment();
        lights.add(new DirectionalLight().set(Color.WHITE, new Vector3(-1, -0.5f, 0).nor()));

        spriteBatch = new SpriteBatch();
        modelBatch = new ModelBatch();

        backgroundTexture = new Texture(Gdx.files.internal("data/planet.jpg"), Format.RGB565, true);
        backgroundTexture.setFilter(TextureFilter.MipMap, TextureFilter.Linear);

        font = new BitmapFont(Gdx.files.internal("data/font10.fnt"), Gdx.files.internal("data/font10.png"),
                false);

        camera = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}