List of usage examples for com.badlogic.gdx.graphics Color RED
Color RED
To view the source code for com.badlogic.gdx.graphics Color RED.
Click Source Link
From source file:ludowars.view.ZombieRepresentation.java
public void drawHealth(ShapeRenderer s, Vector3 sv, CharacterData data) { if (data.getHealth() <= 0) return;/*from www . j av a 2 s.c om*/ float healthWidth = data.getHealth() / data.maxHealth * 40; s.begin(ShapeRenderer.ShapeType.Filled); s.setColor(Color.valueOf("FFAA00")); s.rect(sv.x - 12 - 4, sv.y + 36, 40, 8); s.end(); if (data.getHealth() > 0) { s.begin(ShapeRenderer.ShapeType.Filled); s.setColor(Color.RED); s.rect(sv.x - 12 + 2 - 4, sv.y + 36 + 2, healthWidth - 4, 8 - 4); s.end(); } }
From source file:managers.HealthBarManager.java
public void drawHealthBar(ShapeRenderer sr, World world, Camera camera) { for (Entity e : world.getEntities(PLAYER, ENEMY)) { float x = e.get(Position.class).getX(); float y = e.get(Position.class).getY(); int eHeight = e.get(Body.class).getHeight(); sr.setColor(Color.BLACK); sr.begin(ShapeRenderer.ShapeType.Filled); sr.rect(x, y + eHeight + 9, (float) (e.get(Health.class).getMaxHp() / 2), 12); sr.setProjectionMatrix(camera.combined); sr.end();//from www. j a v a 2s.c o m sr.setColor(Color.RED); sr.begin(ShapeRenderer.ShapeType.Filled); sr.rect(x, y + eHeight + 10, (float) (e.get(Health.class).getMaxHp() / 2), 10); sr.setProjectionMatrix(camera.combined); sr.end(); sr.setColor(Color.GREEN); sr.begin(ShapeRenderer.ShapeType.Filled); sr.rect(x, y + eHeight + 10, e.get(Health.class).getHp() / 2, 10); sr.setProjectionMatrix(camera.combined); sr.end(); } }
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 ww w.j av 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:mobi.shad.s3lib.gfx.node.pixmap.filter.FxColorFilter.java
License:Apache License
/** * *//*from w w w . j a v a 2s . co m*/ @Override protected void processLocal() { if (formGui != null) { brithness = formGui.getInt("FxColorFilterBrithness"); contrast = formGui.getInt("FxColorFilterContrast"); saturation = formGui.getInt("FxColorFilterSaturation"); colorBase = formGui.getColor("FxColorFilterColorBase"); colorPercentRed = formGui.getInt("FxColorFilterColorPercentRed"); colorPercentGreen = formGui.getInt("FxColorFilterColorPercentGreen"); colorPercentBlue = formGui.getInt("FxColorFilterColorPercentBlue"); alpha = formGui.getInt("FxColorFilterAlpha"); } if (data.pixmap == null) { data.pixmap = new Pixmap(S3Constans.proceduralTextureSizeHight, S3Constans.proceduralTextureSizeHight, Pixmap.Format.RGBA8888); data.pixmap.setColor(Color.RED); data.pixmap.fill(); data.texture = null; } data.type = Data.Type.EFFECT_2D; ColorFilter.generate(data.pixmap, colorBase, colorPercentRed, colorPercentGreen, colorPercentBlue, brithness, contrast, saturation, alpha); data.textureChange = true; }
From source file:mobi.shad.s3lib.gfx.node.pixmap.filter.FxGlow.java
License:Apache License
/** * *///w w w. j av a 2s .co m @Override protected void processLocal() { if (formGui != null) { centerX = formGui.getFloat("FxGlowCenterX"); centerY = formGui.getFloat("FxGlowCenterY"); rayX = formGui.getFloat("FxGlowRayX"); rayY = formGui.getFloat("FxGlowRayY"); gamma = formGui.getFloat("FxGlowGamma"); alpha = formGui.getFloat("FxGlowAlpha"); color = formGui.getColor("FxGlowColor"); } if (data.pixmap == null) { data.pixmap = new Pixmap(S3Constans.proceduralTextureSizeHight, S3Constans.proceduralTextureSizeHight, Pixmap.Format.RGBA8888); data.pixmap.setColor(Color.RED); data.pixmap.fill(); data.texture = null; } data.type = Data.Type.EFFECT_2D; Glow.generate(data.pixmap, color, centerX, centerY, rayX, rayY, gamma, alpha); data.textureChange = true; }
From source file:mobi.shad.s3lib.gfx.node.pixmap.filter.FxGradient.java
License:Apache License
/** * *///from w w w . jav a 2s . c o m @Override protected void processLocal() { if (formGui != null) { alpha = formGui.getFloat("FxGradientAlpha"); topLeft = formGui.getColor("FxGradientTopLeft"); topRight = formGui.getColor("FxGradientTopRight"); bottomLeft = formGui.getColor("FxGradientBottomLeft"); bottomRight = formGui.getColor("FxGradientBottomRight"); } if (data.pixmap == null) { data.pixmap = new Pixmap(S3Constans.proceduralTextureSizeHight, S3Constans.proceduralTextureSizeHight, Pixmap.Format.RGBA8888); data.pixmap.setColor(Color.RED); data.pixmap.fill(); data.texture = null; } data.type = Data.Type.EFFECT_2D; Gradient.generate(data.pixmap, topLeft, topRight, bottomLeft, bottomRight, alpha); data.textureChange = true; }
From source file:mobi.shad.s3lib.gfx.node.pixmap.filter.FxGradientMap.java
License:Apache License
/** * *///from w w w . j a v a2s.co m @Override protected void processLocal() { if (formGui != null) { colorMode = formGui.getInt("FxGradientMapColorMode"); } if (data.pixmap == null) { data.pixmap = new Pixmap(S3Constans.proceduralTextureSizeHight, S3Constans.proceduralTextureSizeHight, Pixmap.Format.RGBA8888); data.pixmap.setColor(Color.RED); data.pixmap.fill(); data.texture = null; } data.type = Data.Type.EFFECT_2D; data.textureChange = true; GradientMap.generate(data.pixmap, colorMode); }
From source file:mobi.shad.s3lib.gfx.node.pixmap.filter.FxInvert.java
License:Apache License
/** * *//*from www . ja v a 2 s . c o m*/ @Override protected void processLocal() { if (formGui != null) { } if (data.pixmap == null) { data.pixmap = new Pixmap(S3Constans.proceduralTextureSizeHight, S3Constans.proceduralTextureSizeHight, Pixmap.Format.RGBA8888); data.pixmap.setColor(Color.RED); data.pixmap.fill(); data.texture = null; } data.type = Data.Type.EFFECT_2D; Invert.process(data.pixmap); data.textureChange = true; }
From source file:mobi.shad.s3lib.gfx.node.pixmap.filter.FxNoise.java
License:Apache License
/** * */// w w w.j a v a 2 s . c om @Override protected void processLocal() { if (formGui != null) { noiseRed = formGui.getInt("FxNoiseNoiseRed"); noiseGreen = formGui.getInt("FxNoiseNoiseGreen"); noiseBlue = formGui.getInt("FxNoiseNoiseBlue"); seed = formGui.getInt("FxNoiseNoiseSeed"); } if (data.pixmap == null) { data.pixmap = new Pixmap(S3Constans.proceduralTextureSizeHight, S3Constans.proceduralTextureSizeHight, Pixmap.Format.RGBA8888); data.pixmap.setColor(Color.RED); data.pixmap.fill(); data.texture = null; } data.type = Data.Type.EFFECT_2D; Noise.setSeed(seed); Noise.generate(data.pixmap, noiseRed, noiseGreen, noiseBlue); data.textureChange = true; }
From source file:mobi.shad.s3lib.gfx.node.pixmap.filter.FxNoiseGrey.java
License:Apache License
/** * *///from w w w . j a v a2 s . c o m @Override protected void processLocal() { if (formGui != null) { noiseGrey = formGui.getInt("FxNoiseGreyNoise"); seed = formGui.getInt("FxNoiseGreyNoiseSeed"); } if (data.pixmap == null) { data.pixmap = new Pixmap(S3Constans.proceduralTextureSizeHight, S3Constans.proceduralTextureSizeHight, Pixmap.Format.RGBA8888); data.pixmap.setColor(Color.RED); data.pixmap.fill(); data.texture = null; } data.type = Data.Type.EFFECT_2D; NoiseGrey.setSeed(seed); NoiseGrey.generate(data.pixmap, noiseGrey); data.textureChange = true; }