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.sidereal.dolphinoes.architecture.core.assetload.LoadingPercentage.java

License:Apache License

@Override
public void updateProgress(float progress) {

    if (text == null)
        createObject();// w  w  w.ja  v  a  2s.c  om
    else {
        text.setText("Loading \r\n" + ((int) (progress * 1000) / 10f) + " %", Color.WHITE);
    }
}

From source file:com.sidereal.dolphinoes.behaviors.particlesystem.ParticleSpriteLayout.java

License:Apache License

public ParticleSpriteLayout(String sprite, Vector2 size) {

    this.sprite = sprite;
    this.size = size;
    this.tintColor = Color.WHITE;
    this.progressionEvent = new AbstractEvent() {

        @Override/*from w w  w  .  j a v  a  2  s  . c o m*/
        public void run(Object... params) {

            GameObject obj = (GameObject) params[0];

            if (obj instanceof ParticleSpriteObject) {

                ((ParticleSpriteObject) obj).currGravity = Utility.lerpTowards(
                        ((ParticleSpriteObject) obj).currGravity, ((ParticleSpriteObject) obj).gravity, 0.1f);

                ((ParticleSpriteObject) obj).pos.setRelative(
                        ((ParticleSpriteObject) obj).trajectory.x * ((ParticleSpriteObject) obj).speed
                                * DolphinOES.time.getDeltaTime(),
                        Math.min(1,
                                Math.max(-1,
                                        ((ParticleSpriteObject) obj).currGravity
                                                + ((ParticleSpriteObject) obj).trajectory.y))
                                * ((ParticleSpriteObject) obj).speed * DolphinOES.time.getDeltaTime());

                ((ParticleSpriteObject) obj).renderable.getDrawer("Main", SpriteDrawer.class)
                        .setTransparency(((((ParticleSpriteObject) obj).timeRemaining
                                / ((ParticleSpriteObject) obj).timeToLive)), false);

            }
            return;
        }
    };
}

From source file:com.sidereal.dolphinoes.behaviors.renderer.sprite.SpriteDrawer.java

License:Apache License

public SpriteDrawer(Renderer renderer, String name, String filepath) {

    super(renderer, name, false);
    this.filepath = filepath;
    sprite = new Sprite(DolphinOES.assets.get(filepath, Texture.class));
    tintColor = Color.WHITE.cpy();
    transparency = 1;/* ww  w.  ja  v a  2  s .c o  m*/
    size = new Vector2(sprite.getWidth(), sprite.getHeight());
    positionOffset = new Vector2();
    origin = new Vector2(size.x / 2f, size.y / 2f);
    setSprite(filepath);
}

From source file:com.sidereal.dolphinoes.behaviors.renderer.spritesequence.SpriteSequencePreference.java

License:Apache License

public SpriteSequencePreference() {

    this.timePerAnimation = 1;
    this.size = new Vector2(100, 100);
    this.positionOffset = new Vector2(100, 100);
    this.placeAtEnd = false;
    this.placeAtStart = false;
    this.transparency = 1;
    this.tintColor = Color.WHITE.cpy();
}

From source file:com.sidereal.dolphinoes.ui.MessageBubble.java

License:Apache License

public void add(String text) {

    add(text, Color.WHITE);
}

From source file:com.sidereal.dolphinoes.ui.TextBuilder.java

License:Apache License

public TextBuilder(GameScene scene, boolean wrap, String fontDataPath) {

    super(scene);

    font = getFont(fontDataPath);//from w  w  w .  j  a  va2 s  .  c o m

    this.color = Color.WHITE;
    this.bounds = new Vector2();

    rawParagraphs = new ArrayList<TextBuilder.Paragraph>();
    paraGraphsToWrite = new ArrayList<TextBuilder.Paragraph>();

    setAlpha(1);
    setScale(1f);
    pos.setRelative(0, 0, 5);

    lineSpacing = 5f;
    windowSize = 600;
    this.wrapText = wrap;
    allignment = Allign.Center;
    anchor = Anchor.Middle;
}

From source file:com.sidereal.dolphinoes.ui.TextBuilder.java

License:Apache License

public final void addText(ArrayList<String> data, ArrayList<Color> paragraphColors) {

    for (int i = 0; i < data.size(); i++) {
        if (paragraphColors == null || paragraphColors.size() != data.size() || paragraphColors.get(i) == null)

            addText(data.get(i), Color.WHITE);
        else/* w  w w .  j a va  2 s.  co m*/
            addText(data.get(i), paragraphColors.get(i));
    }
}

From source file:com.sixteencolorgames.sandbox.IntroScreen.java

@Override
public void render(float delta) {
    super.render(delta);
    game.batch.begin();/*from   w  ww. ja v a2s.c om*/
    game.batch.setColor(1, 1, 1, alpha);
    game.batch.draw(game.textures.get("logo"), 200, 200, 100, 100);
    game.batch.setColor(Color.WHITE);
    game.batch.end();
    alpha += direction;
    if (alpha > 1) {
        direction *= -1;
    }
    if (alpha < 0) {
        game.setScreen(new LoadingScreen(game));
        dispose();
    }
    if (Gdx.input.justTouched()) {
        game.setScreen(new LoadingScreen(game));
        dispose();
    }
}

From source file:com.smeanox.games.sg002.screen.GameScreen.java

License:Open Source License

/**
 * Create all GUI elements//ww  w  . j  a va 2s  . c  o m
 */
private void createUI() {
    LinkedList<Button> toLayout = new LinkedList<Button>();

    // GUI
    Button b;
    // +
    b = new Button(new Sprite(Assets.button), Assets.liberationMedium, "+", Color.BLACK, Color.WHITE,
            Color.LIGHT_GRAY, Color.DARK_GRAY);
    b.addClickHandler(new ClickHandler() {
        @Override
        public void onClick() {
            zoomIn();
        }
    });
    addGUIElement(b);
    toLayout.add(b);
    // -
    b = new Button(new Sprite(Assets.button), Assets.liberationMedium, "-", Color.BLACK, Color.WHITE,
            Color.LIGHT_GRAY, Color.DARK_GRAY);
    b.addClickHandler(new ClickHandler() {
        @Override
        public void onClick() {
            zoomOut();
        }
    });
    addGUIElement(b);
    toLayout.add(b);

    layout(toLayout, 2, 1, -1, -1, -0.48f, -0.48f, 40, 40, 10, 0);

    toLayout.clear();
    // money label
    b = new Button(null, Assets.liberationMedium, Language.getStrings().format("gameScreen.currency", 0),
            Color.BLACK, Color.WHITE, Color.LIGHT_GRAY, Color.DARK_GRAY);
    addGUIElement(b);
    toLayout.add(b);
    moneyLabel = b;
    // name label
    b = new Button(null, Assets.liberationMedium, "name", Color.BLACK, Color.WHITE, Color.LIGHT_GRAY,
            Color.DARK_GRAY);
    addGUIElement(b);
    toLayout.add(b);
    nameLabel = b;

    layout(toLayout, 1, 2, 1, -1, 0.48f, -0.48f, 150, 40, 0, 10);

    toLayout.clear();
    // produce
    b = new Button(new Sprite(Assets.button), Assets.liberationSmall,
            Language.getStrings().get("gameScreen.produce"), Color.BLACK, Color.WHITE, Color.LIGHT_GRAY,
            Color.DARK_GRAY);
    b.addClickHandler(new ClickHandler() {
        @Override
        public void onClick() {
            startProduce();
        }
    });
    addGUIElement(b);
    toLayout.add(b);
    produceButton = b;
    // cancel
    b = new Button(new Sprite(Assets.button), Assets.liberationSmall,
            Language.getStrings().get("gameScreen.cancel"), Color.BLACK, Color.WHITE, Color.LIGHT_GRAY,
            Color.DARK_GRAY);
    b.addClickHandler(new ClickHandler() {
        @Override
        public void onClick() {
            cancelAction();
        }
    });
    addGUIElement(b);
    toLayout.add(b);
    cancelButton = b;
    // move
    b = new Button(new Sprite(Assets.button), Assets.liberationSmall,
            Language.getStrings().get("gameScreen.move"), Color.BLACK, Color.WHITE, Color.LIGHT_GRAY,
            Color.DARK_GRAY);
    b.addClickHandler(new ClickHandler() {
        @Override
        public void onClick() {
            startMove();
        }
    });
    addGUIElement(b);
    toLayout.add(b);
    moveButton = b;
    // fight
    b = new Button(new Sprite(Assets.button), Assets.liberationSmall,
            Language.getStrings().get("gameScreen.fight"), Color.BLACK, Color.WHITE, Color.LIGHT_GRAY,
            Color.DARK_GRAY);
    b.addClickHandler(new ClickHandler() {
        @Override
        public void onClick() {
            startFight();
        }
    });
    addGUIElement(b);
    toLayout.add(b);
    fightButton = b;

    layout(toLayout, 2, 2, -1, 1, -0.48f, 0.48f, 150, 40, 10, 5);

    toLayout.clear();
    // nextPlayer
    b = new Button(new Sprite(Assets.button), Assets.liberationSmall,
            Language.getStrings().get("gameScreen.nextPlayer"), Color.BLACK, Color.WHITE, Color.LIGHT_GRAY,
            Color.DARK_GRAY);
    b.addClickHandler(new ClickHandler() {
        @Override
        public void onClick() {
            proposeEndPlaying();
        }
    });
    addGUIElement(b);
    toLayout.add(b);
    nextPlayerButton = b;

    layout(toLayout, 1, 1, 1, 1, 0.48f, 0.48f, 200, 40, 0, 0);

    // produce buttons
    produceButtons = new LinkedList<Button>();
    gameObjectTypeToProduceButton = new HashMap<GameObjectType, Button>();
    int cols, rows;
    cols = (int) Math.round(Math.sqrt(GameObjectType.getAllGameObjectTypes().size() / 2.0));
    rows = (int) Math.ceil((double) GameObjectType.getAllGameObjectTypes().size() / cols);
    for (final GameObjectType gameObjectType : GameObjectType.getAllGameObjectTypesSorted()) {
        b = new Button(new Sprite(Assets.button), Assets.liberationSmall,
                gameObjectType.getName() + " ("
                        + Language.getStrings().format("gameScreen.currency", gameObjectType.getValue()) + ")",
                Color.BLACK, Color.WHITE, Color.LIGHT_GRAY, Color.DARK_GRAY);
        b.addClickHandler(new ClickHandler() {
            @Override
            public void onClick() {
                selectProduceGameObjectType(gameObjectType);
            }
        });
        addGUIElement(b);
        produceButtons.add(b);
        gameObjectTypeToProduceButton.put(gameObjectType, b);
    }

    layout(produceButtons, cols, rows, 0, 0, 0, 0, 250, 40, 5, 5);
}

From source file:com.smeanox.games.sg002.screen.MenuScreen.java

License:Open Source License

/**
 * Create all GUI elements/*from   ww  w  . j a v a2  s . co  m*/
 */
private void createUI() {
    LinkedList<Button> toLayout = new LinkedList<Button>();
    Button b;

    // playerCountLabel
    b = new Button(new Sprite(Assets.button), Assets.liberationMedium, "playerCount", Color.BLACK, Color.WHITE,
            Color.LIGHT_GRAY, Color.DARK_GRAY);
    b.addClickHandler(new ClickHandler() {
        @Override
        public void onClick() {
            increasePlayerCount();
        }
    });
    addGUIElement(b);
    playerCountLabel = b;
    toLayout.add(b);
    // scenarioInfLabel
    b = new Button(null, Assets.liberationSmall, "scenarioInfo", Color.WHITE, Color.WHITE, Color.LIGHT_GRAY,
            Color.DARK_GRAY);
    addGUIElement(b);
    scenarioInfoLabel = b;
    toLayout.add(b);
    // scenarioLabel
    b = new Button(new Sprite(Assets.button), Assets.liberationMedium, "scenarioName", Color.BLACK, Color.WHITE,
            Color.LIGHT_GRAY, Color.DARK_GRAY);
    b.addClickHandler(new ClickHandler() {
        @Override
        public void onClick() {
            nextScenario();
        }
    });
    addGUIElement(b);
    scenarioLabel = b;
    toLayout.add(b);
    // start game
    b = new Button(new Sprite(Assets.button), Assets.liberationMedium,
            Language.getStrings().get("menu.startGame"), Color.BLACK, Color.WHITE, Color.LIGHT_GRAY,
            Color.DARK_GRAY);
    b.addClickHandler(new ClickHandler() {
        @Override
        public void onClick() {
            prepareStart();
        }
    });
    addGUIElement(b);
    toLayout.add(b);
    // game name
    b = new Button(null, Assets.liberationLarge, Language.getStrings().get("game.name"), Color.ORANGE,
            Color.WHITE, Color.LIGHT_GRAY, Color.DARK_GRAY);
    addGUIElement(b);
    toLayout.add(b);

    layout(toLayout, 1, 5, 0, 0, 0, 0, 300, 60, 0, 30);

    toLayout.clear();
}