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

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

Introduction

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

Prototype

Color YELLOW

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

Click Source Link

Usage

From source file:airfoil.Main.java

License:Open Source License

protected final void renderMeshTriangles(Mesh mesh) {
    final ShaderProgram bodyShader = this.bodyShader;
    if (null != bodyShader) {

        if (null != mesh) {
            final Matrix4 camera = this.getCamera();

            bodyShader.begin();/*from  w  w  w  .ja v  a 2  s. c o m*/

            bodyShader.setUniformMatrix("u_camera", camera);
            bodyShader.setUniformf("u_color", Color.YELLOW);
            bodyShader.setUniformf("u_light", LightNormal);
            bodyShader.setUniformf("u_mat", Material);

            mesh.render(bodyShader, GL20.GL_TRIANGLES);

            bodyShader.end();
        }
    }
}

From source file:airfoil.Main.java

License:Open Source License

protected final void renderMeshLines(Mesh mesh) {
    final ShaderProgram axesShader = this.axesShader;
    if (null != axesShader) {

        if (null != mesh) {
            final Matrix4 camera = this.getCamera();

            axesShader.begin();/*from   ww w . ja va2  s .co m*/

            axesShader.setUniformMatrix("u_camera", camera);
            axesShader.setUniformf("u_color", Color.YELLOW);
            axesShader.setUniformf("u_light", LightNormal);
            axesShader.setUniformf("u_mat", Material);

            mesh.render(axesShader, GL20.GL_LINES);

            axesShader.end();
        }
    }
}

From source file:ateamproject.kezuino.com.github.render.screens.HighscoreScreen.java

public HighscoreScreen(Game game, boolean top10HighscoreReached) {
    super(game);/*w  ww.j  av a 2s  .c om*/

    TextButton btnBack = new TextButton("Terug", skin);
    btnBack.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            if (top10HighscoreReached) {
                game.setScreen(new CreditsScreen(game));
            } else {
                game.setScreen(new MainScreen(game));
            }
        }
    });
    float x = 240;
    float y = stage.getHeight() / 4;
    btnBack.setSize(200, 40);
    btnBack.setPosition(stage.getWidth() / 2 - btnBack.getWidth() / 2,
            stage.getHeight() / 4 - btnBack.getHeight() / 2);

    Label lblTitle = new Label("Highscore", skin);
    if (top10HighscoreReached) {
        lblTitle = new Label("Gefeliciteerd met een top 10 plek!", skin);
        btnBack.setText("Haal mijn prijs op");
    }
    lblTitle.setColor(Color.YELLOW);
    lblTitle.setPosition(stage.getWidth() / 2 - lblTitle.getWidth() / 2, stage.getHeight() - 50);

    PacketGetHighscores packet = new PacketGetHighscores(Client.getInstance().getId());
    Client.getInstance().send(packet);

    Table table = new Table();
    table.setSkin(skin);

    int rankNr = 0;

    for (Map.Entry<String, Integer> entry : packet.getResult().entrySet()) {
        rankNr++;
        table.add(new Label(Integer.toString(rankNr), skin)).padRight(50);
        table.add(new Label(entry.getKey(), skin)).padRight(50);
        table.add(new Label(Integer.toString(entry.getValue()), skin));
        table.row();
    }

    table.setPosition(stage.getWidth() / 2 - table.getWidth() / 2, stage.getHeight() - 190);

    stage.addActor(btnBack);
    stage.addActor(lblTitle);
    stage.addActor(table);

    backgroundMusic = Assets.getMusicStream("menu.mp3");
}

From source file:ateamproject.kezuino.com.github.render.screens.StoreScreen.java

public StoreScreen(Game game) {
    super(game);//ww w .j av  a  2 s.  c om
    Sound sound = Assets.manager.get("sounds/menu.mp3", Sound.class);
    if (sound != null) {
        sound.loop();
    }

    TextButton btnBack = new TextButton("Terug", skin);
    btnBack.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            if (sound != null) {
                sound.dispose();
            }
            game.setScreen(new MainScreen(game));

        }
    });
    float x = 240;
    float y = stage.getHeight() / 4;
    btnBack.setSize(200, 40);
    btnBack.setPosition(x, y);

    Label lblStore = new Label("Winkel", skin);
    lblStore.setColor(Color.YELLOW);
    lblStore.setPosition(x, y + 300);

    List listStoreItems = new List(skin);
    String[] skinsArray = { "Skin pack", "Minecraft pack" };
    listStoreItems.setItems((Object) skinsArray);
    listStoreItems.setPosition(x, y + 200);

    TextButton btnBuy = new TextButton("Koop item", skin);
    btnBuy.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            // game.setScreen(new HomeScreen(game));
        }
    });
    btnBuy.setSize(200, 40);
    btnBuy.setPosition(x - 50, y + 50);

    TextButton btnSelect = new TextButton("Selecteer item", skin);
    btnSelect.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            // game.setScreen(new HomeScreen(game));
        }
    });
    btnSelect.setSize(200, 40);
    btnSelect.setPosition(x + 50, y + 50);

    stage.addActor(btnBack);
    stage.addActor(lblStore);
    stage.addActor(listStoreItems);

    backgroundMusic = Assets.getMusicStream("menu.mp3");
}

From source file:base.MyGdxGame.java

License:Open Source License

@Override
public void render() {
    ArrayList<Texture> textures = new ArrayList<>();
    Gdx.gl.glClear(GL30.GL_COLOR_BUFFER_BIT); // clears the buffer
    batch.begin();/*from w  w w  . ja v a2s  .co  m*/
    LinkedList<PatternInstance> newList = new LinkedList<>();

    int x = Gdx.input.getX();
    int y = Gdx.input.getY();

    if (Gdx.input.isKeyJustPressed(Input.Keys.SPACE))
        willStep = !willStep;

    if (Gdx.input.isKeyJustPressed(Input.Keys.TAB))
        oneStep = true;

    if (Gdx.input.isTouched()) {
        if (Gdx.input.isKeyPressed(Input.Keys.SHIFT_LEFT))
            currentPatterns.add(new FrozenPatternInstance(
                    new PatternInstance(x, y - Gdx.graphics.getHeight() + 1, ONE_CELL, knownPatterns)));
        else
            currentPatterns
                    .add(new PatternInstance(x, y - Gdx.graphics.getHeight() + 1, ONE_CELL, knownPatterns));

    }

    for (ListIterator<PatternInstance> iter = currentPatterns.listIterator(); iter.hasNext();) {

        PatternInstance currentPatternInstance = iter.next();

        if (Gdx.input.isKeyJustPressed(Input.Keys.A))
            currentPatternInstance = new PatternInstance(currentPatternInstance.getX(),
                    currentPatternInstance.getY(), currentPatternInstance.getEntry());

        Texture tx = null;

        if (currentPatternInstance instanceof FrozenPatternInstance)
            tx = Engine.generatePatternTexture(currentPatternInstance.getEntry(), Color.CYAN);
        else
            tx = Engine.generatePatternTexture(currentPatternInstance.getEntry(), Color.YELLOW);

        if (currentPatternInstance.getRectangle().contains(x, y - Gdx.graphics.getHeight() + 1)) {
            tx = Engine.generatePatternTexture(currentPatternInstance.getEntry(), Color.MAGENTA);
            if (Gdx.input.isKeyJustPressed(Input.Keys.BACKSPACE)) {
                iter.remove();
                continue;
            }
        }

        if (willStep || oneStep) {
            PatternInstance[] successors = currentPatternInstance.step(actingRule, knownPatterns);
            for (PatternInstance i : successors)
                newList.add(i);
            batch.draw(tx, currentPatternInstance.getX(),
                    -currentPatternInstance.getY() - currentPatternInstance.getRectangle().getHeight() + 1);
        } else {
            newList.add(currentPatternInstance);
            batch.draw(tx, currentPatternInstance.getX(),
                    -currentPatternInstance.getY() - currentPatternInstance.getRectangle().getHeight() + 1);
        }

        textures.add(tx);

    }

    batch.end();

    Set<TreeSet<PatternInstance>> collisionSet = Engine.findCollisions(newList, 5);

    currentPatterns = Engine.cleanList(Engine.massMerge(collisionSet, newList, knownPatterns, actingRule));

    oneStep = false;

    for (Texture t : textures) {
        if (t != null)
            t.dispose();
    }

}

From source file:CB_UI.GL_UI.Views.MapView.java

License:Open Source License

public MapView(CB_RectF rec, MapMode Mode, String Name) {
    super(rec, Name);
    // statischen that nur setzen wenn die HauptMapView initialisiert wird
    if (Mode == MapMode.Normal) {
        that = this;
    } else {/*from w  w  w.  j  ava  2 s.com*/
        this.setOnDoubleClickListener(new OnClickListener() {

            @Override
            public boolean onClick(GL_View_Base v, int x, int y, int pointer, int button) {
                // Center own position!
                setCenter(Locator.getCoordinate());
                return true;
            }
        });
    }

    this.Mode = Mode;

    Config.MapsforgeDayTheme.addChangedEventListener(themeChangedEventHandler);
    Config.MapsforgeNightTheme.addChangedEventListener(themeChangedEventHandler);

    registerSkinChangedEvent();
    setBackground(Sprites.ListBack);
    int maxNumTiles = 0;
    // calculate max Map Tile cache
    try {
        int aTile = 256 * 256;
        maxTilesPerScreen = (int) ((rec.getWidth() * rec.getHeight()) / aTile + 0.5);

        maxNumTiles = (int) (maxTilesPerScreen * 6);// 6 times as much as necessary

    } catch (Exception e) {
        maxNumTiles = 60;
    }

    maxNumTiles = Math.min(maxNumTiles, 60);
    maxNumTiles = Math.max(maxNumTiles, 20);

    mapTileLoader.setMaxNumTiles(maxNumTiles);

    mapScale = new MapScale(new CB_RectF(GL_UISizes.margin, GL_UISizes.margin, this.getHalfWidth(),
            GL_UISizes.ZoomBtn.getHalfWidth() / 4), "mapScale", this, Config.ImperialUnits.getValue());

    if (Mode == MapMode.Normal) {
        this.addChild(mapScale);
    } else {
        mapScale.setInvisible();
    }

    // initial Zoom Buttons
    zoomBtn = new ZoomButtons(GL_UISizes.ZoomBtn, this, "ZoomButtons");

    zoomBtn.setX(this.getWidth() - (zoomBtn.getWidth() + UI_Size_Base.that.getMargin()));

    zoomBtn.setOnClickListenerDown(new OnClickListener() {
        @Override
        public boolean onClick(GL_View_Base v, int x, int y, int pointer, int button) {
            // bei einer Zoom Animation in negativer Richtung muss der setDiffCameraZoom gesetzt werden!
            // zoomScale.setDiffCameraZoom(-1.9f, true);
            // zoomScale.setZoom(zoomBtn.getZoom());
            zoomScale.resetFadeOut();
            inputState = InputState.Idle;

            lastDynamicZoom = zoomBtn.getZoom();

            kineticZoom = new KineticZoom(camera.zoom, MapTileLoader.getMapTilePosFactor(zoomBtn.getZoom()),
                    System.currentTimeMillis(), System.currentTimeMillis() + ZoomTime);
            GL.that.addRenderView(MapView.this, GL.FRAME_RATE_ACTION);
            GL.that.renderOnce();
            calcPixelsPerMeter();
            return true;
        }
    });
    zoomBtn.setOnClickListenerUp(new OnClickListener() {
        @Override
        public boolean onClick(GL_View_Base v, int x, int y, int pointer, int button) {
            setZoomScale(zoomBtn.getZoom());
            zoomScale.resetFadeOut();
            inputState = InputState.Idle;

            lastDynamicZoom = zoomBtn.getZoom();

            kineticZoom = new KineticZoom(camera.zoom, MapTileLoader.getMapTilePosFactor(zoomBtn.getZoom()),
                    System.currentTimeMillis(), System.currentTimeMillis() + ZoomTime);
            GL.that.addRenderView(MapView.this, GL.FRAME_RATE_ACTION);
            GL.that.renderOnce();
            calcPixelsPerMeter();
            return true;
        }
    });

    if (Mode == MapMode.Compass) {
        zoomBtn.setInvisible();
    } else {
        this.addChild(zoomBtn);
        zoomBtn.setMinimumFadeValue(0.25f);
    }

    this.setOnClickListener(onClickListener);

    float InfoHeight = 0;
    if (Mode == MapMode.Normal) {
        info = (MapInfoPanel) this.addChild(new MapInfoPanel(GL_UISizes.Info, "InfoPanel", this));
        InfoHeight = info.getHeight();
    }

    CB_RectF ZoomScaleRec = new CB_RectF();
    ZoomScaleRec.setSize((float) (44.6666667 * GL_UISizes.DPI),
            this.getHeight() - InfoHeight - (GL_UISizes.margin * 4) - zoomBtn.getMaxY());
    ZoomScaleRec.setPos(new Vector2(GL_UISizes.margin, zoomBtn.getMaxY() + GL_UISizes.margin));

    zoomScale = new ZoomScale(ZoomScaleRec, "zoomScale", 2, 21, 12);
    if (Mode == MapMode.Normal)
        this.addChild(zoomScale);

    mapIntWidth = (int) rec.getWidth();
    mapIntHeight = (int) rec.getHeight();
    drawingWidth = mapIntWidth;
    drawingHeight = mapIntHeight;

    InitializeMap();

    // initial Zoom Scale
    // zoomScale = new GL_ZoomScale(6, 20, 13);

    mapCacheList = new MapViewCacheList(MapTileLoader.MAX_MAP_ZOOM);

    // from create

    String[] currentLayerNames = Config.CurrentMapLayer.getValue();
    if (ManagerBase.Manager != null) {
        if (mapTileLoader.getCurrentLayer() == null) {
            mapTileLoader.setCurrentLayer(
                    ManagerBase.Manager.getOrAddLayer(currentLayerNames, currentLayerNames[0], ""));
        }
    }

    String[] currentOverlayLayerName = new String[] { Config.CurrentMapOverlayLayer.getValue() };
    if (ManagerBase.Manager != null) {
        if (mapTileLoader.getCurrentOverlayLayer() == null && currentOverlayLayerName[0].length() > 0)
            mapTileLoader.setCurrentOverlayLayer(
                    ManagerBase.Manager.getOrAddLayer(currentOverlayLayerName, currentOverlayLayerName[0], ""));
    }

    iconFactor = Config.MapViewDPIFaktor.getValue();

    liveButton = new LiveButton();
    liveButton.setState(Config.LiveMapEnabeld.getDefaultValue());
    Config.DisableLiveMap.addChangedEventListener(new IChanged() {
        @Override
        public void isChanged() {
            requestLayout();
        }
    });

    togBtn = new MultiToggleButton(GL_UISizes.Toggle, "toggle");

    togBtn.addState("Free", new HSV_Color(Color.GRAY));
    togBtn.addState("GPS", new HSV_Color(Color.GREEN));
    togBtn.addState("WP", new HSV_Color(Color.MAGENTA));
    togBtn.addState("Lock", new HSV_Color(Color.RED));
    togBtn.addState("Car", new HSV_Color(Color.YELLOW));
    togBtn.setLastStateWithLongClick(true);

    MapState last = MapState.values()[Config.LastMapToggleBtnState.getValue()];
    togBtn.setState(last.ordinal());

    togBtn.setOnStateChangedListener(new OnStateChangeListener() {

        @Override
        public void onStateChange(GL_View_Base v, int State) {
            setMapState(MapState.values()[State]);
        }
    });
    togBtn.registerSkinChangedEvent();

    switch (Mode) {
    case Compass:
        setMapState(MapState.GPS);
        break;
    case Normal:
        setMapState(last);
        break;
    case Track:
        setMapState(MapState.FREE);
        break;
    }

    if (Mode == MapMode.Normal) {
        switch (Config.LastMapToggleBtnState.getValue()) {
        case 0:
            info.setCoordType(CoordType.Map);
            break;
        case 1:
            info.setCoordType(CoordType.GPS);
            break;
        case 2:
            info.setCoordType(CoordType.Cache);
            break;
        case 3:
            info.setCoordType(CoordType.GPS);
            break;
        case 4:
            info.setCoordType(CoordType.GPS);
            break;
        }
    }

    if (Mode == MapMode.Normal) {
        this.addChild(togBtn);
        if (Config.DisableLiveMap.getValue()) {
            liveButton.setState(false);
        }
        this.addChild(liveButton);
    }

    infoBubble = new InfoBubble(GL_UISizes.Bubble, "infoBubble");
    infoBubble.setInvisible();
    infoBubble.setOnClickListener(new OnClickListener() {
        @Override
        public boolean onClick(GL_View_Base v, int x, int y, int pointer, int button) {
            if (infoBubble.saveButtonClicked(x, y)) {
                wd = CancelWaitDialog.ShowWait(Translation.Get("ReloadCacheAPI"),
                        DownloadAnimation.GetINSTANCE(), new IcancelListener() {
                            @Override
                            public void isCanceld() {

                            }
                        }, new cancelRunnable() {

                            @Override
                            public void run() {
                                String GcCode = infoBubble.getCache().getGcCode();

                                SearchGC searchC = new SearchGC(GcCode);
                                searchC.number = 1;
                                searchC.available = false;

                                CB_List<Cache> apiCaches = new CB_List<Cache>();
                                ArrayList<LogEntry> apiLogs = new ArrayList<LogEntry>();
                                ArrayList<ImageEntry> apiImages = new ArrayList<ImageEntry>();

                                try {
                                    CB_UI.SearchForGeocaches.getInstance().SearchForGeocachesJSON(searchC,
                                            apiCaches, apiLogs, apiImages,
                                            infoBubble.getCache().getGPXFilename_ID(), this);
                                    Cache c = apiCaches.get(0);
                                    if (c.getGcCode() == GcCode) {
                                        c.setApiStatus(Cache.NOTLITE);
                                    }
                                    GroundspeakAPI.WriteCachesLogsImages_toDB(apiCaches, apiLogs, apiImages);
                                } catch (InterruptedException e) {
                                    e.printStackTrace();
                                }

                                // Reload result from DB
                                synchronized (Database.Data.Query) {
                                    String sqlWhere = FilterInstances.getLastFilter()
                                            .getSqlWhere(Config.GcLogin.getValue());
                                    CacheListDAO cacheListDAO = new CacheListDAO();
                                    cacheListDAO.ReadCacheList(Database.Data.Query, sqlWhere, false,
                                            Config.ShowAllWaypoints.getValue());
                                }

                                CacheListChangedEventList.Call();
                                Cache selCache = Database.Data.Query.GetCacheByGcCode(GcCode);
                                GlobalCore.setSelectedCache(selCache);
                                infoBubble.setCache(selCache, null, true);
                                wd.close();
                            }

                            @Override
                            public boolean cancel() {
                                // TODO handle cancel
                                return false;
                            }
                        });
            } else {
                if (infoBubble.getWaypoint() == null) {
                    // Wenn ein Cache einen Final waypoint hat dann soll gleich dieser aktiviert werden
                    Waypoint waypoint = infoBubble.getCache().GetFinalWaypoint();
                    // wenn ein Cache keine Final hat, aber einen StartWaypointm, dann wird dieser gleich selektiert
                    if (waypoint == null)
                        waypoint = infoBubble.getCache().GetStartWaypoint();
                    GlobalCore.setSelectedWaypoint(infoBubble.getCache(), waypoint);
                } else {
                    GlobalCore.setSelectedWaypoint(infoBubble.getCache(), infoBubble.getWaypoint());
                }
            }

            infoBubble.setInvisible();
            return true;
        }
    });
    if (Mode == MapMode.Normal)
        this.addChild(infoBubble);

    resize(rec.getWidth(), rec.getHeight());

    try {
        center = new CoordinateGPS(Config.MapInitLatitude.getValue(), Config.MapInitLongitude.getValue());
    } catch (Exception e) {
        e.printStackTrace();
    }

    // Info aktualisieren
    if (Mode == MapMode.Normal)
        info.setCoord(center);
    aktZoom = Config.lastZoomLevel.getValue();
    zoomBtn.setZoom(aktZoom);
    calcPixelsPerMeter();
    mapScale.zoomChanged();

    if ((center.getLatitude() == -1000) && (center.getLongitude() == -1000)) {
        // not initialized
        center = new CoordinateGPS(48, 12);
    }

    // Initial SettingsChanged Events
    MapView.that.SetNightMode(Config.nightMode.getValue());
    Config.nightMode.addChangedEventListener(new IChanged() {
        @Override
        public void isChanged() {
            MapView.this.SetNightMode(Config.nightMode.getValue());
        }
    });

    MapView.that.SetNorthOriented(Config.MapNorthOriented.getValue());
    Config.MapNorthOriented.addChangedEventListener(new IChanged() {

        @Override
        public void isChanged() {
            MapView.this.SetNorthOriented(Config.MapNorthOriented.getValue());
            MapView.this.PositionChanged();
        }
    });

}

From source file:CB_UI.RouteOverlay.java

License:Open Source License

private static void initialColorField() {
    ColorField[0] = Color.RED;//from  ww w  .j  a va  2  s.c om
    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:ch.coldpixel.game.MapDrawing.java

public void background() {
    shape.begin(ShapeRenderer.ShapeType.Filled);
    shape.rect(0, 0, LEVEL_1_WIDTH, LEVEL_1_HEIGTH, Color.BLUE, Color.BLUE, Color.ORANGE, Color.ORANGE);
    shape.setColor(Color.YELLOW);
    shape.circle(100, WINDOW_HEIGTH - 100, 50, 5);
    shape.end();/*w  w w  .j  a  v a  2  s . com*/
}

From source file:com.a2client.gui.test.gui_drag_container.java

License:Open Source License

public void DoRender() {
    if (drag_above_me)
        GUIGDX.FillRect(abs_pos, size, Color.YELLOW);
    else if (have_some)
        GUIGDX.FillRect(abs_pos, size, Color.RED);
    else//w  w  w  .j a  v  a2 s . c om
        GUIGDX.FillRect(abs_pos, size, Color.WHITE);
}

From source file:com.bss.game.World.java

License:Apache License

public World(WorldListener listener) {
    this.slappy = new SlappySeal(-10f, 95f);
    ////from w  ww. j  a  v  a2  s  .  c o  m
    this.hook = new Hook(80f, 250f, this);
    //this.boot = new Boot(480f, 400f, this, 0);
    //this.trout = new Trout(200f, 800f, this, 0);
    pointPosition = new Vector2();
    //this.hook.velocity.setAngle(90f);
    //
    /*this.platforms = new ArrayList<Platform>();
    this.springs = new ArrayList<Spring>();
    this.squirrels = new ArrayList<Squirrel>();
    this.coins = new ArrayList<Coin>();*/
    this.listener = listener;
    rand = new Random();
    //generateLevel();

    //this.heightSoFar = 0;
    //this.score = 0;

    time = 10;
    timeText = "" + time;
    layout = new GlyphLayout(Assets.font, timeText, Color.YELLOW, 0f, 0, false);
    //layout.setText(font, timeText, Color.BLACK, 0f, 0, false);

    this.state = WORLD_STATE_RUNNING;
    i = new Intersector();
    eh = new EllipseHit(10);

    enemies = new ArrayList<EnemyGameObject>();
    hookedEnemies = new ArrayList<EnemyGameObject>();
    setEnemiesFirst();
    hookedFish = 0;
}