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:de.gebatzens.meteva.GScout.java

License:Open Source License

@Override
public void create() {

    //For testing
    trace = false;/*  w  w w.j  av  a 2  s .  co  m*/

    if (trace)
        tracei.beginTrace("initmeteva");
    batch = new SpriteBatch();
    atlas = new TextureAtlas(Gdx.files.internal("all.pack"));
    sbg = new SpaceBackground();
    sbg.initBackground();
    settings = new Settings();
    settings.load();
    highscoren = new Highscore();
    highscoren.load(false);
    highscoref = new Highscore();
    highscoref.load(true);
    mprof = new MarketProfile();
    mprof.load();
    mprof.reset();
    Gdx.app.setLogLevel(Application.LOG_ERROR);

    manager = new AssetManager();
    locale = Locale.getDefault();
    bundle = I18NBundle.createBundle(Gdx.files.internal("lang/bundle"), locale);
    Gdx.app.debug("Meteva", "using locale " + locale);

    for (int i = 0; i < 4; i++) {
        meteorExpl[i] = Gdx.audio.newSound(Gdx.files.internal("sounds/expl" + (i + 1) + ".ogg"));
    }
    playerExpl = Gdx.audio.newSound(Gdx.files.internal("sounds/raumschiffexpl.ogg"));
    laser = Gdx.audio.newSound(Gdx.files.internal("sounds/laser.ogg"));
    rush = Gdx.audio.newMusic(Gdx.files.internal("sounds/rush.mp3"));
    rush.setLooping(true);
    if (settings.musicEnabled())
        rush.play();

    Texture tex = new Texture(Gdx.files.internal("survivant.png"));
    tex.setFilter(TextureFilter.Linear, TextureFilter.Linear);
    survivant = new BitmapFont(Gdx.files.internal("survivant.fnt"), new TextureRegion(tex), false);
    fontShader = new ShaderProgram(Gdx.files.internal("font.vert"), Gdx.files.internal("font.frag"));

    if (!fontShader.isCompiled()) {
        Gdx.app.error("fontShader", "compilation failed:\n" + fontShader.getLog());
    }

    Pixmap p = new Pixmap(1, 1, Format.RGBA8888);
    p.setColor(Color.WHITE);
    p.drawPixel(0, 0);
    whiteTexture = new Texture(p);
    p.dispose();

    //   camera = new OrthographicCamera(1920, 1080);
    //   camera.setToOrtho(true, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    //   camera.setToOrtho(true);

    InputMultiplexer im = new InputMultiplexer();
    im.addProcessor(this);

    GestureDetector gd = new GestureDetector(this);
    im.addProcessor(gd);

    Gdx.input.setInputProcessor(im);

    width = Gdx.graphics.getWidth();
    height = Gdx.graphics.getHeight();

    musicb = new SoundButton(GScout.width * 0.022f, GScout.height * 0.02f, GScout.getRegion("ton"),
            GScout.getRegion("tonaus"), GScout.width * 0.065f);
    musicb.activated = !settings.musicEnabled();
    soundb = new SoundButton(GScout.width * 0.022f + 0.07f * GScout.width, GScout.height * 0.02f,
            GScout.getRegion("spielton"), GScout.getRegion("spieltonaus"), GScout.width * 0.065f);
    soundb.activated = !settings.soundsEnabled();

    state = new MainState();
    state.init();

    if (trace)
        tracei.endTrace();

}

From source file:de.gebatzens.meteva.LevelState.java

License:Open Source License

@Override
public void render() {
    background.renderBackground();/* w w w.  j a v  a2 s. c o m*/

    for (GameObject g : bgobjects)
        g.render();
    /*
     * for(GameObject g : objects) if(g instanceof BlackHole) g.render();
     */
    for (GameObject g : objects)
        if (g instanceof Meteor)
            g.render();
    /*
     * for(GameObject g : objects) if(g instanceof LaserSchuss) g.render();
     */
    for (GameObject g : objects)
        if (!(g instanceof Meteor/*
                                 * || g instanceof BlackHole || g instanceof
                                 * LaserSchuss
                                 */))
            g.render();

    if (spaceship != null)
        spaceship.render();

    for (GameObject g : vgobjects)
        g.render();

    GScout.batch.setColor(Color.WHITE);

    int width = Gdx.graphics.getWidth();
    int height = Gdx.graphics.getHeight();
    int fs = (int) Math.round(width * 0.03);
    // int fsub = Math.round(width / 400f);
    int balkenRand = (int) (width * 0.004);

    GScout.survivant.setColor(new Color(0x3b / 255f, 0xa3 / 255f, 0xd7 / (float) 0xff, 1));
    GScout.setFontSize(fs);
    GScout.drawText("" + points, (float) (width * 0.015), (float) (height * 0.96), true);

    double laserPer = spaceship == null ? 0f : (spaceship.miningLaser);
    Color color = new Color((float) (1.0 - laserPer), (float) laserPer, 0, 1);

    GScout.batch.setColor(color);
    GScout.batch.draw(laserBg, (float) (width * 0.170), (float) (height * 0.869), (int) (width * 0.04),
            (int) (width * 0.06));
    GScout.batch.setColor(Color.WHITE);
    GScout.batch.draw(lasertex, (float) (width * 0.175), (float) (height * 0.875), (int) (width * 0.03),
            (int) (lasertex.getRegionHeight() * ((width * 0.03) / (float) lasertex.getRegionWidth())));
    GScout.batch.setColor(new Color(0.4f, 0.4f, 0.4f, 1));
    GScout.batch.draw(GScout.whiteTexture, (float) (width * 0.22), (float) (height * 0.885),
            balkenRand * 2 + (int) (width * 0.25 * laserPer), (int) (width * 0.04));
    GScout.batch.setColor(color);
    GScout.batch.draw(GScout.whiteTexture, (float) (width * 0.22 + balkenRand),
            (float) (height * 0.885 + balkenRand), (int) (width * 0.25 * laserPer),
            (int) (width * 0.04) - balkenRand * 2);
    GScout.batch.setColor(new Color((1f - (float) laserPer) * 0.6f, (float) laserPer * 0.6f, 0, 1));
    String text = (int) (laserPer * 100.0) + "";
    GScout.setFontSize(fs * 0.8);
    TextBounds bounds = GScout.survivant.getBounds(text);
    GScout.fontShader.setUniformi("border", 0);
    GScout.survivant.setColor(color.mul(0.5f, 0.5f, 052f, 1).clamp());
    GScout.drawText(text, (float) (width * 0.35 - bounds.width / 2f), (float) (height * 0.95), false);

    float lebenPer = spaceship == null ? 0f : (spaceship.leben / 100f);
    color = new Color(1f - lebenPer, lebenPer, 0, 1);

    GScout.batch.setColor(lebenPer, 0, 0, 1);
    GScout.batch.draw(lebentex, (float) (width * 0.505), (float) (height * 0.87), (int) (width * 0.06),
            (int) (width * 0.06));

    GScout.batch.setColor(color);

    GScout.batch.setColor(new Color(0.4f, 0.4f, 0.4f, 1));
    GScout.batch.draw(GScout.whiteTexture, (float) (width * 0.58), (float) (height * 0.885),
            balkenRand * 2 + (int) (width * 0.25 * lebenPer), (int) (width * 0.04));
    GScout.batch.setColor(color);
    GScout.batch.draw(GScout.whiteTexture, (float) (width * 0.58 + balkenRand),
            (float) (height * 0.885 + balkenRand), (int) (width * 0.25 * lebenPer),
            (int) (width * 0.04) - balkenRand * 2);
    GScout.batch.setColor(new Color((1f - lebenPer) * 0.6f, lebenPer * 0.6f, 0, 1));
    GScout.survivant.setColor(color.mul(0.5f, 0.5f, 0.5f, 1).clamp());
    text = (int) (lebenPer * 100f) + "";
    GScout.setFontSize(fs * 0.8);
    bounds = GScout.survivant.getBounds(text);
    GScout.drawText(text, (float) (0.71 * width - bounds.width / 2f), (float) (height * 0.95), false);

    GScout.batch.setColor(Color.WHITE);

    GScout.batch.draw(pause ? weitertex : pausetex, Gdx.graphics.getWidth() * 0.875f,
            Gdx.graphics.getHeight() * 0.875f, (int) (Gdx.graphics.getWidth() * 0.05f),
            (int) (pausetex.getRegionHeight() * (Gdx.graphics.getWidth() * 0.05f / pausetex.getRegionWidth())));

    if (pause) {
        String s = GScout.getString("pause_string");
        GScout.setFontSize(Gdx.graphics.getWidth() * 0.1f);
        bounds = GScout.survivant.getBounds(s);
        GScout.survivant.setColor(Color.WHITE);
        GScout.drawText(s, Gdx.graphics.getWidth() / 2f - bounds.width * 0.4f, Gdx.graphics.getHeight() * 0.75f,
                true);
        pauseRestart.render();
        pauseMain.render();
    }

    if (gameover) {
        String s = GScout.getString("game_over_string");
        GScout.setFontSize(Gdx.graphics.getWidth() * 0.1f);
        bounds = GScout.survivant.getBounds(s);
        GScout.survivant.setColor(new Color(1f, 0, 0, 1f - (gameoverTimeout / 4f)));
        GScout.drawText(s, Gdx.graphics.getWidth() / 2f - bounds.width / 2f, Gdx.graphics.getHeight() * 0.65f,
                true);
        GScout.batch.setColor(Color.WHITE);
    }

}

From source file:de.gebatzens.meteva.MainState.java

License:Open Source License

@Override
public void render() {
    GScout.sbg.renderBackground();//from   w  w w . j a va 2 s .  c  o m
    GScout.survivant.setColor(Color.WHITE);
    GScout.batch.setColor(Color.WHITE);

    if (mstate == MMState.MAIN) {
        float titleWidth = Gdx.graphics.getWidth() * 0.5f;
        GScout.batch.draw(title, (float) (Gdx.graphics.getWidth() * 0.26),
                (float) (Gdx.graphics.getHeight() * 0.65), (int) titleWidth,
                (int) ((titleWidth / (float) title.getRegionWidth()) * (float) title.getRegionHeight()));
        end.render();
        start.render();
        highscore.render();
        setName.render();
        normalGM.render();
        fastGM.render();
        GScout.soundb.render();
        GScout.musicb.render();
        GScout.setFontSize(Gdx.graphics.getWidth() * 0.02f);
        GScout.drawText(GScout.settings.getName(), (float) setName.x,
                (float) (setName.y - Gdx.graphics.getWidth() * 0.03f), true);
    }

    for (int i = 0; i < 5; i++) {
        GScout.batch.setColor(Color.WHITE);

        GScout.drawOriginCenter(tex[i], mx[i], my[i],
                (int) (tex[i].getRegionWidth() * ((double) Gdx.graphics.getWidth() / 1920.0)),
                (int) (tex[i].getRegionHeight() * ((float) Gdx.graphics.getWidth() / 1920f)), rot[i]);
    }

    if (mstate == MMState.SCORE) {
        sstate.render();
        return;
    } else if (mstate == MMState.MARKET) {
        market.render();
        return;
    }

    String s = GScout.getString("version_string");

    int fs = (int) (Gdx.graphics.getWidth() * 0.014);
    GScout.setFontSize(fs);
    TextBounds bounds = GScout.survivant.getBounds(s);
    GScout.drawText(s, (float) (Gdx.graphics.getWidth() - bounds.width - GScout.width * 0.15),
            Gdx.graphics.getHeight() * 0.04f, true);

}

From source file:de.gebatzens.meteva.MarketState.java

License:Open Source License

@Override
public void render() {
    GScout.batch.setColor(1, 1, 1, 0.1f);
    float t = GScout.width * 0.005f;
    GScout.batch.draw(GScout.whiteTexture, (float) (Gdx.graphics.getWidth() * 0.14f - t),
            (float) (Gdx.graphics.getHeight() * 0.85f), (int) (Gdx.graphics.getWidth() * 0.72f + 2 * t),
            (int) (t));
    GScout.batch.draw(GScout.whiteTexture, (float) (Gdx.graphics.getWidth() * 0.86f),
            (float) (Gdx.graphics.getHeight() * 0.15f), (int) t, (int) (Gdx.graphics.getHeight() * 0.7f));
    GScout.batch.draw(GScout.whiteTexture, (float) (Gdx.graphics.getWidth() * 0.14f - t),
            (float) (Gdx.graphics.getHeight() * 0.15f - t), (int) (Gdx.graphics.getWidth() * 0.72f + 2 * t),
            (int) (t));
    GScout.batch.draw(GScout.whiteTexture, (float) (Gdx.graphics.getWidth() * 0.14f - t),
            (float) (Gdx.graphics.getHeight() * 0.15f), (int) t, (int) (Gdx.graphics.getHeight() * 0.7f));

    GScout.batch.setColor(0.7f, 0.7f, 0.7f, 0.3f);
    GScout.batch.draw(GScout.whiteTexture, (float) (Gdx.graphics.getWidth() * 0.14f),
            (float) (Gdx.graphics.getHeight() * 0.15f), (int) (Gdx.graphics.getWidth() * 0.72f),
            (int) (Gdx.graphics.getHeight() * 0.7f));

    GScout.batch.setColor(new Color(1, 1, 1, 0.1f));
    GScout.batch.draw(GScout.whiteTexture, Gdx.graphics.getWidth() * 0.14f, Gdx.graphics.getHeight() * 0.15f,
            Gdx.graphics.getWidth() * 0.72f, GScout.height * 0.55f);

    laser.render();// www  . ja v  a  2  s .c o  m
    leben.render();
    spaceships.render();
    back.render();
    switch (state) {
    case LASER:
        laserb.render();
        break;
    case LEBEN:
        break;
    case SPACESHIPS:
        break;
    }

    GScout.batch.setColor(Color.WHITE);
    float titleWidth = Gdx.graphics.getWidth() * 0.23f;
    GScout.batch.draw(shop, (float) (Gdx.graphics.getWidth() * 0.40), (float) (Gdx.graphics.getHeight() * 0.87),
            (int) titleWidth,
            (int) ((titleWidth / (float) shop.getRegionWidth()) * (float) shop.getRegionHeight()));

}

From source file:de.gebatzens.meteva.ScoreState.java

License:Open Source License

@Override
public void render() {
    //   Meteva.sbg.renderBackground();
    GScout.survivant.setColor(Color.WHITE);
    GScout.batch.setColor(Color.WHITE);

    float width = Gdx.graphics.getWidth() * 0.45f;
    if (width > highscoretitle.getRegionWidth())
        width = highscoretitle.getRegionWidth();
    GScout.batch.draw(highscoretitle, Gdx.graphics.getWidth() / 2f - width / 2f,
            Gdx.graphics.getHeight() * 0.88f, (int) width,
            (int) (((float) width / (float) highscoretitle.getRegionWidth())
                    * (float) highscoretitle.getRegionHeight()));

    GScout.batch.setColor(1, 1, 1, 0.1f);
    float t = GScout.width * 0.005f;
    GScout.batch.draw(GScout.whiteTexture, (float) (Gdx.graphics.getWidth() * 0.14f - t),
            (float) (Gdx.graphics.getHeight() * 0.85f), (int) (Gdx.graphics.getWidth() * 0.72f + 2 * t),
            (int) (t));
    GScout.batch.draw(GScout.whiteTexture, (float) (Gdx.graphics.getWidth() * 0.86f),
            (float) (Gdx.graphics.getHeight() * 0.15f), (int) t, (int) (Gdx.graphics.getHeight() * 0.7f));
    GScout.batch.draw(GScout.whiteTexture, (float) (Gdx.graphics.getWidth() * 0.14f - t),
            (float) (Gdx.graphics.getHeight() * 0.15f - t), (int) (Gdx.graphics.getWidth() * 0.72f + 2 * t),
            (int) (t));
    GScout.batch.draw(GScout.whiteTexture, (float) (Gdx.graphics.getWidth() * 0.14f - t),
            (float) (Gdx.graphics.getHeight() * 0.15f), (int) t, (int) (Gdx.graphics.getHeight() * 0.7f));

    GScout.batch.setColor(0.7f, 0.7f, 0.7f, 0.3f);
    GScout.batch.draw(GScout.whiteTexture, (float) (Gdx.graphics.getWidth() * 0.14f),
            (float) (Gdx.graphics.getHeight() * 0.15f), (int) (Gdx.graphics.getWidth() * 0.72f),
            (int) (Gdx.graphics.getHeight() * 0.7f));

    for (int i = 0; i < 11; i++) {
        Highscore h = fast.activated ? GScout.highscoref : GScout.highscoren;
        String player = h.players[i];
        if (player == null)
            break;
        int score = h.scores[i];

        if (GScout.lastHSR == i && h == GScout.lastHighscore)
            if (i == 0)
                GScout.survivant.setColor(blinkColor);
            else//  w  w w .  ja  va2s  .com
                GScout.survivant.setColor(Color.RED);
        else if (i == 0)
            GScout.survivant.setColor(1, 201f / 255f, 0, 1);
        else/* if(i % 2 == 0)*/
            GScout.survivant.setColor(0.5f, 0.5f, 0.5f, 1);
        /*else
           Meteva.survivant.setColor(0x1a / (float) 0xff, 0x73 / (float) 0xff, 0xa3 / (float) 0xff, 1);
        */

        if (i % 2 == 0) {
            if (i == 0)
                GScout.batch.setColor(0xff / (float) 0xff, 0x40 / (float) 0xff, 0x1e / (float) 0xff, 0.11f);
            else
                GScout.batch.setColor(0x00 / (float) 0xff, 0xa6 / (float) 0xff, 0xff / (float) 0xff, 0.11f);
            GScout.batch.draw(GScout.whiteTexture, GScout.width * 0.14f,
                    GScout.height * 0.83325f - (i + 1) * GScout.width * 0.034f, (int) (GScout.width * 0.72f),
                    (int) (GScout.width * 0.0325f));
        }

        GScout.setFontSize(Gdx.graphics.getWidth() * 0.028);

        GScout.drawText(player, (float) (Gdx.graphics.getWidth() * 0.2),
                (float) (Gdx.graphics.getHeight() * 0.84 - i * Gdx.graphics.getWidth() * 0.034), true);
        if (i == 0)
            GScout.survivant.setColor(0xfc / (float) 0xff, 0x81 / (float) 0xff, 0x06 / (float) 0xff, 0.7f);
        else
            GScout.survivant.setColor(0x1a / (float) 0xff, 0x6b / (float) 0xff, 0xdd / (float) 0xff, 0.7f);
        TextBounds bounds = GScout.survivant.getBounds((i + 1) + ".");
        GScout.drawText((i + 1) + ".", (float) (Gdx.graphics.getWidth() * 0.193 - bounds.width),
                (float) (Gdx.graphics.getHeight() * 0.84 - i * Gdx.graphics.getWidth() * 0.034), true);
        if (i == 0)
            GScout.survivant.setColor(0xfc / (float) 0xff, 0x81 / (float) 0xff, 0x06 / (float) 0xff, 0.6f);
        else
            GScout.survivant.setColor(0x53 / (float) 0xff, 0xd0 / (float) 0xff, 0xe3 / (float) 0xff, 0.6f);
        bounds = GScout.survivant.getBounds("" + score);
        GScout.drawText("" + score, (float) (Gdx.graphics.getWidth() * 0.84 - bounds.width),
                (float) (Gdx.graphics.getHeight() * 0.84 - i * Gdx.graphics.getWidth() * 0.034), true);

    }

    back.render();
    fast.render();
    normal.render();
    db.render();

    GScout.survivant.setColor(Color.WHITE);

}

From source file:de.gebatzens.meteva.SoundButton.java

License:Open Source License

public void render() {
    GScout.batch.setColor(Color.WHITE);
    GScout.batch.draw(activated ? tex2 : tex1, (float) x, (float) y, width, height);
}

From source file:de.gebatzens.meteva.SpaceBackground.java

License:Open Source License

public void renderBackground() {
    GScout.batch.setColor(Color.WHITE);
    GScout.batch.draw(tex1, -value, 0, Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight());
    GScout.batch.draw(tex1, -value + Gdx.graphics.getWidth() / 2, 0, Gdx.graphics.getWidth() / 2,
            Gdx.graphics.getHeight());//from w w  w  .j  a va2  s . c  om
    GScout.batch.draw(tex1, -value + Gdx.graphics.getWidth(), 0, Gdx.graphics.getWidth() / 2,
            Gdx.graphics.getHeight());
    /*Meteva.batch.draw(tex2, Gdx.graphics.getWidth() / 2, 0, Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight());*/

}

From source file:de.longri.cachebox3.develop.tools.skin_editor.ColorPickerDialog.java

License:Apache License

/**
 *
 *//*  ww w  .ja v  a2  s .  c  o m*/
public ColorPickerDialog(final SkinEditorGame game, final Field field) {

    super("Color Picker", game.skin);

    this.game = game;
    this.field = field;

    tableColors = new Table(game.skin);
    tableColors.left().top().pad(5);
    tableColors.defaults().pad(5);
    colors = game.skinProject.getAll(SkinColor.class);

    updateTable();

    TextButton buttonNewColor = new TextButton("New Color", game.skin);
    buttonNewColor.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {

            // Need to steal focus first with this hack (Thanks to Z-Man)
            Frame frame = new Frame();
            frame.setUndecorated(true);
            frame.setOpacity(0);
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
            frame.toFront();
            frame.setVisible(false);
            frame.dispose();

            // Call swing color picker
            java.awt.Color color = JColorChooser.showDialog(null, "Pick your color", java.awt.Color.WHITE);
            if (color != null) {

                String colorName = JOptionPane.showInputDialog("Name your color");

                if ((colorName != null) && (colorName.isEmpty() == false)) {
                    // Verify if the color name is already in use
                    if (colors.containsKey(colorName) == true) {
                        game.showMsgDlg("Error", "Color name already in use!", game.screenMain.stage);
                    } else {
                        // Add the color (asuming RGBA)
                        float[] components = color.getComponents(null);
                        SkinColor newColor = new SkinColor(components[0], components[1], components[2],
                                components[3]);
                        newColor.skinName = colorName;
                        colors.put(colorName, newColor);
                        game.screenMain.saveToSkin();

                        // update table
                        updateTable();
                    }
                }
            }

        }

    });

    TextButton buttonNoColor = new TextButton("Empty Color", game.skin);
    buttonNoColor.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {

            try {
                field.set(game.screenMain.paneOptions.currentStyle, null);
            } catch (Exception e) {
                e.printStackTrace();
            }

            game.screenMain.saveToSkin();

            hide();
            game.screenMain.panePreview.refresh();
            game.screenMain.paneOptions.updateSelectedTableFields();

        }

    });

    ScrollPane scrollPane = new ScrollPane(tableColors, game.skin);
    scrollPane.setFlickScroll(false);
    scrollPane.setFadeScrollBars(false);
    scrollPane.setScrollbarsOnTop(true);

    getContentTable().add(scrollPane).width(540).height(320).pad(20);
    getButtonTable().add(buttonNewColor);
    if (field != null) {
        getButtonTable().add(buttonNoColor);
    }
    getButtonTable().padBottom(15);
    button("Cancel", false);
    key(com.badlogic.gdx.Input.Keys.ESCAPE, false);

}

From source file:de.longri.cachebox3.develop.tools.skin_editor.FontPickerDialog.java

License:Apache License

/**
 * //ww w .  ja  va 2 s . com
 */
public void updateTable() {

    fonts = game.skinProject.getAll(BitmapFont.class);

    tableFonts.clear();
    tableFonts.add(new Label("Font Name", game.skin, "title")).left().width(170);
    tableFonts.add(new Label("Value", game.skin, "title")).colspan(3).left().width(60).padRight(50).expandX()
            .fillX();

    tableFonts.row();

    Iterator<String> it = fonts.keys().iterator();
    while (it.hasNext()) {
        final String key = it.next();
        final BitmapFont font = fonts.get(key);

        tableFonts.add(key).left();

        Label.LabelStyle labelStyle = new Label.LabelStyle();
        labelStyle.font = font;
        labelStyle.fontColor = Color.WHITE;

        tableFonts.add(new Label("Sample Text", labelStyle)).left();

        TextButton buttonSelect = new TextButton("Select", game.skin);
        buttonSelect.addListener(new ChangeListener() {

            @Override
            public void changed(ChangeEvent event, Actor actor) {
                try {
                    // Since we have reloaded everything we have to get
                    // field back

                    game.screenMain.paneOptions.refreshSelection();
                    field.set(game.screenMain.paneOptions.currentStyle, font);

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

                hide();
                game.screenMain.panePreview.refresh();
                game.screenMain.paneOptions.updateSelectedTableFields();
                game.screenMain.saveToSkin();

            }

        });

        TextButton buttonRemove = new TextButton("Remove", game.skin);
        buttonRemove.addListener(new ChangeListener() {

            @Override
            public void changed(ChangeEvent event, Actor actor) {

                Dialog dlg = new Dialog("Delete Font", game.skin) {

                    @Override
                    protected void result(Object object) {
                        if ((Boolean) object == false) {
                            return;
                        }

                        if (isFontInUse(font) == true) {

                            game.showMsgDlg("Error", "Bitmap font already in use!", getStage());

                        } else {

                            // Remove files from disk (fnt and png)
                            FileHandle targetFont = new FileHandle(
                                    "projects/" + game.screenMain.getcurrentProject() + "/" + key + ".fnt");
                            FileHandle targetImage = new FileHandle("projects/"
                                    + game.screenMain.getcurrentProject() + "/assets/" + key + ".png");
                            targetFont.delete();
                            targetImage.delete();

                            fonts.remove(key);
                            // update table
                            updateTable();
                            game.screenMain.saveToSkin();

                        }
                    }

                };

                dlg.pad(20);
                dlg.getContentTable().add("You are sure you want to delete this bitmap font?");
                dlg.button("OK", true);
                dlg.button("Cancel", false);
                dlg.key(com.badlogic.gdx.Input.Keys.ENTER, true);
                dlg.key(com.badlogic.gdx.Input.Keys.ESCAPE, false);
                dlg.show(getStage());

            }

        });

        if (field != null) {
            tableFonts.add(buttonSelect).left();
        }
        tableFonts.add(buttonRemove).left().expandX();
        tableFonts.row();
    }

}

From source file:DevRandEnginePkg.RenderEngine.java

public void renderDebugInfo() {
    int X = 10, Y = 700;
    batch.begin();/* w  w  w .j a v  a  2s . c  o  m*/
    fontDebug.setColor(Color.WHITE);
    for (int i = 0; i < debugInfo.size; ++i) {
        fontDebug.draw(batch, debugInfo.get(i), X, Y);
        Y -= 20;
    }
    batch.end();
}