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

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

Introduction

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

Prototype

Color RED

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

Click Source Link

Usage

From source file:mobi.shad.s3lib.main.S3ResourceManager.java

License:Apache License

/**
 * Zwraca tekstur zaadowan z dysku//from w w w.j  a v a2  s.  com
 *
 * @param fileName
 * @return
 */
public static TextureRegion getTextureRegion(String fileName) {

    TextureRegion textureRegion;

    if (regionResuorce == null) {
        regionResuorce = new ArrayMap<String, TextureRegion>(20);
    }

    if (!regionResuorce.containsKey(fileName) || reBindProcess == true) {

        if (LOG) {
            S3Log.trace(TAG, "Load textureRegion region: " + fileName, 3);
        }

        try {
            FileHandle fileHandle = S3File.getFileHandle(fileName, true, false);
            textureRegion = new TextureRegion(assetManager.get(fileHandle.path(), Texture.class));
            textureRegion.getTexture().setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);

            if (USE_CACHE_RESOURCE) {
                if (regionResuorce.containsKey(fileName)) {
                    regionResuorce.removeKey(fileName);
                }
                regionResuorce.put(fileName, textureRegion);
            }

        } catch (Exception e) {
            S3Log.error("S3ResourceManager::getTexture", "Error create textureRegion data ....", e);

            try {
                Pixmap pixmap = new Pixmap(S3Constans.proceduralTextureSizeLow,
                        S3Constans.proceduralTextureSizeLow, Pixmap.Format.RGBA4444);
                pixmap.setColor(Color.RED);
                pixmap.fill();
                Texture text2 = new Texture(pixmap);
                text2.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
                text2.draw(pixmap, 0, 0);
                textureRegion = new TextureRegion(text2);
            } catch (Exception ex) {
                textureRegion = regionResuorce.firstValue();
            }
        }
    } else {

        if (LOG) {
            S3Log.trace(TAG, "Load textureRegion region from cache: " + fileName, 2);
        }
        textureRegion = regionResuorce.get(fileName);
    }
    return textureRegion;
}

From source file:mobi.shad.s3lib.main.S3ResourceManager.java

License:Apache License

/**
 * @param fileName/* w w  w .  jav  a  2s.  c o m*/
 * @param destAndroidResolution
 * @return
 */
public static Pixmap getPixmap(String fileName, int destAndroidResolution) {

    Pixmap pixmap;

    if (pixmapResuorce == null) {
        pixmapResuorce = new ArrayMap<String, Pixmap>(20);
    }

    if (!pixmapResuorce.containsKey(fileName) || reBindProcess == true) {

        if (LOG) {
            S3Log.trace(TAG, "Load pixmap (def size: " + destAndroidResolution + ") from file: " + fileName, 3);
        }
        try {

            FileHandle fileHandle = S3File.getFileHandle(fileName, true, false);
            pixmap = assetManager.get(fileHandle.path(), Pixmap.class);
            if (USE_CACHE_RESOURCE) {
                pixmapResuorce.put(fileName, pixmap);
            }
        } catch (Exception e) {
            S3Log.error("S3ResourceManager::getPixmap", "Error create pixmap data ....", e);
            pixmap = new Pixmap(S3Constans.proceduralTextureSizeLow, S3Constans.proceduralTextureSizeLow,
                    Pixmap.Format.RGBA4444);
            pixmap.setColor(Color.RED);
            pixmap.fill();
        }
    } else {

        if (LOG) {
            S3Log.trace(TAG,
                    "Load pixmap from cache (def size: " + destAndroidResolution + ") from file: " + fileName,
                    1);
        }
        pixmap = pixmapResuorce.get(fileName);
    }

    if (LOG) {
        S3Log.trace(TAG, "Pixmap size width: " + pixmap.getWidth() + "px height: " + pixmap.getHeight() + "px ",
                0);
    }
    return pixmap;
}

From source file:mobi.shad.s3libTest.G2DSimpleShapes.java

License:Apache License

@Override
public void render(S3Gfx g) {
    g.clear(0.2f, 0.0f, 0.0f);// w ww  . j a  v  a 2 s  . c  om

    g.setColor(Color.YELLOW);
    g.drawCircle(30, 30, 20);

    g.setColor(Color.GREEN);

    g.drawFilledRectangle(80, 30, 10, 10, 0, Color.RED);
    g.drawFilledRectangle(80, 30, 20, 20, 0, new Color(0.5f, 0.5f, 0.5f, 0.5f));
}

From source file:name.herve.bastod.BASToD.java

License:Open Source License

private void initGUIResources(int sqs) {
    GUIResources r = GUIResources.getInstance();
    DecimalFormat blender = new DecimalFormat("0000");

    String set = "bricks";
    String view = "top";

    for (int a = 0; a < 360; a++) {
        r.addTexture("tank-red-" + a, new Texture(Gdx.files
                .internal(sqs + "/3d/" + set + "/" + view + "/tank/red/" + blender.format(a + 1) + ".png")));
        r.addTexture("tank-blue-" + a, new Texture(Gdx.files
                .internal(sqs + "/3d/" + set + "/" + view + "/tank/blue/" + blender.format(a + 1) + ".png")));

        r.addTexture("tower-red-" + a, new Texture(Gdx.files
                .internal(sqs + "/3d/" + set + "/" + view + "/tower/red/" + blender.format(a + 1) + ".png")));
        r.addTexture("tower-blue-" + a, new Texture(Gdx.files
                .internal(sqs + "/3d/" + set + "/" + view + "/tower/blue/" + blender.format(a + 1) + ".png")));
    }/* www . ja v  a 2 s.  co  m*/

    r.addTexture("tower-red", new Texture(
            Gdx.files.internal(sqs + "/3d/" + set + "/" + view + "/tower/red/" + blender.format(50) + ".png")));
    r.addTexture("tower-blue", new Texture(Gdx.files
            .internal(sqs + "/3d/" + set + "/" + view + "/tower/blue/" + blender.format(50) + ".png")));

    r.addTexture("factory-red", new Texture(Gdx.files
            .internal(sqs + "/3d/" + set + "/" + view + "/factory/red/" + blender.format(0) + ".png")));
    r.addTexture("factory-blue", new Texture(Gdx.files
            .internal(sqs + "/3d/" + set + "/" + view + "/factory/blue/" + blender.format(0) + ".png")));

    r.addTexture("target-red", new Texture(
            Gdx.files.internal(sqs + "/3d/" + set + "/" + view + "/target/red/" + blender.format(0) + ".png")));
    r.addTexture("target-blue", new Texture(Gdx.files
            .internal(sqs + "/3d/" + set + "/" + view + "/target/blue/" + blender.format(0) + ".png")));

    r.addTexture("wall", new Texture(
            Gdx.files.internal(sqs + "/3d/" + set + "/" + view + "/wall/" + blender.format(0) + ".png")));

    r.addTexture("shot-red", new Texture(Gdx.files.internal(sqs + "/shot-red.png")));
    r.addTexture("shot-blue", new Texture(Gdx.files.internal(sqs + "/shot-blue.png")));

    r.addTexture(ImprovementButton.IMPROVEMENT_BORDER,
            new Texture(Gdx.files.internal(sqs + "/improvement.png")));

    r.addTexture("noway", new Texture(Gdx.files.internal(sqs + "/noway.png")));
    r.addTexture("more_metal", new Texture(Gdx.files.internal(sqs + "/more_metal.png")));
    r.addTexture("increase_speed", new Texture(Gdx.files.internal(sqs + "/increase_speed.png")));
    r.addTexture("title", new Texture(Gdx.files.internal("title.png")));
    r.addTexture("background", new Texture(Gdx.files.internal("background.png")));

    r.addColor(Player.PLAYER_RED, Color.RED);
    r.addColor(Player.PLAYER_BLUE, Color.BLUE);

    r.addFont(Player.PLAYER_RED, GUIResources.createFont(GUIResources.DEFAULT_FONT,
            GUIResources.DEFAULT_FONT_SIZE, GUIResources.getInstance().getColor(Player.PLAYER_RED)));
    r.addFont(Player.PLAYER_BLUE, GUIResources.createFont(GUIResources.DEFAULT_FONT,
            GUIResources.DEFAULT_FONT_SIZE, GUIResources.getInstance().getColor(Player.PLAYER_BLUE)));
    r.addFont(UnitInfoBox.INFOBOX_FONT,
            GUIResources.createFont(GUIResources.DEFAULT_FONT, GUIResources.SMALL_FONT_SIZE, Color.YELLOW));
}

From source file:net.k3rnel.unsealed.battle.BattleEntity.java

License:Open Source License

/**
 * @param status the status to set//from   w  w w . j a v a 2 s . c  o  m
 */
public void setStatus(int status) {
    this.status = status;
    switch (this.status) {
    case BattleEntity.statusNormal:
        break;
    case BattleEntity.statusBurned:
        actions =

                sequence(color(Color.RED), delay(0.05f), color(Color.ORANGE), delay(0.05f), color(Color.RED),
                        delay(0.05f), color(Color.ORANGE), delay(0.05f), run(new Runnable() {
                            @Override
                            public void run() {
                                setHp(getHp() - 10);
                            }
                        }), color(Color.RED), delay(0.05f), color(Color.ORANGE), delay(0.05f), color(Color.RED),
                        delay(0.05f), color(Color.ORANGE), delay(0.05f), run(new Runnable() {
                            @Override
                            public void run() {
                                setHp(getHp() - 10);
                            }
                        }), color(Color.RED), delay(0.05f), color(Color.ORANGE), delay(0.05f), color(Color.RED),
                        delay(0.05f), color(Color.ORANGE), delay(0.05f), run(new Runnable() {
                            @Override
                            public void run() {
                                setHp(getHp() - 10);
                            }
                        }), color(Color.WHITE), run(new Runnable() {

                            @Override
                            public void run() {
                                setState(BattleEntity.statusNormal);
                            }
                        }));
        this.addAction(actions);
        break;
    case BattleEntity.statusStunned:
        actions =

                sequence(color(Color.YELLOW), delay(0.2f), color(Color.ORANGE), delay(0.1f),
                        color(Color.YELLOW), delay(0.2f), color(Color.ORANGE), delay(0.1f), color(Color.YELLOW),
                        delay(0.2f), color(Color.ORANGE), delay(0.1f), color(Color.YELLOW), delay(0.2f),
                        color(Color.ORANGE), delay(0.1f), color(Color.WHITE), delay(0.1f), run(new Runnable() {

                            @Override
                            public void run() {
                                setStatus(BattleEntity.statusNormal);
                            }
                        }));
        this.addAction(actions);
        break;
    case BattleEntity.statusFrozen:
        this.status = statusStunned;
        actions =

                sequence(color(Color.BLUE), delay(0.05f), color(Color.CLEAR), delay(0.05f), color(Color.BLUE),
                        delay(0.05f), color(Color.CLEAR), delay(0.05f), run(new Runnable() {
                            @Override
                            public void run() {
                                setHp(getHp() - 10);
                            }
                        }), color(Color.BLUE), delay(0.05f), color(Color.CLEAR), delay(0.05f),
                        color(Color.BLUE), delay(0.05f), color(Color.CLEAR), delay(0.05f), run(new Runnable() {
                            @Override
                            public void run() {
                                setHp(getHp() - 10);
                            }
                        }), color(Color.BLUE), delay(0.05f), color(Color.CLEAR), delay(0.05f),
                        color(Color.BLUE), delay(0.05f), color(Color.CLEAR), delay(0.05f), run(new Runnable() {
                            @Override
                            public void run() {
                                setHp(getHp() - 10);
                            }
                        }), color(Color.WHITE), run(new Runnable() {
                            @Override
                            public void run() {
                                setState(BattleEntity.statusNormal);
                            }
                        }));
        this.addAction(actions);
        break;
    case BattleEntity.statusPoisoned:
        actions = sequence(color(Color.MAGENTA), delay(0.2f), color(Color.GREEN), delay(0.2f),
                color(Color.MAGENTA), delay(0.2f), color(Color.GREEN), delay(0.2f), color(Color.WHITE),
                fadeIn(0.3f), run(new Runnable() {
                    @Override
                    public void run() {
                        setHp(getHp() - 5);
                    }
                }),

                color(Color.MAGENTA), delay(0.2f), color(Color.GREEN), delay(0.2f), color(Color.MAGENTA),
                delay(0.2f), color(Color.GREEN), delay(0.2f), color(Color.WHITE), fadeIn(0.3f),
                run(new Runnable() {
                    @Override
                    public void run() {
                        setHp(getHp() - 5);
                    }
                }), color(Color.MAGENTA), delay(0.2f), color(Color.GREEN), delay(0.2f), color(Color.MAGENTA),
                delay(0.2f), color(Color.GREEN), delay(0.2f), color(Color.WHITE), fadeIn(0.3f),
                run(new Runnable() {
                    @Override
                    public void run() {
                        setHp(getHp() - 5);
                    }
                }), color(Color.MAGENTA), delay(0.2f), color(Color.GREEN), delay(0.2f), color(Color.MAGENTA),
                delay(0.2f), color(Color.GREEN), delay(0.2f), color(Color.WHITE), fadeIn(0.3f),
                run(new Runnable() {
                    @Override
                    public void run() {
                        setHp(getHp() - 5);
                    }
                }), color(Color.MAGENTA), delay(0.2f), color(Color.GREEN), delay(0.2f), color(Color.MAGENTA),
                delay(0.2f), color(Color.GREEN), delay(0.2f), color(Color.WHITE), fadeIn(0.3f),
                run(new Runnable() {
                    @Override
                    public void run() {
                        setHp(getHp() - 5);
                    }
                }), color(Color.WHITE), run(new Runnable() {

                    @Override
                    public void run() {
                        setState(BattleEntity.statusNormal);
                    }
                }));
        this.getActions().clear();
        this.addAction(actions);
        break;
    }
}

From source file:net.k3rnel.unsealed.story.chapter1.Chapter1_2.java

License:Open Source License

@Override
public void render(float delta) {
    super.render(delta);

    stage.getSpriteBatch().begin();//from  www. j a  v  a2s  . c  om

    //This is probably the bestest "Scene Director" ever made. 
    //Valve should totally hire me. 
    for (MapCharacter character : characters) {
        if (character instanceof Lidia) {
            switch (act) {
            case 0:
                centerCamera(character);
                character.setDirection(MapCharacter.dirLeft);
                character.getColor().a = 0;
                character.setWalking(false);

                actions = sequence(fadeIn(0.75f), delay(0.75f), run(new Runnable() {
                    @Override
                    public void run() {
                        setAct(1);
                    }
                }));
                character.addAction(actions);
                break;
            case 1:
                dialog.setText("Lidia: So this is New Lion? I wonder if magic has returned here already.");
                dialog.setVisible(true);
                break;
            case 2:
                dialog.setVisible(false);
                character.setWalking(true);
                if (character.getX() > 1050) {
                    character.setX(character.getX() - 1);
                    centerCamera(character);
                } else {
                    game.getSoundManager().play(UnsealedSound.FIRE);
                    character.setWalking(false);
                    dialog.setText("Lidia: Hmm, I wonder what that noise was. I better check it out.");
                    dialog.setVisible(true);
                }
                break;
            case 3:
                dialog.setVisible(false);
                character.setWalking(true);
                character.setDirection(MapCharacter.dirRight);
                setAct(4);
                break;
            case 4:
                if (character.getX() < 1140) {
                    character.setX(character.getX() + 1);
                    centerCamera(character);
                } else {
                    character.setDirection(MapCharacter.dirDown);
                    setAct(5);
                }
                break;
            case 5:
                if (character.getY() > 1000) {
                    character.setY(character.getY() - 1);
                    centerCamera(character);
                } else {
                    character.setWalking(false);
                    setAct(6);
                }
            case 6:
                if (character.getY() == 1000) {
                    dialog.setText("Mimi: Watch this! Watch this!");
                    dialog.setVisible(true);
                }
                break;
            }

        }
        if (character instanceof Kid) {
            if (((Kid) character).kid == 0) {
                switch (act) {
                case 7:
                    dialog.setVisible(false);
                    actions = sequence(color(Color.RED), delay(0.3f), color(Color.WHITE));
                    character.addAction(actions);
                    setAct(8);
                    break;
                }
            }
            if (((Kid) character).kid == 1) {

            }
            if (((Kid) character).kid == 2) {
            }
        }
        if (character instanceof FireLionMap) {
            switch (act) {
            case 8:
                character.setVisible(true);
                if (character.getX() < 1130) {
                    character.setX(character.getX() + 2);
                } else {
                    character.setVisible(false);
                    setAct(9);
                }
                break;
            case 9:
                dialog.setText("Leon: Wow! That's amazing!");
                dialog.setVisible(true);
                break;
            case 10:
                dialog.setText("Nina: Do it again! Do it again!");
                break;
            case 11:
                dialog.setText("Lidia: Wait!\n"
                        + "Magic can be dangerous. If you don't know what you're doing, you might hurt someone!");
                break;
            case 12:
                dialog.setText("Mimi: Look at those clothes! She's not from around here!");
                break;
            case 13:
                dialog.setText("Leon: Who are you and where did you come from?");
                break;
            case 14:
                dialog.setText("Lidia: You can call me Lidia, and you're right. I'm not from around here.\n"
                        + "I'm a Traveler.\n"
                        + "We travel through the lands, watching over magic, and it's usage");
                break;
            case 15:
                dialog.setText("Nina: You know how to use magic? Can you teach us??\n"
                        + "Mimi: Yeah, can you? Pwease?");
                break;
            case 16:
                dialog.setText("Lidia: Sure. Stand back everyone.");
                break;
            case 17:
                dialog.setVisible(false);
                setAct(18);
                break;
            case 18:
                game.setScreen(new Chapter1_3(game));
                break;
            }
        }
        character.act(delta);
        if (character.isVisible())
            character.draw(stage.getSpriteBatch(), 1);
    }
    stage.getSpriteBatch().end();

    if (dialog.isVisible()) {
        hud.act(delta);
        hud.draw();
    }
}

From source file:net.k3rnel.unsealed.story.chapter1.Chapter1_7.java

License:Open Source License

@Override
public void render(float delta) {
    super.render(delta);

    stage.getSpriteBatch().begin();//from w w  w . j a  v a 2s  .  c om

    //This is probably the bestest "Scene Director" ever made. 
    //Valve should totally hire me. 
    for (MapCharacter character : characters) {
        if (character instanceof Lidia) {
            switch (act) {
            case 0:
                centerCamera(character);
                dialog.setText("Lidia: It's always hard to say goodbye.\n");
                dialog.setVisible(true);
                break;
            case 1:
                dialog.setText("Mimi: Wait! Don't go!");
                act = 2;
                break;
            case 28:
                character.setDirection(MapCharacter.dirRight);
                character.setWalking(true);
                act = 29;
                break;
            case 29:
                if (character.getX() < 1730) {
                    character.setX(character.getX() + 1);
                    centerCamera(character);
                } else {
                    actions = sequence(fadeOut(0.85f));
                    character.addAction(actions);
                    act = 30;
                }
                break;
            case 30:
                game.setScreen(new ChapterSelectScreen(game));
                break;
            }
        }
        if (character instanceof Kid) {
            switch (act) {
            case 2:
                if (character.getX() < 1480) {
                    character.setX(character.getX() + 2);
                } else {
                    character.setWalking(false);
                }
                break;
            case 3:
                if (character.getX() != 1480) {
                    act = 2;
                } else {
                    act = 4;
                }
                break;
            case 4:
                dialog.setText("Lidia: Sorry, but I've already stayed more than the week I promised to.");
                break;
            case 5:
                dialog.setText("Mimi: Thank you for everything you've done.\n"
                        + "You've really changed everyone in town.");
                break;
            case 6:
                dialog.setText("Lidia: I'm glad to hear that. ^_^\n" + "Just don't forget about the laws!");
                break;
            case 7:
                dialog.setText("Mimi: I know! I know! They grant us our Four Freedoms of magic!");
                break;
            case 8:
                dialog.setText("Mimi: The Freedom to cast any spell. \n"
                        + "The Freedom to study the spell, and weave it into something new!\n"
                        + "The Freedom to teach others how to do the spell\n"
                        + "And the Freedom to let others pass on the knowledge");
                break;
            case 9:
                dialog.setText("Mimi: I've heard the grownups say that we'll join the fight against Xios.");
                break;
            case 10:
                dialog.setText("Lidia: Then my job here is done.");
                break;
            case 11:
                dialog.setText("Mimi: Before you go, there's one thing I'd like to show you... ");
                break;
            case 12:
                dialog.setVisible(false);
                character.setDirection(MapCharacter.dirLeft);
                character.setWalking(true);
                act = 13;
                break;
            case 13:
                if (character.getX() > 1300) {
                    character.setX(character.getX() - 1);
                } else {
                    character.setDirection(MapCharacter.dirRight);
                    character.setWalking(false);
                    actions = sequence(delay(0.5f), color(Color.RED), delay(0.3f), color(Color.WHITE),
                            delay(0.3f), run(new Runnable() {
                                @Override
                                public void run() {
                                    setAct(14);

                                }
                            }));
                    character.addAction(actions);
                }
                break;
            case 15:
                actions = sequence(delay(0.6f), color(Color.RED), delay(0.3f), color(Color.WHITE), delay(0.3f),
                        run(new Runnable() {
                            @Override
                            public void run() {
                                setAct(16);

                            }
                        }));
                character.addAction(actions);
                break;
            case 17:
                actions = sequence(delay(0.5f), color(Color.RED), delay(0.3f), color(Color.WHITE), delay(0.3f),
                        run(new Runnable() {
                            @Override
                            public void run() {
                                setAct(18);

                            }
                        }));
                character.addAction(actions);
                break;
            case 19:
                actions = sequence(delay(0.5f), color(Color.RED), delay(0.3f), color(Color.WHITE), delay(0.3f),
                        run(new Runnable() {
                            @Override
                            public void run() {
                                setAct(20);

                            }
                        }));
                character.addAction(actions);
                break;
            case 21:
                dialog.setText("Lidia: Wow! Great job!");
                dialog.setVisible(true);
                break;
            case 22:
                dialog.setText("Mimi: Thank you! I've been working very hard!\n"
                        + "I wanted to give you something in return for all the things you've done for us.\n"
                        + "I've already Enchanted the spell, so that the spell cannot be forgotten");
                break;
            case 23:
                dialog.setText("Lidia learned Fire Lion! You can now use this spell in battle");
                break;
            case 24:
                dialog.setText("Lidia: Thank you Mimi, I'll never forget you.");
                break;
            case 25:
                dialog.setText(
                        "Mimi: When you have time, could you head to Ryuken? We haven't heard from them in a long time.\n"
                                + "It's just past the desert. ");
                break;
            case 26:
                dialog.setText("Lidia: Sure. I'll check out the town.");
                break;
            case 27:
                dialog.setVisible(false);
                act = 28;
                break;
            }
        }
        if (character instanceof FireLionMap) {
            switch (act) {
            case 14:
                character.setVisible(true);
                if (character.getX() < 1450) {
                    character.setX(character.getX() + 2);
                } else {
                    character.setVisible(false);
                    character.setDirection(MapCharacter.dirDown);
                    setAct(15);
                    character.setPosition(1350, 1590);
                }
                break;
            case 16:
                character.setVisible(true);
                if (character.getX() < 1450) {
                    character.setX(character.getX() + 2);
                } else {
                    character.setPosition(1350, 1590);
                    character.setVisible(false);
                    character.setDirection(MapCharacter.dirLeft);
                    setAct(17);
                }
                break;
            case 18:
                character.setVisible(true);
                if (character.getX() < 1450) {
                    character.setX(character.getX() + 2);
                } else {
                    character.setPosition(1350, 1590);
                    character.setVisible(false);
                    character.setDirection(MapCharacter.dirRight);
                    setAct(19);
                }
                break;
            case 20:
                character.setVisible(true);
                if (character.getX() < 1460) {
                    character.setX(character.getX() + 1);
                } else {
                    character.setVisible(false);
                    character.setDirection(MapCharacter.dirRight);
                    setAct(21);
                }
                break;
            }
        }

        character.act(delta);
        if (character.isVisible())
            character.draw(stage.getSpriteBatch(), 1);
    }
    stage.getSpriteBatch().end();
    tileMapRenderer.render(camera, overLayers);
    if (dialog.isVisible()) {
        hud.act(delta);
        hud.draw();
    }
}

From source file:net.noviden.towerdefense.MapCreator.MapThumbnail.java

License:Open Source License

public static SpriteDrawable createThumbnail(Map map, int dims) {

    Pixmap pixmap = new Pixmap(dims, dims, Pixmap.Format.RGB565);

    // draw border around pixmap
    pixmap.setColor(Color.PURPLE);
    pixmap.drawRectangle(0, 0, pixmap.getWidth(), pixmap.getHeight());

    // draw paths
    pixmap.setColor(Color.RED);

    for (Path path : map.getGenericPaths()) {
        for (int j = 0; j < path.set.size() - 1; j++) {
            Point a = path.set.get(j), b = path.set.get(j + 1);

            int ax = (int) (a.x * dims), ay = (int) (a.y * dims), bx = (int) (b.x * dims),
                    by = (int) (b.y * dims);

            pixmap.drawLine(ax, ay, bx, by);
        }//from  www  .jav  a2  s .  com
    }

    Texture texture = new Texture(pixmap);

    Sprite sprite = new Sprite(texture);

    SpriteDrawable spriteDrawable = new SpriteDrawable(sprite);

    return spriteDrawable;
}

From source file:net.noviden.towerdefense.Screens.GameScreen.java

License:Open Source License

private void drawOpaqueSelectedTurret() {
    // draw the temp turret at mouseLocation, along with its range
    shapeRenderer.set(ShapeRenderer.ShapeType.Line);

    if (player.onCooldownForPlacingTurrets() || !player.canAffordSelectedTurret()) {
        shapeRenderer.setColor(Color.RED);
    } else {//from www  .  j  a va 2 s .  co  m
        shapeRenderer.setColor(Color.GREEN);
    }

    BaseTurret turret = player.getTurretSelectedForPurchase();
    if (turret != null) {
        turret.drawOpaque(shapeRenderer);
    }
}

From source file:net.saga.mmstyle.screen.IntroScene.java

License:Open Source License

@Override
public void init() {
    batch = new SpriteBatch();
    font = new BitmapFont();
    font.setColor(Color.RED);
}