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:be.ac.ucl.lfsab1509.bouboule.game.screen.AbstractScreen.java

License:Open Source License

public AbstractScreen(boolean bMusicNeedsDelay) {
    this.bMusicNeedsDelay = bMusicNeedsDelay;
    this.stage = new Stage(GlobalSettings.APPWIDTH, GlobalSettings.APPHEIGHT, true);
    // Added the camera to enter the screen (black borders on each side)
    this.stage.setCamera(GlobalSettings.GAME.getCamera());

    if (GlobalSettings.GAME.isGdxMenus()) { // for the transition
        spriteFade = new Sprite(new Texture(new Pixmap(1, 1, Format.RGB888)));
        spriteFade.setColor(Color.BLACK);
        spriteFade.setSize(GlobalSettings.APPWIDTH, GlobalSettings.APPHEIGHT);
    }//from   ww  w. j ava2s  . c  o  m
    textureList = new ArrayList<Texture>();
}

From source file:br.com.raphaelbruno.game.zombieinvaders.vr.model.ScreenBase.java

License:Apache License

private void setupUi() {
    target = AssetRepository.getInstance().load(TEXTURE_TARGET, Texture.class);
    scoreValue = 0;//from   w  w  w  .  j ava 2 s  .co  m
    score = FontUtils.loadFont("fonts/cartoon_shout.ttf", 42, Color.BLACK);
}

From source file:broken.shotgun.throwthemoon.actors.Boss.java

License:Open Source License

public void takeDamage(int direction) {
    health--;/*from   w w w . j  a va  2 s .co m*/

    hitSfx.play();

    if (health <= 0) {
        die();
        return;
    }

    if (health <= 20) {
        rage();
    }

    addAction(sequence(color(Color.BLACK, 0.10f), color(color, 0.10f)));
}

From source file:broken.shotgun.throwthemoon.actors.Boss.java

License:Open Source License

private void die() {
    clearActions();
    addAction(color(Color.BLACK, 0.5f));
}

From source file:broken.shotgun.throwthemoon.actors.Enemy.java

License:Open Source License

public void takeDamage(int direction) {
    health--;// w ww. jav a 2  s  . c  o m

    hitSfx.play();

    if (health <= 0) {
        die();
        return;
    }

    addAction(sequence(
            parallel(Actions.moveBy(20 * direction, 0, 0.3f, Interpolation.circleOut),
                    sequence(color(Color.BLACK, 0.15f), color(Color.WHITE, 0.15f))),
            Actions.moveTo(getX(), getY(), 0.1f, Interpolation.circleIn)));
}

From source file:broken.shotgun.throwthemoon.actors.Player.java

License:Open Source License

public void takeDamage() {
    if (takingDamage)
        return;/*from ww  w.  ja v a  2 s .  com*/

    takingDamage = true;

    hitSfx.play();

    addAction(sequence(
            sequence(color(Color.BLACK, 0.25f), color(Color.WHITE, 0.25f), color(Color.BLACK, 0.25f),
                    color(Color.WHITE, 0.25f), color(Color.BLACK, 0.25f), color(Color.WHITE, 0.25f)),
            run(new Runnable() {
                @Override
                public void run() {
                    takingDamage = false;
                }
            })));
}

From source file:CB_Locator.Map.MapViewBase.java

License:Open Source License

protected void renderDebugInfo(Batch batch) {

    CB_RectF r = this.thisWorldRec;

    Gdx.gl.glDisable(GL20.GL_SCISSOR_TEST);

    BitmapFont font = Fonts.getNormal();

    font.setColor(Color.BLACK);

    Matrix4 def = new Matrix4().setToOrtho2D(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    def.translate(r.getX(), r.getY(), 1);
    batch.setProjectionMatrix(def);//w w w.  j a v  a  2  s  .c  o  m

    // str = debugString;
    font.draw(batch, str, 20, 120);

    str = "fps: " + Gdx.graphics.getFramesPerSecond();
    font.draw(batch, str, 20, 100);

    str = String.valueOf(aktZoom) + " - camzoom: " + Math.round(camera.zoom * 100) / 100;
    font.draw(batch, str, 20, 80);

    str = "lTiles: " + mapTileLoader.LoadedTilesSize() + " - qTiles: " + mapTileLoader.QueuedTilesSize();
    font.draw(batch, str, 20, 60);

    str = "lastMove: " + lastMovement.x + " - " + lastMovement.y;
    font.draw(batch, str, 20, 20);
    Gdx.gl.glEnable(GL20.GL_SCISSOR_TEST);
}

From source file:CB_UI.GL_UI.Activitys.MeasureCoordinate.java

License:Open Source License

private void repaintPreview() {
    if (inRepaint.get())
        return;/*from ww  w.  j  a  va 2s  .  co m*/
    inRepaint.set(true);

    disposeTexture();

    CB_RectF panelRec = new CB_RectF(leftBorder, bOK.getMaxY(), innerWidth, innerWidth);

    int w = (int) panelRec.getWidth();
    int h = (int) panelRec.getHeight();

    drawingPixmap = new Pixmap(w, h, Pixmap.Format.RGBA8888);

    drawingPixmap.setColor(Color.LIGHT_GRAY);
    drawingPixmap.fillRectangle(0, 0, (int) panelRec.getWidth(), (int) panelRec.getHeight());

    int centerX = (int) panelRec.getHalfWidth();
    int centerY = (int) panelRec.getHalfHeight();

    float minPix = Math.min(panelRec.getWidth(), panelRec.getHeight());

    try {
        synchronized (mMeasureList) {

            if (mMeasureList.size() > 0) {
                // Gemittelter Punkt der GPS-Messungen
                double medianLat = MeasuredCoord.Referenz.getLatitude();
                double medianLon = MeasuredCoord.Referenz.getLongitude();

                MeasuredCoordList sortetdList = (MeasuredCoordList) mMeasureList.clone();
                sortetdList.sort();

                double peakLat = Math.max(Math.abs(sortetdList.get(0).getLatitude() - medianLat),
                        Math.abs(sortetdList.get(sortetdList.size() - 1).getLatitude() - medianLat));
                double peakLon = Math.max(Math.abs(sortetdList.get(0).getLongitude() - medianLon),
                        Math.abs(sortetdList.get(sortetdList.size() - 1).getLongitude() - medianLon));

                // Umrechnung in XY
                double medianX = Descriptor.LongitudeToTileX(projectionZoom, medianLon);
                double medianY = Descriptor.LatitudeToTileY(projectionZoom, medianLat);

                double extremeX = Descriptor.LongitudeToTileX(projectionZoom, peakLon + medianLon);
                double extremeY = Descriptor.LatitudeToTileY(projectionZoom, peakLat + medianLat);

                double peakX = Math.abs(extremeX - medianX);
                double peakY = Math.abs(extremeY - medianY);

                double maxPeak = Math.max(peakX, peakY);

                double factor = 1;
                if (maxPeak > 0)
                    factor = minPix / maxPeak;

                factor /= 2;

                int x = (int) centerX;
                int y = (int) centerY;

                // Track zeichnen

                for (int i = 1; i < mMeasureList.size(); i++) {

                    PointD lastDrawEntry = Descriptor.projectCoordinate(mMeasureList.get(i - 1).getLatitude(),
                            mMeasureList.get(i - 1).getLongitude(), projectionZoom);

                    int lastX = (int) (centerX + (lastDrawEntry.X - medianX) * factor);
                    int lastY = (int) (centerY - (lastDrawEntry.Y - medianY) * factor);

                    PointD thisDrawEntry = Descriptor.projectCoordinate(mMeasureList.get(i).getLatitude(),
                            mMeasureList.get(i).getLongitude(), projectionZoom);

                    x = (int) (centerX + (thisDrawEntry.X - medianX) * factor);
                    y = (int) (centerY - (thisDrawEntry.Y - medianY) * factor);

                    drawingPixmap.setColor(Color.RED);
                    drawingPixmap.drawLine(lastX, lastY, x, y);

                }

                drawingPixmap.setColor(Color.BLUE);
                drawingPixmap.drawCircle(x, y, 4);
            }
        }
        //
        int m2 = (int) ((4 * minPix) / metersPerTile);
        int m4 = m2 * 2;

        drawingPixmap.setColor(Color.BLACK);
        drawingPixmap.drawCircle(centerX, centerY, m2);
        drawingPixmap.drawCircle(centerX, centerY, m4);

        drawingPixmap.drawLine(centerX, 0, centerX, (int) panelRec.getHeight());
        drawingPixmap.drawLine(0, centerY, (int) panelRec.getWidth(), centerY);

        drawingTexture = new Texture(drawingPixmap);

        drawing = new Sprite(drawingTexture, (int) panelRec.getWidth(), (int) panelRec.getHeight());
        drawing.setX(leftBorder);
        drawing.setY(bOK.getMaxY() + this.getBottomHeight());

        inRepaint.set(false);
    } catch (Exception e) {
        e.printStackTrace();
    }

    redraw = false;

    GL.that.renderOnce();
}

From source file:CB_UI.RouteOverlay.java

License:Open Source License

private static void initialColorField() {
    ColorField[0] = Color.RED;/*from w w w. ja va2s. co  m*/
    ColorField[1] = Color.YELLOW;
    ColorField[2] = Color.BLACK;
    ColorField[3] = Color.LIGHT_GRAY;
    ColorField[4] = Color.GREEN;
    ColorField[5] = Color.BLUE;
    ColorField[6] = Color.CYAN;
    ColorField[7] = Color.GRAY;
    ColorField[8] = Color.MAGENTA;
    ColorField[9] = Color.ORANGE;
    ColorField[10] = Color.DARK_GRAY;
    ColorField[11] = Color.PINK;
    ColorField[12] = Color.WHITE;
}

From source file:CB_UI_Base.GL_UI.Activitys.ColorPicker.java

License:Open Source License

private void createTest() {
    CB_RectF rec = new CB_RectF(leftBorder + margin, viewHue.getY(), viewHue.getX() - margin * 3 - leftBorder,
            viewHue.getHeight());//from w  ww  . j a v  a  2s .c  o m

    viewSatVal = new ColorPickerRec(rec, "");
    this.addChild(viewSatVal);

    {
        // Gradiant Test

        // Color blackTransparent = new Color(1f, 1f, 0f, 0.2f);
        // gradiantBlack = new GradiantFill(Color.BLACK, blackTransparent, -30);
        // rectangle FillRecBlack = new rectangle(rec, gradiantBlack);
        // this.addChild(FillRecBlack);
    }

    Color whiteTransparent = new Color(1f, 1f, 1f, 0f);
    gradiantWhite = new GradiantFill(Color.WHITE, whiteTransparent, 0);
    GradiantFilledRectangle FillRecWhite = new GradiantFilledRectangle(rec, gradiantWhite);
    this.addChild(FillRecWhite);

    Color blackTransparent = new Color(0f, 0f, 0f, 0f);
    gradiantBlack = new GradiantFill(Color.BLACK, blackTransparent, 90);
    GradiantFilledRectangle FillRecBlack = new GradiantFilledRectangle(rec, gradiantBlack);
    this.addChild(FillRecBlack);

    float cursorSize = Fonts.Measure("T").height;

    viewTarget = new Image(0, 0, cursorSize, cursorSize, "", false);
    viewTarget.setDrawable(new SpriteDrawable(Sprites.ambilwarna_target));
    this.addChild(viewTarget);

}