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

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

Introduction

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

Prototype

Color DARK_GRAY

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

Click Source Link

Usage

From source file:es.eucm.ead.mockup.core.view.ui.components.edition.FlagPanel.java

License:Open Source License

public FlagPanel(Skin skin) {
    super(skin);//from   w w  w .jav a 2s.c  o m

    setHeight(600);
    setWidth(600);

    setVisible(false);
    setModal(false);
    setColor(Color.DARK_GRAY);

    Table top = new Table(skin);
    Table bot = new Table(skin);

    top.defaults().pad(20);

    top.add("Panel de flags, selecciona uno").expandX().fill().center().top();
    top.row();
    top.add(new TextButton("Flag1", skin)).expandX().fill();
    top.add(new TextButton("LuzSala1", skin)).expandX().fill();
    top.add(new TextButton("LuzSala2", skin)).expandX().fill();

    top.row();
    top.add(new TextButton("Flag2", skin)).expandX().fill();
    top.add(new TextButton("Puerta1", skin)).expandX().fill();

    ScrollPane sp = new ScrollPane(top, skin);
    sp.setupFadeScrollBars(0f, 0f);
    sp.setScrollingDisabled(true, false);

    TextButton accept = new TextButton("Aceptar", skin);
    TextButton newAct = new TextButton("Nuevo FLAG", skin);

    bot.row();
    bot.add(accept).expandX().fill().left();
    bot.add(newAct).expandX().fill().right();

    this.add(top).expandY();
    this.row();
    this.add(bot);
}

From source file:exodus.Sosaria.java

@Override
public void create() {

    Exodus ult = new Exodus();
    ult.create();/*ww w.j av  a 2  s .  c  o m*/

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

    FileHandleResolver resolver = new Constants.ClasspathResolver();

    assets = new AssetManager(resolver);
    assets.load("assets/graphics/dirt.png", Texture.class);
    assets.load("assets/graphics/Stone_Masonry.jpg", Texture.class);
    assets.load("assets/graphics/door.png", Texture.class);
    assets.load("assets/graphics/mortar.png", Texture.class);
    assets.load("assets/graphics/rock.png", Texture.class);
    assets.load("assets/graphics/grass.png", Texture.class);

    assets.update(2000);

    environment = new Environment();
    environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.5f, 0.5f, 0.5f, 1f));

    camera = new PerspectiveCamera(67, Exodus.MAP_WIDTH, Exodus.MAP_HEIGHT);
    camera.near = 0.1f;
    camera.far = 1000f;

    Vector3 camPos = new Vector3(32, 6, 32);
    camera.position.set(camPos);
    camera.lookAt(camPos.x + 1, camPos.y, camPos.z);

    inputController = new CameraInputController(camera);
    inputController.rotateLeftKey = inputController.rotateRightKey = inputController.forwardKey = inputController.backwardKey = 0;
    inputController.translateUnits = 30f;

    Gdx.input.setInputProcessor(inputController);

    try {

        BaseMap map = Constants.Maps.AMBROSIA.getMap();

        for (int y = 0; y < map.getHeight(); y++) {
            for (int x = 0; x < map.getWidth(); x++) {
                Tile tile = map.getTile(x, y);
                ModelInstance instance = null;
                if (tile.getName().equals("mountains")) {
                    instance = createPolygonBox(Color.DARK_GRAY, 1, 2, 1, 0, x, 0, y);
                } else if (tile.getName().equals("hills")) {
                    instance = createPolygonBox(Color.GRAY, 1, 1, 1, 0, x, 0, y);
                } else if (tile.getName().equals("grass")) {
                    instance = createPolygonBox(Color.GREEN, 1, 1, 1, 0, x, 0, y);
                } else if (tile.getName().equals("water")) {
                    instance = createPolygonBox(Color.BLUE, 1, 1, 1, 0, x, 0, y);
                } else if (tile.getName().equals("sea")) {
                    instance = createPolygonBox(Color.NAVY, 1, 1, 1, 0, x, 0, y);
                } else if (tile.getName().equals("shallows")) {
                    instance = createPolygonBox(Color.SKY, 1, 1, 1, 0, x, 0, y);
                } else {
                    instance = createPolygonBox(Color.YELLOW, 1, 1, 1, 0, x, 0, y);
                }

                this.modelInstances.add(instance);

            }
        }

    } catch (Exception e) {
        e.printStackTrace();
    }

}

From source file:genuini.game.SkinManager.java

/**
 * Create a white button by default//from  w  ww. j  av a  2 s  .com
 *
 * @param width : text's width
 * @param height : text's height
 * @return skin : the button's skin
 */
public Skin createButtonSkin(int width, int height) {
    //text's creation 
    this.textSkin(Color.WHITE, false, width, height);

    //Create a button style
    TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
    textButtonStyle.up = skin.newDrawable("background", Color.WHITE);
    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);
    return skin;
}

From source file:genuini.game.SkinManager.java

/**
 * Create a button with parameters and the dark backgroud by default
 *
 * @param width : text's width//  www. ja  va2  s .  com
 * @param height : text's height
 * @param color : text's color
 * @param dark : 1 if the color is dark ; 0 if it's light
 * @return skin : the button's skin
 */
public Skin createButtonSkin(int width, int height, Color color, boolean dark) {
    //text's creation 
    this.textSkin(color, dark, width, height);

    //Create a button style
    TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
    textButtonStyle.up = skin.newDrawable("background", Color.WHITE);
    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);
    return skin;
}

From source file:genuini.screens.DeathMenu.java

@Override
public void buildStage() {
    menuButton = new TextButton("Menu", skinManager.createButtonSkin(buttonWidth, buttonHeight));
    menuButton.setPosition((V_WIDTH - buttonWidth) / 2 - 40, (V_HEIGHT - buttonHeight) / 2 - 50);

    stage.addActor(menuButton);/*from w  w w.  j a v a  2s . co m*/

    gameOver = new TextField("Game Over", skinManager.textFieldSkin(areaWidth, areaHeight, Color.WHITE, false,
            Color.CLEAR, Color.CLEAR, Color.DARK_GRAY, 1f));
    table = new Table();
    table.setSize(V_WIDTH, V_HEIGHT / 8);
    table.add(gameOver).width(200);
    table.setPosition(1, V_HEIGHT / 2);
    table.center();
    // table.align(Align.right | Align.bottom);
    if (debug) {
        table.debug();// Enables debug lines for tables.
    }
    stage.addActor(table);
}

From source file:genuini.screens.VictoryMenu.java

@Override
public void buildStage() {
    menuButton = new TextButton("Menu", skinManager.createButtonSkin(buttonWidth, buttonHeight));
    menuButton.setPosition((V_WIDTH - buttonWidth) / 2, (V_HEIGHT - buttonHeight) / 2 - 50);

    stage.addActor(menuButton);//  w ww .  j  a v  a 2s  .c  o m

    gameOver = new TextField("Congratulations, the demonstration is finished !", skinManager.textFieldSkin(
            buttonWidth, buttonHeight, Color.WHITE, false, Color.CLEAR, Color.CLEAR, Color.DARK_GRAY, 1f));
    table = new Table();
    table.setSize(V_WIDTH, V_HEIGHT / 8);
    table.add(gameOver).width(550);
    table.setPosition(1, V_HEIGHT / 2);
    table.center();
    // table.align(Align.right | Align.bottom);
    if (debug) {
        table.debug();// Enables debug lines for tables.
    }
    stage.addActor(table);
}

From source file:gui.screen.WinnerScreen.java

public WinnerScreen(ArrayList<Integer> playerPositions, final Game game, final Client client,
        final Server server) {
    super(game, client, server);

    //Set input and viewpoint
    stage = new Stage(new StretchViewport(Constants.SCREENWIDTH, Constants.SCREENHEIGHT));
    inputHandler.setInputSource(stage);//from  w  w w .ja  v  a2s . c  o m

    // Unhides the cursor
    Gdx.input.setCursorCatched(false);

    this.playerPositions = playerPositions;

    //Set background
    rootTable.background(new TextureRegionDrawable(new TextureRegion(TextureManager.hostBackground)));
    rootTable.setFillParent(true);
    stage.addActor(rootTable);

    //Initialise Font
    FreeTypeFontGenerator.FreeTypeFontParameter fontOptions = new FreeTypeFontGenerator.FreeTypeFontParameter();
    fontOptions.size = 11;
    BitmapFont font = TextureManager.menuFont.generateFont(fontOptions);

    /**------------------------LABEL STYLE------------------------**/
    Label.LabelStyle labelStyle = new Label.LabelStyle();
    fontOptions.size = 60;
    labelStyle.font = TextureManager.menuFont.generateFont(fontOptions);
    labelStyle.fontColor = Color.GOLD;

    /**------------------------PLAYER DISPLAY WIDGET------------------------**/
    //Table options
    Table table = new Table();
    table.setFillParent(true);

    //P1 spawn field
    p1Field = new Container();
    p1Field.background(
            new TextureRegionDrawable((TextureRegion) TextureManager.p1WalkingDownAnim.getKeyFrame(0)));
    table.add(p1Field).width(64).height(64);

    //P2 spawn field
    p2Field = new Container();
    p2Field.setVisible(false);
    p2Field.background(
            new TextureRegionDrawable((TextureRegion) TextureManager.p2WalkingDownAnim.getKeyFrame(0)));
    table.add(p2Field).width(64).height(64).padLeft(96);

    //P3 spawn field
    p3Field = new Container();
    p3Field.setVisible(false);
    p3Field.background(
            new TextureRegionDrawable((TextureRegion) TextureManager.p3WalkingDownAnim.getKeyFrame(0)));
    table.add(p3Field).width(64).height(64).padLeft(96);

    //P4 spawn field
    p4Field = new Container();
    p4Field.setVisible(false);
    p4Field.background(
            new TextureRegionDrawable((TextureRegion) TextureManager.p4WalkingDownAnim.getKeyFrame(0)));
    table.add(p4Field).width(64).height(64).padLeft(96);

    //Stage & group options
    joinedPlayerGroup.addActor(table);
    joinedPlayerGroup.setPosition(443, 150);
    stage.addActor(joinedPlayerGroup);

    /**------------------------PLAYER HIGHLIGHT WIDGET------------------------**/
    //Table options
    Table table2 = new Table();
    table2.setFillParent(true);

    //P1 spawn field
    p1FieldHighlight = new Container();
    p1FieldHighlight.setVisible(false);
    p1FieldHighlight.background(new TextureRegionDrawable(new TextureRegion(TextureManager.playerMarker)));
    table2.add(p1FieldHighlight).width(80).height(77);

    //P2 spawn field
    p2FieldHighlight = new Container();
    p2FieldHighlight.setVisible(false);
    p2FieldHighlight.background(new TextureRegionDrawable(new TextureRegion(TextureManager.playerMarker)));
    table2.add(p2FieldHighlight).width(80).height(77).padLeft(80);

    //P3 spawn field
    p3FieldHighlight = new Container();
    p3FieldHighlight.setVisible(false);
    p3FieldHighlight.background(new TextureRegionDrawable(new TextureRegion(TextureManager.playerMarker)));
    table2.add(p3FieldHighlight).width(80).height(77).padLeft(80);

    //P4 spawn field
    p4FieldHighlight = new Container();
    p4FieldHighlight.setVisible(false);
    p4FieldHighlight.background(new TextureRegionDrawable(new TextureRegion(TextureManager.playerMarker)));
    table2.add(p4FieldHighlight).width(80).height(77).padLeft(80);

    //Stage & group options
    playerhighlightWidget.addActor(table2);
    playerhighlightWidget.setPosition(442, 152);
    stage.addActor(playerhighlightWidget);

    /**------------------------LABELS------------------------**/

    // Titel
    titel = new Label("", labelStyle);
    titel.setAlignment(Align.center);
    titel.setPosition((Constants.SCREENWIDTH - titel.getWidth()) / 2 + 50, 385);
    stage.addActor(titel);

    // If you are the winner
    if (Constants.PLAYERID == playerPositions.get(playerPositions.size() - 1)) {
        titel.setText("YOU WON!");
        isWinner = true;
    } else {
        isWinner = false;
        titel.setText("YOU LOOSE!");
        titel.setColor(Color.RED);
    }

    if (-1 == playerPositions.get(playerPositions.size() - 1)) {
        titel.setText("DRAW!");
        titel.setColor(Color.DARK_GRAY);
        isWinner = false;
    }

    Table positionTable = new Table();
    positionTable.setFillParent(true);

    p1Position = new Label("", labelStyle);
    p1Position.setAlignment(Align.center);

    p2Position = new Label("", labelStyle);
    p2Position.setAlignment(Align.center);

    p3Position = new Label("", labelStyle);
    p3Position.setAlignment(Align.center);

    p4Position = new Label("", labelStyle);
    p4Position.setAlignment(Align.center);

    positionTable.add(p1Position).width(64).height(64);
    positionTable.add(p2Position).width(64).height(64).padLeft(96);
    positionTable.add(p3Position).width(64).height(64).padLeft(96);
    positionTable.add(p4Position).width(64).height(64).padLeft(96);

    positionPlayerWidget.addActor(positionTable);
    positionPlayerWidget.setPosition(443, 230);
    stage.addActor(positionPlayerWidget);

    /**------------------------MUSIC------------------------**/

    if (isWinner == false) {
        AudioManager.setCurrentMusic(AudioManager.getLooserMusic());
        AudioManager.getCurrentMusic().setLooping(true);
        AudioManager.getCurrentMusic().play();
        AudioManager.getCurrentMusic().setVolume(AudioManager.getMusicVolume() * 4);
    } else {
        AudioManager.setCurrentMusic(AudioManager.getWinnerMusic());
        AudioManager.getCurrentMusic().setLooping(true);
        AudioManager.getCurrentMusic().play();
        AudioManager.getCurrentMusic().setVolume(AudioManager.getMusicVolume() * 6);
    }

    /**------------------------BUTTONS------------------------**/
    TextButton.TextButtonStyle textButtonStyleBack = new TextButton.TextButtonStyle();
    textButtonStyleBack.font = font;
    textButtonStyleBack.up = backSkin.getDrawable("button_up");
    textButtonStyleBack.down = backSkin.getDrawable("button_down");
    textButtonStyleBack.over = backSkin.getDrawable("button_checked");

    // Back button
    backButton = new TextButton("", textButtonStyleBack);
    backButton.setPosition(0, Constants.SCREENHEIGHT - backButton.getHeight() + 7);
    stage.addActor(backButton);

    renderPlayers();

    //Add click listener --> Back button
    backButton.addListener(new ChangeListener() {
        @Override
        public void changed(ChangeListener.ChangeEvent event, Actor actor) {
            //Add click musik
            AudioManager.playClickSound();

            // Wait till sound is done
            try {
                Thread.sleep(100);

            } catch (InterruptedException ex) {

            }

            if (isWinner) {
                AudioManager.getCurrentMusic().stop();
            } else {
                AudioManager.getCurrentMusic().stop();
            }

            server.stopServer();
            game.setScreen(new MenuScreen(game, client, server));
        }
    });
}

From source file:halive.shootinoutside.menu.MainMenu.java

private void init() {
    float h = Gdx.graphics.getHeight();
    float w = Gdx.graphics.getWidth();
    stage = new Stage(new FitViewport(w, h));
    skin = new Skin(Gdx.files.internal(SKIN_PATH));

    Table mainTable = new Table(skin);

    mainTable.setColor(Color.DARK_GRAY);

    Image logo = new Image(new Texture(Gdx.files.internal(LOGO_PATH)));

    Button joinGameButton = new TextButton("Join Game", skin);
    Button hostGameButton = new TextButton("Host Game", skin);
    Button mapEditorButton = new TextButton("Map Editor", skin);
    Button aboutGameButton = new TextButton("About", skin);
    Button exitButton = new TextButton("Quit Game", skin);

    joinGameButton.addListener(new ClickHandler() {
        @Override//w ww.  j  av  a 2 s. c o  m
        public void onClicked(InputEvent evt, float x, float y) {
            joinGameClicked(evt, x, y);
        }
    });
    hostGameButton.addListener(new ClickHandler() {
        @Override
        public void onClicked(InputEvent evt, float x, float y) {
            hostGameClicked(evt, x, y);
        }
    });
    mapEditorButton.addListener(new ClickHandler() {
        @Override
        public void onClicked(InputEvent evt, float x, float y) {
            editorClicked(evt, x, y);
        }
    });
    aboutGameButton.addListener(new ClickHandler() {
        @Override
        public void onClicked(InputEvent evt, float x, float y) {
            showAboutDialog();
        }
    });
    exitButton.addListener(new ClickHandler() {
        @Override
        public void onClicked(InputEvent evt, float x, float y) {
            Gdx.app.exit();
        }
    });

    joinButton = joinGameButton;
    hostButton = hostGameButton;
    editorButton = mapEditorButton;

    mainTable.add(logo).padBottom(PADDING_BOTTOM).row();

    Button[] buttons = { joinGameButton, hostGameButton, editorButton, aboutGameButton, exitButton };
    for (int i = 0; i < buttons.length; i++) {
        mainTable.add(buttons[i]).size(BUTTON_WIDTH, BUTTON_HEIGHT).padBottom(PADDING_BOTTOM).row();
    }

    mainTable.setFillParent(true);

    stage.addActor(mainTable);
    Gdx.input.setInputProcessor(stage);
}

From source file:io.lonelyrobot.empires.client.screens.overlay.LoginStatusOverlay.java

License:Apache License

@Override
public void build() {
    label = new Label("Attempting to connect to server "/* + server.getName() */ + " with username '"
            + this.player.getName() + "'", Assets.R2_UI_SKIN);
    cancel = new TextButton("Aboard connect", Assets.R2_UI_SKIN);

    main.debug();/*from   ww  w.ja v a 2 s.  co m*/

    main.add(label).colspan(2).padBottom(150f);
    main.row();
    main.add(cancel).maxWidth(150);

    Skin skin = new Skin();
    Pixmap pixmap = new Pixmap(10, 10, Format.RGBA8888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();
    skin.add("white", new Texture(pixmap));

    TextureRegionDrawable textureBar = new TextureRegionDrawable(
            new TextureRegion(new Texture(Gdx.files.internal("barGreen_horizontalMid.png"))));
    ProgressBarStyle barStyle = new ProgressBarStyle(skin.newDrawable("white", Color.DARK_GRAY), textureBar);
    barStyle.knobBefore = barStyle.knob;
    bar = new ProgressBar(0, 100, 0.5f, false, barStyle);
    // bar.setFillParent(true);
    bar.setSize(400, bar.getPrefHeight());
    bar.setAnimateDuration(0.75f);

    main.add(bar).left().minWidth(400);
    main.center().setY(75f);
}

From source file:kyle.game.besiege.Faction.java

License:Open Source License

public static void initializeFactions(Kingdom kingdom) {
    factions = new Array<Faction>();

    factionRelations = new Array<Array<Integer>>();
    //      factionMilitaryAction = new Array<Array<Integer>>();

    // add player faction (index 0) 
    createFaction(PLAYER_FACTION);//from  w w  w  .  j av a 2s  .co m

    // add bandits faction (index 1)
    createFaction(BANDITS_FACTION);

    createFaction("Geinever", "crestWhiteLion", Color.DARK_GRAY);
    createFaction("Weyvel", "crestGreenTree", OLIVE);
    createFaction("Rolade", "crestOrangeCross", BROWN);
    createFaction("Myrnfar", "crestYellowStar", TAN);
    createFaction("Corson", "crestRedCross", RED);
    createFaction("Selven", "crestGreenStripe", GREEN);
    createFaction("Halmera", "crestBlueRose", BLUE);

    createFaction("Fernel", "crestBlank", Color.LIGHT_GRAY);
    createFaction("Draekal", "crestBlank", Color.MAGENTA);

    for (Faction f : factions) {
        f.kingdom = kingdom;
    }

    factions.get(2).declareWar(factions.get(3));

    //      factionRelations = new int[factionCount][factionCount];
    for (int i = 0; i < factionCount; i++) {
        for (int j = 0; j < factionCount; j++) {
            //            factionRelations[i][j] = -30;
            factionRelations.get(i).set(j, -30);
            factionRelations.get(j).set(i, -30);
        }
    }
    for (int i = 0; i < factionCount; i++) {
        //         factionRelations[i][i] = 100;
        factionRelations.get(i).set(i, 100);
    }
}