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

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

Introduction

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

Prototype

Color BLUE

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

Click Source Link

Usage

From source file:non.plugins.graphics.java

public Color color(String name) {
    if (name.startsWith("#"))
        return Color.valueOf(name.replace("#", ""));
    if ("clear".equalsIgnoreCase(name))
        return Color.CLEAR;
    else if ("white".equalsIgnoreCase(name))
        return Color.WHITE;
    else if ("black".equalsIgnoreCase(name))
        return Color.BLACK;
    else if ("red".equalsIgnoreCase(name))
        return Color.RED;
    else if ("green".equalsIgnoreCase(name))
        return Color.GREEN;
    else if ("blue".equalsIgnoreCase(name))
        return Color.BLUE;
    else if ("lightgray".equalsIgnoreCase(name))
        return Color.LIGHT_GRAY;
    else if ("gray".equalsIgnoreCase(name))
        return Color.GRAY;
    else if ("darkgray".equalsIgnoreCase(name))
        return Color.DARK_GRAY;
    else if ("pink".equalsIgnoreCase(name))
        return Color.PINK;
    else if ("orange".equalsIgnoreCase(name))
        return Color.ORANGE;
    else if ("yellow".equalsIgnoreCase(name))
        return Color.YELLOW;
    else if ("magenta".equalsIgnoreCase(name))
        return Color.MAGENTA;
    else if ("cyan".equalsIgnoreCase(name))
        return Color.CYAN;
    else if ("olive".equalsIgnoreCase(name))
        return Color.OLIVE;
    else if ("purple".equalsIgnoreCase(name))
        return Color.PURPLE;
    else if ("maroon".equalsIgnoreCase(name))
        return Color.MAROON;
    else if ("teal".equalsIgnoreCase(name))
        return Color.TEAL;
    else if ("navy".equalsIgnoreCase(name))
        return Color.NAVY;
    return Color.CLEAR;
}

From source file:org.ams.prettypaint.OutlineMerger.java

License:Open Source License

/** For debugging. */
private void debugDraw(ShapeRenderer shapeRenderer) {
    Vector2 tmp = new Vector2();
    Vector2 tmp1 = new Vector2();

    shapeRenderer.set(ShapeRenderer.ShapeType.Line);

    int n = 0;/*  w  w  w  .jav a 2s  . c  o  m*/
    for (Array<Vector2> vertices : debug) {
        if (n == 0) {
            shapeRenderer.setColor(Color.RED);
        }
        if (n == 1) {
            shapeRenderer.setColor(Color.GREEN);
        }
        if (n == 2) {
            shapeRenderer.setColor(Color.BLUE);
        }
        if (n == 3) {
            shapeRenderer.setColor(Color.YELLOW);
        }
        n++;

        for (int i = 0; i < vertices.size; i++) {
            Util.getEdge(vertices, i, tmp, tmp1);

            shapeRenderer.line(tmp.x, tmp.y, tmp1.x, tmp1.y);

        }
    }
}

From source file:org.ams.prettypaint.OutlinePolygon.java

License:Open Source License

/** Draws anti aliased polygon edges. */
public OutlinePolygon(OutlinePolygonDef outlinePolygonDef) {

    debugRenderer = new DebugRenderer(this) {

        @Override//  w  w w  .  j a v a 2  s .  c o m
        public void draw(ShapeRenderer shapeRenderer) {
            if (drawCullingRectangles)
                drawCullingRectangles(shapeRenderer, Color.GREEN);

            if (drawLineFromFirstToLast)
                drawLineFromFirstToLast(shapeRenderer, Color.BLUE);

            if (drawTriangleStrips)
                drawTriangleStrips(shapeRenderer, Color.RED, Color.ORANGE);

        }

        @Override
        void update() {
            super.update();
            boolean enabled = drawLineFromFirstToLast;
            enabled |= drawCullingRectangles;
            enabled |= drawTriangleStrips;

            enabled &= myParents.size == 0;

            boolean change = this.enabled != enabled;
            if (!change)
                return;

            this.enabled = enabled;

            debugColors.clear();

            if (drawCullingRectangles) {
                debugColors.add(new DebugColor(Color.GREEN, "Bounding box"));
            }
            if (drawLineFromFirstToLast) {
                debugColors.add(new DebugColor(Color.BLUE, "Line from first to last vertex in bounding box"));
            }
            if (drawTriangleStrips) {
                debugColors.add(new DebugColor(Color.RED, "Triangle strip visualization"));
                debugColors.add(new DebugColor(Color.ORANGE, "Triangle strip visualization"));

            }

        }
    };

    auxVertexFinder.setHalfWidth(this.halfWidth);

    if (outlinePolygonDef != null) {

        setDrawOutside(outlinePolygonDef.drawOutside);
        setDrawInside(outlinePolygonDef.drawInside);
        setColor(outlinePolygonDef.color);
        setClosedPolygon(outlinePolygonDef.closedPolygon);
        setHalfWidth(outlinePolygonDef.halfWidth);
        setWeight(outlinePolygonDef.weight);
        setRoundSharpCorners(outlinePolygonDef.roundSharpCorners);

        setDrawLineFromFirstToLast(outlinePolygonDef.drawLineFromFirstToLast);
        setDrawCullingRectangles(outlinePolygonDef.drawBoundingBoxes);
        setDrawTriangleStrips(outlinePolygonDef.drawTriangleStrips);

        setVisible(outlinePolygonDef.visible);
        setVertices(outlinePolygonDef.vertices);
        setScale(outlinePolygonDef.scale);
        setAngle(outlinePolygonDef.angle);
        setPosition(outlinePolygonDef.position);
        setOpacity(outlinePolygonDef.opacity);

    }
}

From source file:org.bladecoder.bladeengine.ui.Pointer.java

License:Apache License

public void drawHotspot(SpriteBatch batch, float x, float y, String desc) {
    float minScale = Math.max(MIN_HEIGHT / pointerIcon.getRegionHeight(), scale);

    if (desc == null) {
        batch.setColor(Color.BLUE);
        batch.draw(hotspotIcon, x - hotspotIcon.getRegionWidth() * minScale / 2,
                y - hotspotIcon.getRegionHeight() * minScale / 2, hotspotIcon.getRegionWidth() * minScale,
                hotspotIcon.getRegionHeight() * minScale);
        batch.setColor(Color.WHITE);
    } else {/*from   w  w  w  .  ja va 2 s .c om*/
        if (desc != null && desc.charAt(0) == '@')
            desc = I18N.getString(desc.substring(1));

        TextBounds b = font.getBounds(desc);

        float textX = x - b.width / 2;
        float textY = y + b.height;

        RectangleRenderer.draw(batch, textX - 8, textY - b.height - 8, b.width + 16, b.height + 16,
                Color.BLACK);
        font.draw(batch, desc, textX, textY);
    }
}

From source file:org.bladecoder.bladeengine.util.Utils3D.java

License:Apache License

private static void createAxes() {
    ModelBuilder modelBuilder = new ModelBuilder();
    modelBuilder.begin();//from w w  w  . j  ava 2 s. c om
    MeshPartBuilder builder = modelBuilder.part("grid", GL20.GL_LINES, Usage.Position | Usage.Color,
            new Material());
    builder.setColor(Color.LIGHT_GRAY);
    for (float t = GRID_MIN; t <= GRID_MAX; t += GRID_STEP) {
        builder.line(t, 0, GRID_MIN, t, 0, GRID_MAX);
        builder.line(GRID_MIN, 0, t, GRID_MAX, 0, t);
    }
    builder = modelBuilder.part("axes", GL20.GL_LINES, Usage.Position | Usage.Color, new Material());
    builder.setColor(Color.RED);
    builder.line(0, 0, 0, 10, 0, 0);
    builder.setColor(Color.GREEN);
    builder.line(0, 0, 0, 0, 10, 0);
    builder.setColor(Color.BLUE);
    builder.line(0, 0, 0, 0, 0, 10);
    axesModel = modelBuilder.end();
    axesInstance = new ModelInstance(axesModel);
}

From source file:org.catrobat.catroid.common.DroneVideoLookData.java

License:Open Source License

@Override
public Pixmap getPixmap() {
    // BUG: Height() should be 1280, but it is 1184, so we need an scaling factor of 1.081081
    int virtualScreenHeight = (int) Math.round(1.081081 * ScreenValues.SCREEN_HEIGHT);

    defaultVideoTextureSize = new int[] { virtualScreenHeight, ScreenValues.SCREEN_WIDTH };

    if (pixmap == null) {
        pixmap = new Pixmap(virtualScreenHeight, ScreenValues.SCREEN_WIDTH, Pixmap.Format.RGB888);
        pixmap.setColor(Color.BLUE);
        pixmap.fill();//  www .j av  a  2  s . c  o m
        pixmap.setBlending(Pixmap.Blending.None);
    }
    return pixmap;
}

From source file:pl.kotcrab.jdialogue.editor.components.ConnectionRenderer.java

License:Open Source License

public int renderLines(ShapeRenderer shapeRenderer, DComponent comp, boolean ignoreInvisible) {
    rendered = 0;/*from w  w  w.  j  a va2 s .c  o m*/

    if (ignoreInvisible == false && comp instanceof RelayComponent) {
        if ((boolean) comp.getTableModel().data[0][1] == true)
            return rendered;
    }

    Connector[] outputs = comp.getOutputs();

    for (int i = 0; i < outputs.length; i++) {
        Connector con = outputs[i];
        Connector target = con.getTarget();

        if (target == null)
            continue;

        float x1 = con.getX() + 6;
        float y1 = con.getY() + 6;
        float x2 = target.getX() + 6;
        float y2 = target.getY() + 6;

        float startX;
        if (x2 > x1) {
            startX = x1;
            shapeRenderer.setColor(Color.BLACK);
        } else {
            shapeRenderer.setColor(Color.BLUE);
            startX = x2;
        }

        float startY;
        if (y2 > y1)
            startY = y1;
        else
            startY = y2;

        if (cameraRect.overlaps(new Rectangle(startX, startY, Math.abs(x2 - x1), Math.abs(y2 - y1))) == false)
            continue;

        float d = 0;

        if (renderCurves) {
            d = Math.abs(y1 - y2);
            if (d > 100)
                d = 100; // limit
        }

        if (renderCurves)
            shapeRenderer.curve(x1, y1, x1 + d, y1, x2 - d, y2, x2, y2, 32); // connection line
        else
            shapeRenderer.line(x1, y1, x2 - 12, y2);

        rendered++;
    }

    return rendered;
}

From source file:qaida.app.Haraf.java

public void display() {
    batch.begin();//from   w ww .j av a2s .c o  m
    batch.draw(img, fX, fY);
    batch.end();
    shape.begin(ShapeRenderer.ShapeType.Filled);
    if (bShowDarker) {
        shape.setColor(Color.BLUE);
    } else {
        shape.setColor(Color.GREEN);
    }
    shape.rect(playButton.getX(), playButton.getY(), playButton.getWidth(), playButton.getHeight());
    shape.setColor(Color.WHITE);
    shape.triangle(playButton.getX() + 2, playButton.getY() + 18, playButton.getX() + 18,
            playButton.getY() + 10, playButton.getX() + 2, playButton.y + 2);
    shape.end();
}

From source file:releasethekraken.ui.CoinsDisplay.java

@Override
public void renderShapes(ShapeRenderer shapeRenderer, float delta, float runTime) {
    super.renderShapes(shapeRenderer, delta, runTime);

    shapeRenderer.setColor(Color.BLUE);
    shapeRenderer.rect(this.x, this.y, this.width, this.height);
}

From source file:releasethekraken.ui.PurchaseUnitUiButton.java

/**
 * Constructs a new PurchaseUnitUiButton
 * @param renderer The GameRenderer reference
 * @param x the X coordinate, in pixels//from www  . j  a  v a2s. c om
 * @param y the Y coordinate, in pixels
 * @param width The width, in percentage of the screen width
 * @param height The height, in percentage of the screen height
 * @param seaCreature The sea creature that the button sells
 */
public PurchaseUnitUiButton(GameRenderer renderer, float x, float y, float width, float height,
        Class<? extends EntitySeaCreature> seaCreature) {
    super(renderer, x, y, width, height, "Unit", Color.BLUE.cpy().sub(0.1F, 0.1F, 0.1F, 0));
    this.seaCreature = seaCreature;
    this.seaCreatureStats = EntitySeaCreature.getStats(seaCreature);
    this.cost = this.seaCreatureStats.cost;

    this.text = this.seaCreatureStats.name;
    this.setToolTip(new PurchaseUnitToolTip(renderer, seaCreature));
}