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

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

Introduction

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

Prototype

Color GRAY

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

Click Source Link

Usage

From source file:com.kotcrab.vis.editor.ui.tab.StartPageTab.java

License:Apache License

public void rebuildRecentProjectList() {
    recentProjectListTable.clear();/*from ww w . jav  a2s. com*/
    recentProjectListTable.defaults().left();

    Array<RecentProjectEntry> recentProjects = recentProjectsModule.getRecentProjects();
    if (recentProjects.size == 0) {
        recentProjectListTable.add(new VisLabel("No recently opened projects", Color.GRAY));
    }

    for (RecentProjectEntry entry : recentProjects) {
        LinkLabel label = new LinkLabel(entry.name, entry.projectPath);
        new Tooltip.Builder(entry.projectPath).target(label).build();
        label.setListener(this);

        VisImageButton removeButton = new VisImageButton(styleProvider.transparentXButton());
        new Tooltip.Builder("Remove from list").target(removeButton).build();
        removeButton.setFocusBorderEnabled(false);
        removeButton.setVisible(false);
        removeButton.addListener(new ChangeListener() {
            @Override
            public void changed(ChangeEvent changeEvent, Actor actor) {
                recentProjectsModule.remove(entry);
                rebuildRecentProjectList();
            }
        });

        VisTable tableRow = new VisTable(false);
        tableRow.setTouchable(Touchable.enabled);
        tableRow.addListener(new InputListener() { // handle enter/exit events for show remove button
            @Override
            public void enter(InputEvent event, float x, float y, int pointer, Actor fromActor) {
                super.enter(event, x, y, pointer, fromActor);
                removeButton.setVisible(true);
            }

            @Override
            public void exit(InputEvent event, float x, float y, int pointer, Actor toActor) {
                super.exit(event, x, y, pointer, toActor);
                removeButton.setVisible(false);
            }
        });

        tableRow.add(label).left();
        tableRow.add().growX();
        tableRow.add(removeButton).padLeft(8).right();
        recentProjectListTable.add(tableRow).growX().row();
    }

    if (recentProjects.size > 0) {
        LinkLabel clearListLink = new LinkLabel("Clear List", CLEAR_RECENT_PROJECTS_LIST);
        clearListLink.setListener(this);
        recentProjectListTable.add(clearListLink).padTop(8);
    }
}

From source file:com.kotcrab.vis.ui.widget.MenuItem.java

License:Apache License

@Override
public void draw(Batch batch, float parentAlpha) {
    Color fontColor;/*from w  w w.jav  a  2 s. co  m*/
    if (isDisabled() && style.disabledFontColor != null)
        fontColor = style.disabledFontColor;
    else if (isPressed() && style.downFontColor != null)
        fontColor = style.downFontColor;
    else if (isChecked() && style.checkedFontColor != null)
        fontColor = (isOver() && style.checkedOverFontColor != null) ? style.checkedOverFontColor
                : style.checkedFontColor;
    else if (isOver() && style.overFontColor != null)
        fontColor = style.overFontColor;
    else
        fontColor = style.fontColor;
    if (fontColor != null)
        label.getStyle().fontColor = fontColor;

    if (isDisabled())
        shortcutLabel.getStyle().fontColor = style.disabledFontColor;
    else
        shortcutLabel.getStyle().fontColor = shortcutLabelColor;

    if (image != null && generateDisabledImage) {
        if (isDisabled())
            image.setColor(Color.GRAY);
        else
            image.setColor(Color.WHITE);
    }

    super.draw(batch, parentAlpha);
}

From source file:com.kotcrab.vis.ui.widget.VisImageButton.java

License:Apache License

private void updateImage() {
    Drawable drawable = null;//from  ww  w .j a  v a 2 s  . c  om
    if (isDisabled() && style.imageDisabled != null)
        drawable = style.imageDisabled;
    else if (isPressed() && style.imageDown != null)
        drawable = style.imageDown;
    else if (isChecked() && style.imageChecked != null)
        drawable = (style.imageCheckedOver != null && isOver()) ? style.imageCheckedOver : style.imageChecked;
    else if (isOver() && style.imageOver != null)
        drawable = style.imageOver;
    else if (style.imageUp != null) //
        drawable = style.imageUp;
    image.setDrawable(drawable);

    if (generateDisabledImage && style.imageDisabled == null && isDisabled())
        image.setColor(Color.GRAY);
    else
        image.setColor(Color.WHITE);
}

From source file:com.ladinc.core.screens.GameScreenLobby.java

License:Creative Commons License

private Table displayCredits() {
    Table creditsTable = new Table();

    Image card = new Image(creditsSprite.getTexture());
    creditsTable.background(card.getDrawable());

    //creditsTable.background(credits);

    creditsTable.add(new Label("Credits", new Label.LabelStyle(titleFont, Color.ORANGE))).padBottom(20f);
    creditsTable.row();//from  w w  w  .  j av a 2 s .  c  o m
    creditsTable.add(new Label("Developers", new Label.LabelStyle(smallFont, Color.GREEN)));
    creditsTable.row();
    creditsTable.add(new Label("Brian Lough", new Label.LabelStyle(smallFont, Color.WHITE)));
    creditsTable.row();
    creditsTable.add(new Label("Kieran Nestor", new Label.LabelStyle(smallFont, Color.WHITE)));
    creditsTable.row();
    creditsTable.add(new Label("Gary Cregan", new Label.LabelStyle(smallFont, Color.WHITE)));
    creditsTable.row();
    creditsTable.add(new Label("Paul O'Flaherty", new Label.LabelStyle(smallFont, Color.WHITE)));

    creditsTable.row();
    creditsTable.add(new Label("Artwork", new Label.LabelStyle(smallFont, Color.GREEN))).padTop(30f);
    creditsTable.row();
    creditsTable.add(new Label("Buttons & Icons - kenney.nl", new Label.LabelStyle(smallFont, Color.WHITE)));
    creditsTable.row();
    creditsTable.add(new Label("Background (Modified) - laurakerbyson.com",
            new Label.LabelStyle(smallFont, Color.WHITE)));
    creditsTable.row();
    creditsTable.add(new Label("Written In Libgdx", new Label.LabelStyle(smallFont, Color.WHITE))).padTop(30f);
    creditsTable.row();

    creditsTable
            .add(new Label("Source Code of Game availalbe at:", new Label.LabelStyle(smallFont, Color.WHITE)))
            .padTop(25f);
    creditsTable.row();
    creditsTable.add(new Label("mcp.rocks/mao", new Label.LabelStyle(smallFont, Color.WHITE)));
    creditsTable.row();
    creditsTable.add(new Label("CAH cards used under the Creative Commons License",
            new Label.LabelStyle(smallFont, Color.WHITE))).padTop(25f);
    creditsTable.row();

    if (closeCreditsButton == null) {

        TextButtonStyle style = new TextButtonStyle(); //** Button properties **//
        style.up = buttomDrawable;
        style.down = buttomPressedDrawable;
        style.font = smallFont;
        style.fontColor = Color.GRAY;

        String buttonText = "Close";

        if (this.game.gcm.useOptionButtonText) {
            buttonText = buttonText + " " + this.game.gcm.backButtonText;
        }

        closeCreditsButton = new TextButton(buttonText, style);

        closeCreditsButton.setBounds(closeCreditsButton.getX(), closeCreditsButton.getY(),
                closeCreditsButton.getWidth(), closeCreditsButton.getHeight());

        closeCreditsButton.addListener(new InputListener() {
            public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
                displayCredits = false;
                return true;
            }
        });

        closeCreditsButton.padLeft(8f);
        closeCreditsButton.padRight(8f);
        closeCreditsButton.padTop(5f);
        closeCreditsButton.padBottom(5f);
    }

    creditsTable.add(closeCreditsButton).padTop(30f).padBottom(20f);

    creditsTable.setPosition(screenWidth / 2 - creditsSprite.getWidth() / 2,
            screenHeight / 2 - creditsSprite.getHeight() / 2);

    //creditsSprite.setPosition(screenWidth/2 - creditsSprite.getWidth()/2, screenHeight/2 -  creditsSprite.getHeight()/2);

    //      spriteBatch.begin();
    //      creditsSprite.draw(spriteBatch);
    //      creditsTable.draw(spriteBatch, 1);
    //      spriteBatch.end();

    creditsTable.pack();

    return creditsTable;
}

From source file:com.ladinc.core.screens.GameScreenLobby.java

License:Creative Commons License

private void createBottomRow(Table table) {
    Table bottomTable = table;//from   w  ww  .  j  a  va 2  s  . c om
    String text;

    if (creditsButton == null) {
        TextButtonStyle style = new TextButtonStyle(); //** Button properties **//
        style.up = buttomDrawable;
        style.down = buttomPressedDrawable;
        style.font = smallFont;
        style.fontColor = Color.GRAY;

        String buttonText = "Credits";

        if (this.game.gcm.useOptionButtonText) {
            buttonText = buttonText + " " + this.game.gcm.leftFaceButtonText;
        }

        creditsButton = new TextButton(buttonText, style);

        creditsButton.setBounds(creditsButton.getX(), creditsButton.getY(), creditsButton.getWidth(),
                creditsButton.getHeight());

        creditsButton.addListener(new InputListener() {
            public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
                displayCredits = true;
                return true;
            }
        });

        creditsButton.padLeft(8f);
        creditsButton.padRight(8f);
        creditsButton.padTop(5f);
        creditsButton.padBottom(5f);
    }

    if (this.game.players.size() < 3) {
        text = "Waiting for players to connect ( " + (3 - this.game.players.size()) + " more needed )";
    } else {
        text = "Ready to start";
    }
    bottomTable.add(new Label(text, new Label.LabelStyle(font, Color.WHITE))).padBottom(70f);
    bottomTable.add(creditsButton).align(Align.top).padTop(10f);
}

From source file:com.laststandstudio.space.Levels.Menus.MainMenu.java

License:Open Source License

public MainMenu(Game game) {
    super(game);/*from www  . j a va 2 s .  com*/
    SpaceShooter.mode = SpaceShooter.GameMode.MENU_MAIN;
    SpaceShooter.logger.logDebug("Main Menu: Creating Main Menu Screen");
    this.batch = new SpriteBatch();
    this.titleFont = super.loadFont("fonts/Gtek_Technology_free.ttf", (Gdx.graphics.getHeight() / 12));
    SpaceShooter.logger.logDebug("Main Menu: Creating Button Tables & Fonts");
    this.menuFont = new BitmapFont();
    this.pixmap = new Pixmap((Gdx.graphics.getWidth() / 2) - (Gdx.graphics.getWidth() / 10),
            (Gdx.graphics.getHeight() / 12), Pixmap.Format.RGB888);
    this.skin = new Skin();
    this.stage = new Stage();
    this.table = new Table();
    this.labelStyle = new Label.LabelStyle(titleFont, Color.BLACK);
    this.textButtonStyle = new TextButton.TextButtonStyle();

    skin.add("default", menuFont);
    pixmap.setColor(Color.MAROON);
    pixmap.fill();
    skin.add("background", new Texture(pixmap));

    SpaceShooter.logger.logDebug("Main Menu: Building Button Style");
    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);

    SpaceShooter.logger.logDebug("Main Menu: Building Buttons");
    this.title = new Label("space shooter", labelStyle);
    this.btnSinglePlayer = new TextButton("Single Player", skin);
    this.btnMultiplayer = new TextButton("Multiplayer", skin);
    this.btnOptions = new TextButton("Options", skin);
    this.btnTexturePacks = new TextButton("Texture Packs", skin);
    this.btnMods = new TextButton("Mods", skin);
    this.btnExit = new TextButton("Exit", skin);
}

From source file:com.mygdx.game.screens.GameChooserScreen.java

private void create() {
    //Create a font
    BitmapFont font = new BitmapFont();
    skin = new Skin();
    skin.add("default", font);

    //Create a texture
    Pixmap pixmap = new Pixmap((int) Gdx.graphics.getWidth() / 4, (int) Gdx.graphics.getHeight() / 10,
            Pixmap.Format.RGB888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();/* w w  w .j  a  v a 2 s.  c  om*/
    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);
}

From source file:com.mygdx.gui.UpgradeButton.java

@Override
public void draw(Batch batch, float parentAlpha) {
    sprite.setColor(MYGDXGAME.game.moneys >= price ? Color.WHITE : Color.GRAY);
    if (sprite != null) {
        sprite.setSize(width, height);/*from w w  w .  j a v a 2  s  .co m*/
        sprite.setCenterX(x);
        sprite.setCenterY(y);
        sprite.setAlpha(parentAlpha);
        sprite.draw(batch, parentAlpha);
        if (mess != null) {
            MYGDXGAME.game.draw(batch, mess, x - 40, y + getHeight() / 2 - 20, Color.BLACK,
                    Game.fontSizes.STANDART);
        }
    }
    if (desc != null)
        MYGDXGAME.game.draw(batch, desc, x - getWidth() / 2 + 30, y + getHeight() / 2 - 60, Color.BLACK,
                Game.fontSizes.STANDART);
    MYGDXGAME.game.draw(batch, "$" + price, x - getWidth() / 2 + 30, y + getHeight() / 2 - 100, Color.RED,
            Game.fontSizes.STANDART);
}

From source file:com.mygdx.screen.CreaMenu.java

private void createBasicSkin() {
    //Create a font

    skin = new Skin();
    skin.add("default", font);

    //Create a texture
    Pixmap pixmap = new Pixmap((int) Gdx.graphics.getWidth() / 4, (int) Gdx.graphics.getHeight() / 10,
            Pixmap.Format.RGB888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();/*from   w  w  w .  j av  a 2s.  com*/
    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);

}

From source file:com.talas777.ZombieLord.Menu.java

License:Open Source License

public void draw(SpriteBatch batch) {
    int posx = 355;
    int posy = 313;
    switch (currentWindow) {

    case WINDOW_MAIN:
        drawParty(batch, 1, false);//w  ww .  j  a va  2 s .c  om
        ninePatch.draw(batch, posx - 55, posy - 7 * lineSpace, 180, 7 * lineSpace + 5);
        font.setColor(Color.WHITE);
        font.draw(batch, "Item", posx, posy - 0 * lineSpace);
        font.draw(batch, "Character", posx, posy - 1 * lineSpace);
        font.setColor(Color.GRAY);
        font.draw(batch, "Magic", posx, posy - 2 * lineSpace);
        font.setColor(Color.WHITE);
        font.draw(batch, "Quest", posx, posy - 3 * lineSpace);
        font.setColor(Color.GRAY);
        font.draw(batch, "Save", posx, posy - 4 * lineSpace);
        font.draw(batch, "Option", posx, posy - 5 * lineSpace);
        font.setColor(Color.WHITE);
        font.draw(batch, "Quit", posx, posy - 6 * lineSpace);
        cursor.setX(posx - 40);
        cursor.setY(posy - 2 - lineSpace - selectedOption * lineSpace);
        cursor.draw(batch);

        break;
    case OPTION_USE_ITEM:
    case WINDOW_ITEM:
        drawParty(batch, 0, true);
        int numItems = Math.min(party.getInventory().getNumItems(), 16);
        posx = 265;
        ninePatch.draw(batch, posx - 85, posy - numItems * lineSpace, 280, numItems * lineSpace + 5);
        int j = 0;
        for (Item i : party.getInventory().getItems()) {
            font.setColor(Color.GRAY);
            if (i instanceof ConsumeableItem) {
                ConsumeableItem it = (ConsumeableItem) i;
                if (it.nonCombatAllowed())
                    font.setColor(Color.WHITE);
            }
            font.draw(batch, party.getInventory().getItemCount(i) + "x " + i.name, posx - 50,
                    posy - lineSpace * j);
            j++;
        }
        if (this.selectedItem == null) {
            cursor.setX(posx - 40 - 45);
            cursor.setY(posy - 2 - lineSpace - selectedOption * lineSpace);
            cursor.draw(batch);
        } else {
            cursor.setX(posx - 40 - 45);
            cursor.setY(posy - 2 - lineSpace - this.selectedItemNumber * lineSpace);
            cursor.draw(batch);

            cursor.setX(40);
            cursor.setY(posy - 20 - lineSpace - this.selectedOption * 100);
            cursor.draw(batch);
        }
        break;
    case WINDOW_CHARACTER:
        drawParty(batch, 2, true);
        break;
    case WINDOW_QUEST:
        posx = 135;
        posy = 200;
        font.draw(batch, "Current Objective: ", posx, posy + lineSpace);
        font.draw(batch, this.questHint, posx, posy);
    }

}