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

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

Introduction

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

Prototype

Color YELLOW

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

Click Source Link

Usage

From source file:com.johnogel.astrobros.levels.LevelOne.java

@Override
public void initialize() {

    this.initializeWorld();

    this.ray_handler = mngr.getRayHandler();
    this.world = mngr.getWorld();
    this.camera = mngr.getCamera();

    width = mngr.getWidth();/*from   w ww  . ja v  a  2 s.c  om*/
    height = mngr.getHeight();

    //this.ray_handler.dispose();

    //this.free_bros.add(new Player(world, camera, 1));
    //this.free_bros.add(new Player(world, camera, 120));
    //this.free_bros.add(new Player(world, camera, 100));
    //this.free_bros.add(new Player(world, camera, 50));
    //this.free_bros.add(new Player(world, camera, 60));
    this.free_bros.add(new Player(world, camera, 100));
    this.free_bros.add(new Player(world, camera, 150));
    //this.free_bros.add(new Player(world, camera, 80));
    //this.free_bros.add(new Player(world, camera, 50));

    //world.createJoint(joint_def);

    this.initializePlayer();
    this.initializeArrays();
    this.initializeContactListener();

    //adds sun to suns array without storing locally
    new Sun(this, suns, 8000, Color.YELLOW, 1000, width / 2, height / 2);

    suns.get(0).initializeTexture(texture_handler, TextureHandler.SUN);

    this.setOrbits();

    this.initializeBoundaries();
    this.initializeBackground();
    this.initializeLocators();

}

From source file:com.johnogel.astrobros.managers.screens.LevelLossScreen.java

@Override
public void initialize() {

    initializeWorld();//w w  w.  j  av a 2  s .co  m
    this.updateReferences();
    SoundPlayer sp = mngr.getSuperManager().getSoundPlayer();
    sp.setSong(SoundPlayer.BURNED_OUT);
    sp.setLooping(false);
    sp.setVolume(.9f);
    sp.playSong();
    new PointLight(ray_handler, 5000, Color.YELLOW, 500, -camera.viewportWidth / 2, -300);
    new PointLight(ray_handler, 5000, Color.YELLOW, 500, camera.viewportWidth / 2, -300);
    new PointLight(ray_handler, 5000, Color.YELLOW, 500, -camera.viewportWidth / 2, 300);
    new PointLight(ray_handler, 5000, Color.RED, 500, camera.viewportWidth / 2, 300);

}

From source file:com.jupiter.europa.screen.overlay.PauseMenu.java

License:Open Source License

private static void buildPauseMenuSkin() {
    Skin skin = new Skin();

    skin.add("button-font", EuropaGame.game.getAssetManager()
            .get(FileLocations.FONTS_DIRECTORY.resolve(BUTTON_FONT).toString()));
    skin.add("title-font", EuropaGame.game.getAssetManager()
            .get(FileLocations.FONTS_DIRECTORY.resolve(TITLE_FONT).toString()));

    // Set the background texture
    Pixmap pixmap = new Pixmap(1, (int) 1, Pixmap.Format.RGB888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();//from   w  w w.j  a v  a2  s .com
    skin.add("background", new Texture(pixmap));

    // Create a Label style for the title
    Label.LabelStyle titleStyle = new Label.LabelStyle();
    titleStyle.background = skin.newDrawable("background", TRANSPARENT);
    titleStyle.font = skin.getFont("title-font");
    titleStyle.fontColor = Color.BLACK;
    skin.add("default", titleStyle);

    //Create a button style
    TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
    textButtonStyle.up = skin.newDrawable("background", TRANSPARENT);
    textButtonStyle.down = skin.newDrawable("background", TRANSPARENT);
    textButtonStyle.checked = skin.newDrawable("background", TRANSPARENT);
    textButtonStyle.over = skin.newDrawable("background", TRANSPARENT);
    textButtonStyle.disabled = skin.newDrawable("background", TRANSPARENT);
    textButtonStyle.font = skin.getFont("button-font");
    textButtonStyle.fontColor = Color.TEAL;
    textButtonStyle.overFontColor = Color.YELLOW;
    textButtonStyle.disabledFontColor = Color.GRAY;
    textButtonStyle.pressedOffsetX = 2f;
    textButtonStyle.pressedOffsetY = -3f;
    skin.add("default", textButtonStyle);
    //        
    //        skin = EmergenceGame.game.getAssetManager().get(
    //                new File(FileLocations.SKINS_DIRECTORY, "main_menu.skin").getPath());
    pauseMenuSkin = skin;
}

From source file:com.kasetagen.game.bubblerunner.screen.BubbleRunnerMenu.java

License:Creative Commons License

private void assembleMenuGroup(TextureAtlas atlas) {

    infiniteLeftDecorator = new ActorDecorator() {
        @Override/*from   w  w w  . jav a2  s.  co  m*/
        public void applyAdjustment(Actor actor, float v) {
            if (actor.getRight() <= 0f) {
                actor.setPosition(actor.getX() + (actor.getWidth() * 2f), 0f);
            }
        }
    };

    checkedMenuOptionDecorator = new PulsingScaleDecorator(0.025f, 1f);

    float w = stage.getWidth();
    float h = stage.getHeight();
    //Add BG
    bgGroup.addActor(new GenericActor(0f, 0f, w, h, atlas.findRegion(AtlasUtil.ANI_TITLE_BG), Color.BLACK));

    GenericActor moon = new GenericActor(600f, 500f, MOON_WIDTH, MOON_HEIGHT,
            atlas.findRegion(AtlasUtil.ANI_TITLE_MOON), Color.YELLOW);
    moon.addDecorator(new ShakeDecorator(5f, 5f, 4f));
    moon.addDecorator(new OscillatingDecorator(5f, 10f, 2.5f));
    bgGroup.addActor(moon);
    //add Clouds5 setup
    addClouds(atlas.findRegion(AtlasUtil.ANI_TITLE_C5), -25f);

    //Add Skyline2
    bgGroup.addActor(
            new GenericActor(0f, 0f, w, h, atlas.findRegion(AtlasUtil.ANI_TITLE_SKYLINE2), Color.BLACK));

    //Add Cloud 4
    addClouds(atlas.findRegion(AtlasUtil.ANI_TITLE_C4), -25f);

    //Add Cloud 3
    addClouds(atlas.findRegion(AtlasUtil.ANI_TITLE_C3), -75f);

    //Add Skyline1
    bgGroup.addActor(
            new GenericActor(0f, 0f, w, h, atlas.findRegion(AtlasUtil.ANI_TITLE_SKYLINE1), Color.BLACK));

    //Add Title
    bgGroup.addActor(new GenericActor(150f, 25f, TITLE_WIDTH, TITLE_HEIGHT,
            atlas.findRegion(AtlasUtil.ANI_TITLE_TITLE), Color.WHITE));

    //Add Cloud 2
    addClouds(atlas.findRegion(AtlasUtil.ANI_TITLE_C2), -100);

    //Add Cloud 1
    addClouds(atlas.findRegion(AtlasUtil.ANI_TITLE_C1), -125f);

    //Add Platform
    menuGroup.addActor(
            new GenericActor(0f, 0f, w, h, atlas.findRegion(AtlasUtil.ANI_TITLE_PLATFORM), Color.BLACK));

    //Add Edison
    Animation eddyAni = new Animation(EDISON_CYCLE_RATE, atlas.findRegions(AtlasUtil.ANI_TITLE_EDISON));
    menuGroup.addActor(new AnimatedActor(0f, 0f, EDISON_WIDTH, EDISON_HEIGHT, eddyAni, 0f));
    //Add Edyn
    Animation edynAni = new Animation(EDYN_CYCLE_RATE, atlas.findRegions(AtlasUtil.ANI_TITLE_EDYN));
    menuGroup.addActor(new AnimatedActor(w - EDYN_WIDTH, 0f, EDYN_WIDTH, EDYN_HEIGHT, edynAni, 0f));

    Animation edynEyes = new Animation(EYE_CYCLE_RATE, atlas.findRegions(AtlasUtil.ANI_TITLE_EDYN_EYES));
    AnimatedActor eyes = new AnimatedActor(w - EDYN_WIDTH, 0f, EDYN_WIDTH, EDYN_HEIGHT, edynEyes, 0f);
    eyes.setIsLooping(false);
    eyes.addDecorator(new ActorDecorator() {
        private float secondsBeforeBlink = 0f;
        private float elapsedSeconds = 0f;
        private Random rand = new Random(System.currentTimeMillis());

        @Override
        public void applyAdjustment(Actor actor, float v) {
            AnimatedActor a = ((AnimatedActor) actor);

            if (a.isAnimationComplete()) {
                elapsedSeconds += v;
                if (elapsedSeconds >= secondsBeforeBlink) {
                    a.setState(AnimatedActor.DEFAULT_STATE, true);
                    elapsedSeconds = 0f;
                    secondsBeforeBlink = rand.nextInt(MAX_BLINK_INTERVAL) + MIN_BLINK_INTERVAL;
                }
            }
        }
    });

    menuGroup.addActor(eyes);

    Array<TextureAtlas.AtlasRegion> escapeImgs = atlas.findRegions(AtlasUtil.ANI_TITLE_PLAY_BTN);
    TextureRegionDrawable escapeUp = new TextureRegionDrawable(escapeImgs.get(0));
    TextureRegionDrawable escapeDown = new TextureRegionDrawable(escapeImgs.get(1));

    startGameButton = new ImageButton(escapeUp, escapeDown, escapeDown);
    startGameButton.setSize(PLAY_BTN_WIDTH, PLAY_BTN_HEIGHT);
    startGameButton.addListener(listener);
    //startGameButton.setPosition(buttonX, buttonY);
    startGameButton.setChecked(true);

    startUiContainer = new DecoratedUIContainer(startGameButton);
    startUiContainer.setSize(PLAY_BTN_WIDTH, PLAY_BTN_HEIGHT);
    startUiContainer.setPosition(buttonX, buttonY);
    startUiContainer.addDecorator(checkedMenuOptionDecorator);
    menuGroup.addActor(startUiContainer);

    Array<TextureAtlas.AtlasRegion> optionsImgs = atlas.findRegions(AtlasUtil.ANI_TITLE_OPT_BTN);
    TextureRegionDrawable optionsUp = new TextureRegionDrawable(optionsImgs.get(0));
    TextureRegionDrawable optionsDown = new TextureRegionDrawable(optionsImgs.get(1));
    optionsButton = new ImageButton(optionsUp, optionsDown, optionsDown);
    optionsButton.setSize(OPTS_BTN_WIDTH, OPTS_BTN_HEIGHT);

    //optionsButton.setPosition(buttonX, buttonY - (optionsButton.getHeight()));
    optionsButton.addListener(listener);
    optionsUiContainer = new DecoratedUIContainer(optionsButton);
    optionsUiContainer.setPosition(buttonX, buttonY - (PLAY_BTN_HEIGHT));
    optionsUiContainer.setSize(OPTS_BTN_WIDTH, OPTS_BTN_HEIGHT);
    //optUiContainer.addDecorator(checkedMenuOptionDecorator);
    menuGroup.addActor(optionsUiContainer);

    Array<TextureAtlas.AtlasRegion> hsImgs = atlas.findRegions(AtlasUtil.ANI_TITLE_HIGHSCORE_BTN);
    TextureRegionDrawable hsUp = new TextureRegionDrawable(hsImgs.get(0));
    TextureRegionDrawable hsDown = new TextureRegionDrawable(hsImgs.get(1));

    highScoreButton = new ImageButton(hsUp, hsDown, hsDown);
    highScoreButton.setSize(HS_BTN_WIDTH, HS_BTN_HEIGHT);
    highScoreButton.addListener(listener);

    highScoreUiContainer = new DecoratedUIContainer(highScoreButton);
    highScoreUiContainer.setSize(HS_BTN_WIDTH, HS_BTN_HEIGHT);
    highScoreUiContainer.setPosition(buttonX, optionsUiContainer.getY() - (PLAY_BTN_HEIGHT));
    menuGroup.addActor(highScoreUiContainer);
}

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

License:Creative Commons License

private Table createStep2Table() {
    Table stepTwo = new Table();
    stepTwo.add(new Label("Step Two", new Label.LabelStyle(boldFont, Color.GREEN))).padBottom(20f);
    stepTwo.row();//  w  w w  .  j  a  v a  2s .  c  om

    Label step2Message = new Label("Type the following into your phones web browser:",
            new Label.LabelStyle(font, Color.WHITE));
    step2Message.setWrap(true);
    step2Message.setAlignment(Align.center | Align.top);
    stepTwo.add(step2Message).width(700f);
    stepTwo.row();

    stepTwo.add(new Label(this.game.gcm.mcpConnectionAddress, new Label.LabelStyle(titleFont, Color.YELLOW)));

    if (this.game.gcm.usingMCPRocks) {
        stepTwo.row();

        Label step2Warning;
        if (this.game.gcm.useOptionButtonText) {
            step2Warning = new Label(
                    "Tip: Press " + this.game.gcm.topFaceButtonText + " to reveal the IP address",
                    new Label.LabelStyle(smallFont, Color.WHITE));
        } else {
            step2Warning = new Label("Tip: Click here to reveal the IP address",
                    new Label.LabelStyle(smallFont, Color.WHITE));
        }
        step2Warning.setWrap(true);
        step2Warning.setAlignment(Align.center | Align.top);
        stepTwo.add(step2Warning).width(600f);
    }

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

    stepTwo.addListener(new InputListener() {
        public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            game.gcm.toggleMCPAddressType();
            return true;
        }
    });

    return stepTwo;

}

From source file:com.mknsri.drunktoss.GameScreen.java

License:Open Source License

public void render() {
    batch.begin();//from  ww  w  .ja  v  a2  s.c om

    bg.drawBackground(this);
    factory.drawList(this);
    ilpo.render(this);

    batch.end();

    // Camera
    batch.setProjectionMatrix(ebingeimi.camera.combined);
    hudBatch.setProjectionMatrix(ebingeimi.hudCamera.combined);
    ebingeimi.camera.position.set(ilpo.x + 100, ilpo.y + 50, 0);

    // HUD drawing
    hudBatch.begin();

    // Tutorial drawing
    if (tutorialPos < 2) {
        if (tutorialPos == 0) {
            drawSpriteOnHUD(Art.tut1, 0, 0, 0);
        } else if (tutorialPos == 1) {
            drawSpriteOnHUD(Art.tut2, 0, 0, 0);
        }
    } else {
        // Distance
        drawStringOnHUD("Distance: " + Math.round(ilpo.getPoints() / 20) + "m", Color.YELLOW, 10,
                DrunkToss.VIEWPORT_HEIGHT - 10);

        // Game over
        if (gameOver == true) {
            int endPoints = (int) (ilpo.getPoints() / 20);
            drawSpriteOnHUD(Art.hiScoreScreen, 70, 40, 0);
            drawStringOnHUD(endPoints + "m", Color.YELLOW, 100, 160);
            int highScore = DrunkToss.prefs.getInteger("hiscore", 0);
            // New high score
            if (endPoints > highScore) {
                DrunkToss.prefs.putInteger("hiscore", endPoints);
                DrunkToss.prefs.flush();
                highScore = endPoints;
                drawStringOnHUD("(NEW!)", Color.YELLOW, 180, 100);
            }
            drawStringOnHUD(highScore + "m", Color.YELLOW, 100, 100);
            // Draw upload button
            drawSpriteOnHUD(uploadHiScoreBtn.bg, uploadHiScoreBtn.x, uploadHiScoreBtn.y, 0);
            drawSpriteOnHUD(Art.okB, 100, 50, 0);
            if (scoresUploaded == true) {
                drawStringOnHUD("Done!", Color.GREEN, 175, 100);
            }
        }

        // Game running
        else {

            // Start position
            if (!ilpo.launched) {
                drawSpriteOnHUD(Art.angle, 10, 90, launcher.getAngle() * 0.1f);
            } else {
            }
            // Fighting
            if (ilpo.fighting) {
                Color fc = Color.RED;
                if (ilpo.fightHealth < 30) {
                    fc = Color.RED;
                } else if (ilpo.fightHealth < 60) {
                    fc = Color.YELLOW;
                } else if (ilpo.fightHealth < 100) {
                    fc = Color.GREEN;
                }
                drawStringOnHUDCenter("TAP TO WIN THE FIGHT!", fc);
            }
        }
    }
    hudBatch.end();

}

From source file:com.mknsri.drunktoss.Menu.LeaderboardMenu.java

License:Open Source License

public void render() {
    batch.begin();/* www .  j av a2 s .com*/

    drawSprite(background, 0, 0, 0);
    drawSprite(personalBtn.bg, personalBtn.x, personalBtn.y, 0);
    drawSprite(weeklyBtn.bg, weeklyBtn.x, weeklyBtn.y, 0);
    drawSprite(allTimeBtn.bg, allTimeBtn.x, allTimeBtn.y, 0);
    drawSprite(okButton.bg, okButton.x, okButton.y, 0);

    if (loading) {
        if (!ldc.timedOut) {
            drawStringOnCenter("Loading, please wait...", Color.YELLOW);
        } else {
            drawStringOnCenter("Could not load scores", Color.YELLOW);
        }
    }
    if (scoreTable != null) {
        loading = false;
        for (int i = 0; i < 10; i++) {
            if (scoreTable[i][0] == null) {
                scoreTable[i][0] = "";
                scoreTable[i][1] = "";
                scoreTable[i][2] = "";
            }

            drawString(scoreTable[i][0] + "", Color.YELLOW, 60, 149 - (11 * i));
            drawString(scoreTable[i][1] + "", Color.YELLOW, 150, 149 - (11 * i));
            drawString(scoreTable[i][2] + "", Color.YELLOW, 220, 149 - (11 * i));
        }
    }

    batch.end();

    batch.setProjectionMatrix(ebingeimi.camera.combined);
    ebingeimi.cameraReset();

    hudBatch.begin();

    hudBatch.end();
}

From source file:com.mrlamont.Model.TitleScreen.java

public void render(float delta) {
    camera = new OrthographicCamera();
    viewport = new FitViewport(V_WIDTH, V_HEIGHT, camera);
    batch = new SpriteBatch();
    // clear the screen with black
    Gdx.gl20.glClearColor(0, 0, 0, 1);//from   ww  w .j  a va 2s . co m
    Gdx.gl20.glClear(GL20.GL_COLOR_BUFFER_BIT);
    g = new ShapeRenderer();
    batch = new SpriteBatch();
    g.begin(ShapeRenderer.ShapeType.Filled);
    g.setColor(Color.PURPLE);
    g.rect(550, 0, 110, 600);
    g.setColor(Color.BLUE);
    g.rect(440, 0, 110, 600);
    g.setColor(Color.GREEN);
    g.rect(330, 0, 110, 600);
    g.setColor(Color.YELLOW);
    g.rect(220, 0, 110, 600);
    g.setColor(Color.ORANGE);
    g.rect(110, 0, 110, 600);
    g.setColor(Color.RED);
    g.rect(0, 0, 110, 600);
    g.end();

    //draw different coloured Wheelys on screen
    batch.begin();
    batch.draw(AssetManager.wheelyYellow, 190, -1);
    batch.draw(AssetManager.wheelyOrange, 90, -1);
    batch.draw(AssetManager.wheelyRed, -14, -1);
    batch.draw(AssetManager.wheelyGreenL, 320, -1);
    batch.draw(AssetManager.wheelyBlueL, 420, -1);
    batch.draw(AssetManager.wheelyPurpleL, 520, -1);
    batch.end();

    //If a certain colour is left clicked, that colouro of Wheely is selected
    if (Gdx.input.isButtonPressed(Input.Buttons.LEFT)) {
        Vector3 mouseClick = new Vector3(Gdx.input.getX(), Gdx.input.getY(), 0);
        camera.unproject(mouseClick);
        System.out.println("x: " + mouseClick.x + "    y: " + mouseClick.y);
        //Red
        if (mouseClick.y >= -1 && mouseClick.y <= 0.991 && mouseClick.x >= -1 && mouseClick.x <= -0.6625) {
            red = true;
        }
        //Green
        if (mouseClick.y >= -1 && mouseClick.y <= 1 && mouseClick.x >= 0.034374952
                && mouseClick.x <= 0.36874998) {
            green = true;
        }
        //Orange
        if (mouseClick.y >= -1 && mouseClick.y <= 1 && mouseClick.x >= -0.653125
                && mouseClick.x <= -0.32187498) {
            orange = true;
        }
        //Yellow
        if (mouseClick.y >= -1 && mouseClick.y <= 1 && mouseClick.x >= -0.309375
                && mouseClick.x <= 0.024999976) {
            yellow = true;
        }
        //Blue
        if (mouseClick.y >= -1 && mouseClick.y <= 1 && mouseClick.x >= 0.37812495 && mouseClick.x <= 0.7125) {
            blue = true;
        }

        //Purple
        if (mouseClick.y >= -1 && mouseClick.y <= 1 && mouseClick.x >= 0.71875 && mouseClick.x <= 0.99375) {
            purple = true;
        }

    }

}

From source file:com.mygdx.end.GameEnd.java

@Override
public void create() {
    // background objects 

    stan = new Stan();

    Skin mSkin = new Skin(Gdx.files.internal("data/uiskin.json"));

    nick = new TextField("", mSkin);
    nick.setSize(200, 40);/*  w ww. j a va  2 s. c o m*/
    nick.setPosition(100, 200);
    nick.setVisible(false);

    nick.setTextFieldListener(new TextField.TextFieldListener() {

        @Override
        public void keyTyped(TextField textField, char key) {
            txtNick = textField.getText();
        }
    });

    bg0 = new PhysicsActor();
    bg0.storeAnimation("default", new Texture(Gdx.files.internal("smok/las.png")));
    bg0.setPosition(-390, -170);
    bg0.addAction(Actions.sequence(Actions.fadeOut(0)));

    mainStage.addActor(bg0);
    mainStage.addActor(nick);
    //napisy

    Napisy = new PhysicsActor();
    BitmapFont font = new BitmapFont();
    String text = "";

    LabelStyle style = new LabelStyle(font, Color.YELLOW);
    baseText = new Label(text, style);
    baseText.setX(110);
    baseText.setY(270);
    baseText.setFontScale(3, 3);

    mainStage.addActor(baseText);

    String text2 = "Enter nick name";
    TextNick = new Label(text2, style);
    TextNick.setX(100);
    TextNick.setY(270);
    TextNick.setFontScale(3, 3);
    TextNick.setVisible(false);

    mainStage.addActor(TextNick);

    String text3 = "Score Table";
    TextBoard = new Label(text3, style);
    TextBoard.setX(100);
    TextBoard.setY(520);
    TextBoard.setFontScale(3, 3);
    TextBoard.setVisible(false);

    mainStage.addActor(TextBoard);

    ////////////////////////////////////

    tablicaWynikow = new Wynik();
    //tablicaWynikow.wynikGracza(aabbcc);
    //System.out.println(aabbcc.getScoreString());

}

From source file:com.mygdx.environments.Environment.java

public Environment(int id) {
    world = new World(new Vector2(0.0f, 0.0f), true);
    world.setContactListener(new MainContactListener(this));

    this.id = id;

    //rng set/*from w w  w  .j a va2  s  .  c  o m*/
    rngNegSet.add(1);
    rngNegSet.add(-1);

    dmgFont = MainGame.FONT_DMG;
    dmgFont.setColor(Color.YELLOW);
    dmgFont.setScale(0.55f * RATIO);

}