List of usage examples for com.badlogic.gdx.graphics Color WHITE
Color WHITE
To view the source code for com.badlogic.gdx.graphics Color WHITE.
Click Source Link
From source file:kyle.game.besiege.MainMenuScreen.java
License:Open Source License
private void clickNew() { topTable.clear();/*w ww . java 2 s.co m*/ topTable.add(labelTitle).colspan(2).padBottom(PAD); topTable.row(); Label prompt = new Label("Who are you?", styleButtons); topTable.add(prompt).expandX().center().colspan(2); topTable.row(); TextFieldStyle tfs = new TextFieldStyle(); tfs.fontColor = Color.WHITE; tfs.font = Assets.pixel64; TextField tf = new TextField("", tfs); TextField tf2 = new TextField("", tfs); tf2.setVisible(false); topTable.add(tf).expandX().center().colspan(2).width(300); tf.setMaxLength(MAX_NAME); topTable.row(); topTable.add(tf2).colspan(2).height(0); // needed to autoselect tf.next(true); tf.setTextFieldFilter(new TextFieldFilter() { public boolean acceptChar(TextField textField, char key) { return true; } }); tf.addListener(new InputListener() { public boolean keyDown(InputEvent event, int keyCode) { if (keyCode == Input.Keys.ENTER) enterName(((TextField) event.getTarget()).getText()); return true; } }); tf2.next(false); }
From source file:kyle.game.besiege.panels.BottomPanel.java
License:Open Source License
public static void log(String text, String color) { Color fontColor;//from ww w . j ava 2 s. c om if (color == "red") fontColor = new Color(230 / 255f, 0, 15 / 255f, 1); else if (color == "orange") fontColor = new Color(1, 60 / 255f, 0, 1); else if (color == "yellow") fontColor = Color.YELLOW; else if (color == "cyan") fontColor = Color.CYAN; else if (color == "magenta") fontColor = Color.MAGENTA; else if (color == "white") fontColor = Color.WHITE; else if (color == "green") fontColor = Color.GREEN; else if (color == "blue") fontColor = new Color(0, 70 / 255f, 1, 1); else if (color == "purple") fontColor = new Color(168 / 255f, 0, 1, 1); else fontColor = Color.WHITE; LabelStyle lsNew = new LabelStyle(ls); lsNew.fontColor = fontColor; Label temp = new Label(text, lsNew); // Memory leak, should change to have 4 or 5 fixed colors so new one is not created everytime. logTable.row(); logTable.add(temp); logging = 0; ls.fontColor = Color.WHITE; }
From source file:kyle.game.besiege.title.MainMenuScreen.java
License:Open Source License
private void setNewOff() { labelNew.setColor(Color.WHITE); }
From source file:kyle.game.besiege.title.MainMenuScreen.java
License:Open Source License
private void setLoadOff() { labelLoad.setColor(Color.WHITE); }
From source file:kyle.game.besiege.title.MainMenuScreen.java
License:Open Source License
private void clickNew() { topTable.clear();/*from www . jav a2 s . c om*/ topTable.add(labelTitle).colspan(2).padBottom(PAD); topTable.row(); Label prompt = new Label("Who are you?", styleButtons); topTable.add(prompt).expandX().center().colspan(2); topTable.row(); TextFieldStyle tfs = new TextFieldStyle(); tfs.fontColor = Color.WHITE; tfs.font = Assets.pixel64; tf = new TextField("", tfs); TextField tf2 = new TextField("", tfs); tf2.setVisible(false); topTable.add(tf).center().colspan(2); tf.setMaxLength(MAX_NAME); topTable.row(); topTable.add(tf2).colspan(2).height(0); // needed to autoselect tf.next(true); tf.setTextFieldFilter(new TextFieldFilter() { public boolean acceptChar(TextField textField, char key) { expand(); // System.out.println("Hello"); return true; } }); tf.addListener(new InputListener() { public boolean keyDown(InputEvent event, int keyCode) { if (keyCode == Input.Keys.ENTER) enterName(((TextField) event.getTarget()).getText()); return true; } }); tf2.next(false); }
From source file:ldtk.demo1.WorldRenderer.java
public void setup() { // Load the textures (CC0 licensed textures from http://opengameart.org) and make sure that they wrap. backgroundTexture = Kernel.images.get("textures/stones").region().getTexture(); backgroundTexture.setWrap(TextureWrap.Repeat, TextureWrap.Repeat); midgroundTexture = Kernel.images.get("textures/building").region().getTexture(); midgroundTexture.setWrap(TextureWrap.Repeat, TextureWrap.Repeat); foregroundTexture = Kernel.images.get("textures/grass").region().getTexture(); foregroundTexture.setWrap(TextureWrap.Repeat, TextureWrap.Repeat); // Create the landscape renderers. Landscape[] landscapes = world.landscapes(); landscapeRenderers = new LandscapeRenderer[landscapes.length]; landscapeRenderers[World.BACKGROUND_LAYER] = new LandscapeRenderer(landscapes[World.BACKGROUND_LAYER], backgroundTexture, Color.DARK_GRAY); landscapeRenderers[World.MIDGROUND_LAYER] = new LandscapeRenderer(landscapes[World.MIDGROUND_LAYER], midgroundTexture, Color.GRAY); landscapeRenderers[World.FOREGROUND_LAYER] = new LandscapeRenderer(landscapes[World.FOREGROUND_LAYER], foregroundTexture, Color.WHITE); }
From source file:lib.Game.java
/** * /*w w w. j a va2 s . com*/ */ @Override public void render() { camera.update(); Gdx.gl.glClearColor(1, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); update((long) (Gdx.graphics.getDeltaTime() * 1000.0)); ctx.getBatch().setProjectionMatrix(camera.combined); ctx.begin(); ctx.batch.setColor(Color.WHITE); renderInContext(ctx); ctx.end(); }
From source file:ludowars.gui.HUDLayer.java
@Override public void render(SpriteBatch batch, ShapeRenderer sr, float delta) { super.render(batch, sr, delta); // animated health display if (animationTime <= HEALTH_ANIMATION_TIME) { animationTime = Math.min(animationTime + delta, HEALTH_ANIMATION_TIME); currentHealth = oldHealth + (targetHealth - oldHealth) * Interpolation.exp5Out.apply(animationTime / HEALTH_ANIMATION_TIME); health = "" + (int) currentHealth; }// w ww . j a v a2s . com float textHeight = font.getBounds("100").height; font.setColor(Color.BLACK); font.draw(batch, health, 20 + heart.getWidth() + 20 + 2, 20 + textHeight + 8 - 2); font.setColor(Color.WHITE); font.draw(batch, health, 20 + heart.getWidth() + 20, 20 + textHeight + 8); float lerp = 0.1f; float newX = backpack_open.getBounds().x + (backpackPosition.x - backpack_open.getBounds().x) * lerp; float newY = backpack_open.getBounds().y + (backpackPosition.y - backpack_open.getBounds().y) * lerp; backpack_open.setPosition(newX, newY); }
From source file:maze.maker.Cell.java
public void draw() { if (bVisited) { shape.begin(ShapeRenderer.ShapeType.Filled); shape.setColor(Color.GRAY); shape.rect(fDx, fDy, scl, scl);/*from w ww . j a v a 2s. c o m*/ shape.end(); } if (bMazeFinished) { if (bStart) { shape.begin(ShapeRenderer.ShapeType.Filled); shape.setColor(Color.BLUE); shape.rect(fDx, fDy, scl, scl); shape.end(); } else if (bTarget) { shape.begin(ShapeRenderer.ShapeType.Filled); shape.setColor(Color.RED); shape.rect(fDx, fDy, scl, scl); shape.end(); } else if (bHighlight) { shape.begin(ShapeRenderer.ShapeType.Filled); shape.setColor(Color.WHITE); shape.rect(fDx, fDy, scl, scl); // shape.triangle(fDx, fDy, fDx, fDy + scl, fDx + scl, fDy + scl / 2); // shape.circle(fDx + scl/2, fDy + scl/2, scl/2); shape.end(); } else if (bChecked) { shape.begin(ShapeRenderer.ShapeType.Filled); shape.setColor(Color.BROWN); shape.rect(fDx, fDy, scl, scl); shape.end(); } } shape.begin(ShapeRenderer.ShapeType.Line); shape.setColor(Color.BLACK); if (Sides[0]) {// top shape.rectLine(fDx, fDy + scl - fWidth, fDx + scl, fDy + scl + fWidth, fWidth * 2); } if (Sides[1]) {// bottom shape.rectLine(fDx, fDy - fWidth, fDx + scl, fDy + fWidth, fWidth * 2); // shape.line(0, 0, w, h); } if (Sides[2]) {// left shape.rectLine(fDx - fWidth, fDy, fDx + fWidth, fDy + scl, fWidth * 2); } if (Sides[3]) {// right shape.rectLine(fDx + scl - fWidth, fDy, fDx + scl + fWidth, fDy + scl, fWidth * 2); } shape.end(); }
From source file:me.scarlet.undertailor.gfx.MultiRenderer.java
License:Open Source License
/** * Resets the colors to their default./* w w w . j a v a 2s. c om*/ */ public void resetColors() { if (!this.getClearColor().equals(Color.BLACK)) { this.setClearColor(Color.BLACK); } if (!this.getBatchColor().equals(Color.WHITE)) { this.setBatchColor(Color.WHITE); } if (!this.getShapeColor().equals(Color.WHITE)) { this.setShapeColor(Color.WHITE); } }