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

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

Introduction

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

Prototype

Color BLACK

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

Click Source Link

Usage

From source file:scenes.SplashScreen.java

@Override
public void create() {
    layout = new GlyphLayout();
    batch = new SpriteBatch();

    //initialize fonts
    FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/MunroSmall.ttf"));
    FreeTypeFontParameter parameter = new FreeTypeFontParameter();
    parameter.size = 60;/*from  ww w.jav a2  s.com*/
    font60 = generator.generateFont(parameter); // font size 12 pixels
    font60.setColor(Color.BLACK);
    parameter.size = 40;
    font30 = generator.generateFont(parameter); // font size 12 pixels
    font30.setColor(0.38f, 0.38f, 0.38f, 1f);
    generator.dispose(); // don't forget to dispose to avoid memory leaks!

    fade = new FontFade(font30);
    Gdx.input.setInputProcessor(new InputAdapter() {

        @Override
        public boolean keyDown(int keyCode) {
            Config.page = new EnterName();
            return true;
        }
    });
}

From source file:screens.EndScreen.java

public EndScreen(Application game, int[] scores) {
    this.batch = new SpriteBatch();
    this.game = game;
    this.camera = new OrthographicCamera();
    this.camera.setToOrtho(false, 1920, 1080);
    this.scores = scores;

    font = new BitmapFont();
    font.getData().setScale(3);//from  w  w  w  . j ava  2s .c o  m
    font.setColor(com.badlogic.gdx.graphics.Color.BLACK);

    mainSwitch = 0;

    level = "" + scores[0];
    enemiesKilled = "" + scores[1];
    time = scores[2] + " s";

    score = ((scores[0] * 3) + scores[1]) * 10;
    finalScore = "" + score;

    prefs = Gdx.app.getPreferences("myPreference");
    bestLevel = prefs.getInteger("Level", Integer.MAX_VALUE);
    bestEnemy = prefs.getInteger("Enemy", Integer.MAX_VALUE);
    bestTime = prefs.getInteger("Time", Integer.MAX_VALUE);
    bestScore = prefs.getInteger("Final Score", Integer.MAX_VALUE);
}

From source file:se.angergard.game.util.BasicGUI.java

License:Apache License

public void init() {
    stage = new Stage(new ScreenViewport());
    Gdx.input.setInputProcessor(stage);/*from w  ww .jav a 2s .  co m*/

    mainTable = new Table();
    mainTable.setBounds(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());

    stage.addActor(mainTable);

    font = new BitmapFont(Gdx.files.internal("font2.fnt"));

    blueTextButtonStyle = new TextButtonStyle();
    blueTextButtonStyle.up = TextureUtils.createDrawable(new Color(52f / 255f, 73f / 255f, 94f / 255f, 1.0f),
            300, 75);
    blueTextButtonStyle.down = TextureUtils.createDrawable(new Color(44f / 255f, 62f / 255f, 80f / 255f, 1.0f),
            300, 75);
    blueTextButtonStyle.over = TextureUtils.createDrawable(new Color(60f / 255f, 84f / 255f, 108f / 255f, 1.0f),
            300, 75);
    blueTextButtonStyle.font = font;
    blueTextButtonStyle.fontColor = Color.BLACK;

    labelStyle = new LabelStyle();
    labelStyle.background = blueTextButtonStyle.up;
    labelStyle.font = font;
    labelStyle.fontColor = Color.WHITE;
}

From source file:seventh.client.gfx.Art.java

License:Open Source License

/**
 * Loads the graphics//from w w w. j a  v a  2 s. co m
 */
public static void load() {
    {
        Pixmap map = TextureUtil.createPixmap(128, 128);
        map.setColor(Color.BLACK);
        map.fillRectangle(0, 0, map.getWidth(), map.getHeight());
        BLACK_IMAGE.setTexture(new Texture(map));
    }

    shotgunImage = loadImage("./assets/gfx/weapons/m3.bmp", 0xff00ff);
    rpgImage = loadImage("./assets/gfx/weapons/rpg.bmp", 0xff00ff);

    //        Pixmap grenadePixmap = loadPixmap("./assets/gfx/weapons/grenade.png");
    //        grenadeImage = TextureUtil.tex(TextureUtil.resizePixmap(grenadePixmap, 12, 12));
    //        grenadeIcon = TextureUtil.tex(grenadePixmap);

    fragGrenadeImage = loadImage("./assets/gfx/weapons/frag_grenade.png");
    fragGrenadeIcon = TextureUtil.resizeImage(fragGrenadeImage, 12, 12);

    smokeGrenadeImage = loadImage("./assets/gfx/weapons/smoke_grenade.png");
    smokeGrenadeIcon = TextureUtil.resizeImage(smokeGrenadeImage, 12, 12);

    springfieldImage = loadImage("./assets/gfx/weapons/springfield.bmp", 0xff00ff);
    thompsonImage = loadImage("./assets/gfx/weapons/thompson.bmp", 0xff00ff);
    m1GarandImage = loadImage("./assets/gfx/weapons/m1garand.bmp", 0xff00ff);
    kar98Image = loadImage("./assets/gfx/weapons/kar98.bmp", 0xff00ff);
    mp44Image = loadImage("./assets/gfx/weapons/mp44.bmp", 0xff00ff);
    mp40Image = loadImage("./assets/gfx/weapons/mp40.bmp", 0xff00ff);
    pistolImage = loadImage("./assets/gfx/weapons/pistol.bmp", 0xff00ff);
    riskerImage = loadImage("./assets/gfx/weapons/risker.bmp", 0xff00ff);
    flameThrowerImage = loadImage("./assets/gfx/weapons/flame_thrower.bmp", 0xff00ff);

    bombImage = loadImage("./assets/gfx/weapons/bomb.bmp", 0xff00ff);
    bombImage.flip(false, true);
    radioImage = loadImage("./assets/gfx/entities/radio.png");

    alliedBodyModel = new Model(loadImage("./assets/gfx/player/allied_positions.png"), 201, 256, 3, 3);
    alliedWalkModel = new Model(loadImage("./assets/gfx/player/allied_legs_walk.png"), 372, 196, 2, 4);
    alliedSprintModel = new Model(loadImage("./assets/gfx/player/allied_legs_sprint.png"), 256, 190, 2, 3);
    alliedCrouchLegs = loadImage("./assets/gfx/player/allied_crouch_legs.png");

    axisBodyModel = new Model(loadImage("./assets/gfx/player/axis_positions.png"), 201, 256, 3, 3);
    axisWalkModel = new Model(loadImage("./assets/gfx/player/axis_legs_walk.png"), 372, 196, 2, 4);
    axisSprintModel = new Model(loadImage("./assets/gfx/player/axis_legs_sprint.png"), 256, 190, 2, 3);
    axisCrouchLegs = loadImage("./assets/gfx/player/axis_crouch_legs.png");

    shotgunIcon = loadImage("./assets/gfx/weapons/shotgun_icon.png");
    rocketIcon = loadImage("./assets/gfx/weapons/rpg_icon.png");
    springfieldIcon = loadImage("./assets/gfx/weapons/springfield_icon.png");
    thompsonIcon = loadImage("./assets/gfx/weapons/thompson_icon.png");
    m1GarandIcon = loadImage("./assets/gfx/weapons/m1garand_icon.png");
    kar98Icon = loadImage("./assets/gfx/weapons/kar98_icon.png");
    mp44Icon = loadImage("./assets/gfx/weapons/mp44_icon.png");
    mp40Icon = loadImage("./assets/gfx/weapons/mp40_icon.png");
    pistolIcon = loadImage("./assets/gfx/weapons/pistol_icon.png");
    riskerIcon = loadImage("./assets/gfx/weapons/risker_icon.png");
    flameThrowerIcon = loadImage("./assets/gfx/weapons/flame_thrower_icon.png");

    explosionImage = TextureUtil.splitImage(loadImage("./assets/gfx/particles/explosion.png"), 4, 4);
    TextureRegion tmp = loadImage("./assets/gfx/fire.png");
    tmp.flip(false, false);
    fireImage = TextureUtil.splitImage(tmp, 1, 5);
    rocketImage = TextureUtil.splitImage(loadImage("./assets/gfx/weapons/rocket.bmp", 0xff00ff), 1, 1);

    deathsImage = loadImage("./assets/gfx/player/death_symbol.png");

    alliedBackDeathImage = TextureUtil.splitImage(
            TextureUtil.subImage(loadImage("./assets/gfx/player/allied_death_01.png"), 0, 0, 300, 210), 2, 4);
    alliedBackDeath2Image = TextureUtil.splitImage(
            TextureUtil.subImage(loadImage("./assets/gfx/player/allied_death_03.png"), 0, 0, 260, 290), 2, 3);
    alliedFrontDeathImage = TextureUtil.splitImage(
            TextureUtil.subImage(loadImage("./assets/gfx/player/allied_death_02.png"), 0, 0, 330, 190), 2, 6);
    alliedExplosionDeathImage = TextureUtil.splitImage(
            TextureUtil.subImage(loadImage("./assets/gfx/player/allied_death_04.png"), 0, 0, 330, 290), 2, 4);

    axisBackDeathImage = TextureUtil.splitImage(
            TextureUtil.subImage(loadImage("./assets/gfx/player/axis_death_01.png"), 0, 0, 300, 210), 2, 4);
    axisBackDeath2Image = TextureUtil.splitImage(
            TextureUtil.subImage(loadImage("./assets/gfx/player/axis_death_03.png"), 0, 0, 260, 290), 2, 3);
    axisFrontDeathImage = TextureUtil.splitImage(
            TextureUtil.subImage(loadImage("./assets/gfx/player/axis_death_02.png"), 0, 0, 330, 190), 2, 6);
    axisExplosionDeathImage = TextureUtil.splitImage(
            TextureUtil.subImage(loadImage("./assets/gfx/player/axis_death_04.png"), 0, 0, 330, 290), 2, 4);

    //        bloodImages = TextureUtil.splitImage(                
    //                TextureUtil.subImage(loadImage("./assets/gfx/particles/blood.png"), 0, 0, 128, 32), 1, 4);
    bloodImages = TextureUtil.splitImage(loadImage("./assets/gfx/particles/blood.png"), 2, 3);
    gibImages = TextureUtil.splitImage(loadImage("./assets/gfx/particles/gibs.png"), 2, 2);

    smokeImage = loadImage("./assets/gfx/particles/smoke.png");

    // tankImage = loadImage("./assets/gfx/tank.png");

    final int smallIconWidth = 64, smallIconHeight = 32;
    smallAssaultRifleIcon = TextureUtil.resizeImage(thompsonIcon, smallIconWidth, smallIconHeight);
    smallShotgunIcon = TextureUtil.resizeImage(shotgunIcon, smallIconWidth, smallIconHeight);
    smallRocketIcon = TextureUtil.resizeImage(rocketIcon, smallIconWidth, smallIconHeight);
    smallSniperRifleIcon = TextureUtil.resizeImage(springfieldIcon, smallIconWidth, smallIconHeight);
    smallM1GarandIcon = TextureUtil.resizeImage(m1GarandIcon, smallIconWidth, smallIconHeight);
    smallFragGrenadeIcon = TextureUtil.resizeImage(fragGrenadeImage, smallIconWidth / 3, smallIconHeight / 3);
    smallSmokeGrenadeIcon = TextureUtil.resizeImage(fragGrenadeImage, smallIconWidth / 3, smallIconHeight / 3);
    smallExplosionIcon = TextureUtil.resizeImage(explosionImage[0], smallIconWidth / 2, smallIconHeight / 2);
    smallkar98Icon = TextureUtil.resizeImage(kar98Icon, smallIconWidth, smallIconHeight);
    smallmp44Icon = TextureUtil.resizeImage(mp44Icon, smallIconWidth, smallIconHeight);
    smallmp40Icon = TextureUtil.resizeImage(mp40Icon, smallIconWidth, smallIconHeight);
    smallPistolIcon = TextureUtil.resizeImage(pistolIcon, smallIconWidth, smallIconHeight);
    smallRiskerIcon = TextureUtil.resizeImage(riskerIcon, smallIconWidth, smallIconHeight);
    smallFlameThrowerIcon = TextureUtil.resizeImage(flameThrowerIcon, smallIconWidth, smallIconHeight);

    cursorImg = loadImage("./assets/gfx/ui/menu_cursor.png");
    reticleImg = loadImage("./assets/gfx/ui/reticle.png");

    thompsonMuzzleFlash = TextureUtil.splitImage(loadImage("./assets/gfx/weapons/thompson_muzzle_flash.png"), 2,
            2);
    springfieldMuzzleFlash = TextureUtil
            .splitImage(loadImage("./assets/gfx/weapons/springfield_muzzle_flash.png"), 2, 2);
    m1GarandMuzzleFlash = TextureUtil.splitImage(loadImage("./assets/gfx/weapons/m1garand_muzzle_flash.png"), 2,
            2);
    kar98MuzzleFlash = TextureUtil.splitImage(loadImage("./assets/gfx/weapons/kar98_muzzle_flash.png"), 2, 2);
    mp40MuzzleFlash = TextureUtil.splitImage(loadImage("./assets/gfx/weapons/mp40_muzzle_flash.png"), 2, 2);
    mp44MuzzleFlash = TextureUtil.splitImage(loadImage("./assets/gfx/weapons/mp44_muzzle_flash.png"), 2, 2);
    shotgunMuzzleFlash = TextureUtil.splitImage(loadImage("./assets/gfx/weapons/shotgun_muzzle_flash.png"), 2,
            2);
    rocketMuzzleFlash = TextureUtil.splitImage(loadImage("./assets/gfx/weapons/rpg_muzzle_flash.png"), 2, 2);
    riskerMuzzleFlash = TextureUtil.splitImage(loadImage("./assets/gfx/weapons/risker_muzzle_flash.png"), 2, 2);

    healthPack = TextureUtil.resizeImage(loadImage("./assets/gfx/entities/healthpack.png"), 16, 16);
    healthIcon = TextureUtil.resizeImage(loadImage("./assets/gfx/ui/health.bmp"), 12, 12);
    staminaIcon = TextureUtil.resizeImage(loadImage("./assets/gfx/ui/stamina.png"), 12, 12);

    TextureRegion navArrow = loadImage("./assets/gfx/ui/ui_nav_arrows.png");
    upArrow = new Sprite(navArrow);
    upArrow.flip(false, true);
    downArrow = new Sprite(navArrow);

    fireWeaponLight = loadImage("./assets/gfx/weapon_fire.png");
    lightMap = loadImage("./assets/gfx/entities/light.png");
    flashLight = loadImage("./assets/gfx/lightmap_flashlight.png");

    bulletShell = loadImage("./assets/gfx/particles/bullet_shell.png");

    tankTrackMarks = loadImage("./assets/gfx/vehicles/tank_track_mark.png");

    shermanTankImage = loadImage("./assets/gfx/vehicles/tanks/sherman/sherman_tank.png");
    shermanTankBase = TextureUtil.subImage(shermanTankImage, 15, 180, 272, 149);
    shermanTankTurret = TextureUtil.subImage(shermanTankImage, 304, 187, 197, 108);
    shermanTankBaseDamaged = TextureUtil.subImage(shermanTankImage, 15, 8, 272, 155);
    shermanTankTurretDamaged = TextureUtil.subImage(shermanTankImage, 304, 22, 187, 108);

    panzerTankImage = loadImage("./assets/gfx/vehicles/tanks/panzer/panzer_tank.png");
    panzerTankBase = TextureUtil.subImage(panzerTankImage, 0, 310, 257, 195);
    panzerTankTurret = TextureUtil.subImage(panzerTankImage, 35, 20, 273, 125);
    panzerTankBaseDamaged = TextureUtil.subImage(panzerTankImage, 254, 310, 265, 195);
    panzerTankTurretDamaged = TextureUtil.subImage(panzerTankImage, 35, 168, 273, 125);

    alliedFlagImg = loadImage("./assets/gfx/entities/allied_flag.png");
    axisFlagImg = loadImage("./assets/gfx/entities/axis_flag.png");

    alliedIcon = loadImage("./assets/gfx/ui/allied_icon.png");
    axisIcon = loadImage("./assets/gfx/ui/axis_icon.png");

    doorImg = loadImage("./assets/gfx/entities/door.png");
}

From source file:sink.core.Sink.java

License:Apache License

void drawGrid() {
    if (showGrid) {
        shapeRenderer.begin(ShapeType.Point);
        shapeRenderer.setColor(Color.BLACK);
        for (int i = 0; i < xlines; i++)
            for (int j = 0; j < ylines; j++)
                shapeRenderer.point(i * dots, j * dots, 0);
        shapeRenderer.end();/*from   w w w .j a va2 s. c om*/
    }
}

From source file:spaceisnear.game.ui.console.InGameLog.java

private static Color getColorOfLevel(LogString str) {
    LogLevel level = str.getLevel();/*from  w w w. j  a  va  2 s. c o m*/
    switch (level) {
    case DEBUG:
        return Color.GRAY;
    case TALKING:
        return Color.BLACK;
    case BROADCASTING:
        return new Color(0, 0.5f, 0, 1);
    case WARNING:
        return Color.RED;
    case OOC:
        return Color.BLUE;
    case PRIVATE:
        return Color.MAGENTA;
    default:
        return Color.GRAY;
    }
}

From source file:spaceisnear.game.ui.context.ContextMenu.java

public void render(SpriteBatch batch) {
    renderer.setProjectionMatrix(batch.getProjectionMatrix());
    renderer.translate(getX(), getY(), 0);
    renderer.begin(ShapeRenderer.ShapeType.Filled);
    {//from  ww w  . j  a v a  2 s.c o m
        renderer.setColor(Color.WHITE);
        renderer.rect(0, 0, maxWidth, height);
        renderer.setColor(Color.BLACK);
        renderer.rect(0, selected * getLineHeight(), maxWidth, getLineHeight());
    }
    renderer.end();
    renderer.begin(ShapeRenderer.ShapeType.Line);
    {
        renderer.rect(-1, -1, maxWidth + 1, height + 1);
    }
    renderer.end();
    for (int i = 0; i < items.size(); i++) {
        ContextMenuItemable contextMenuItem = items.get(i);
        final int currentPosition = (i * getLineHeight());
        renderer.begin(ShapeRenderer.ShapeType.Filled);
        {
            Color color = i == selected ? Color.WHITE : Color.BLACK;
            renderer.setColor(color);
            font.setColor(color);
            if (contextMenuItem instanceof ContextMenu) {
                renderer.rect(maxWidth - 10, currentPosition + (getLineHeight() >> 1) - 1, 3, 3);
            }
        }
        renderer.end();
        batch.begin();
        {
            font.draw(batch, contextMenuItem.getLabel(), getX(), getY() + currentPosition + HEIGHT_PADDING / 2);
        }
        batch.end();
    }
    renderer.translate(-getX(), -getY(), 0);
}

From source file:spaceisnear.game.ui.TextField.java

@Override
public void paint(Batch batch) {
    if (checkKeys(keycode)) {
        keycode = 0;//from   w  w  w  . ja  v  a  2 s  .  c  o  m
    }
    ShapeRenderer renderer = getRenderer();
    focused = getStage().getKeyboardFocus() == this;
    int start = 0;
    int end = text.length();
    int startingXText = 0;
    //TODO
    GlyphLayout glyphLayout = new GlyphLayout(font, text);
    if (glyphLayout.width > getWidthWithoutPaddings()) {
        end = text.length();
        start = end - 1;
        glyphLayout.setText(font, text, start, end, textColor, getWidthWithoutPaddings(), 0, false, null);
        while (start > 0 && glyphLayout.width < getWidthWithoutPaddings()) {
            start--;
        }
        glyphLayout.setText(font, text, 0, start, textColor, getWidthWithoutPaddings(), 0, false, null);
        startingXText = (int) -glyphLayout.width;
    }
    //
    {
        Gdx.gl.glEnable(GL20.GL_BLEND);
        Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
        renderer.setProjectionMatrix(batch.getProjectionMatrix());
        renderer.begin(ShapeRenderer.ShapeType.Filled);
        renderer.setColor(backgroundColor);
        renderer.rect(0, 0, getWidth(), getHeight());
        renderer.end();
        Gdx.gl.glDisable(GL20.GL_BLEND);
    }
    {
        renderer.begin(ShapeRenderer.ShapeType.Line);
        renderer.setColor(borderColor);
        renderer.rect(0, 0, getWidth() + 1, getHeight());
        renderer.end();
    }
    //cursor
    renderer.begin(ShapeRenderer.ShapeType.Line);
    font.setColor(Color.BLACK);
    if (focused) {
        glyphLayout.setText(font, text, 0, currentPosition, textColor, getWidthWithoutPaddings(), 0, false,
                null);
        final float x = 10 + glyphLayout.width + startingXText;
        renderer.line(x, 3, x, font.getLineHeight() + 2);
        renderer.line(x + 1, 3, x + 1, font.getLineHeight() + 2);
    }
    renderer.end();
    batch.begin();
    font.setColor(Color.BLACK);
    font.draw(batch, text.subSequence(start, end), WIDTH_PADDING + getX(), 3 + getY());
    batch.end();
}

From source file:th.skyousuke.flappybird.Assets.java

License:Apache License

public void init() {
    manager = new AssetManager();
    manager.setErrorListener(this);

    manager.load("image.atlas", TextureAtlas.class);
    manager.load("font.fnt", BitmapFont.class);

    manager.finishLoading();//from   w ww .j a  v  a  2  s .  c o  m

    image = manager.get("image.atlas");
    font = manager.get("font.fnt");
    font.setColor(Color.BLACK);
    font.getRegion().getTexture().setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
}

From source file:th.skyousuke.flappybird.Hud.java

License:Apache License

public Hud() {
    stage = new Stage(new FitViewport(FlappyBirdJeanDang.SCENE_WIDTH, FlappyBirdJeanDang.SCENE_HEIGHT));

    Label.LabelStyle labelStyle = new Label.LabelStyle();
    labelStyle.font = Assets.instance.font;
    labelStyle.fontColor = Color.BLACK;

    startLabel = new Label(
            "?\n? F1 / Debug",
            labelStyle);/*from   ww  w.ja v  a2s. co  m*/
    startLabel.setAlignment(Align.center);
    startLabel.setPosition(FlappyBirdJeanDang.SCENE_WIDTH / 2 - startLabel.getWidth() / 2, 480);

    scoreLabel = new Label("?: 0", labelStyle);
    scoreLabel.setPosition(FlappyBirdJeanDang.SCENE_WIDTH / 2 - scoreLabel.getWidth() / 2, 550);
    scoreLabel.setVisible(false);

    fpsLabel = new Label("", labelStyle);
    fpsLabel.setPosition(5, 10);

    fpsLabel.addAction(Actions.forever(Actions.delay(1, new Action() {
        @Override
        public boolean act(float delta) {
            fpsLabel.setText("FPS: " + Gdx.graphics.getFramesPerSecond());
            return true;
        }
    })));
    stage.addActor(fpsLabel);
    stage.addActor(startLabel);
    stage.addActor(scoreLabel);
}