List of usage examples for com.badlogic.gdx.graphics Color Color
public Color(float r, float g, float b, float a)
From source file:com.matthewmichelotti.collider.demos.Scenarios.java
License:Apache License
private static void initDanmaku1() { Game.engine.setBG(new Color(0.0f, 0.02f, 0.05f, 1.0f)); new CBounds(); new CPlayerShip(); new CEnemyShip(640, 650); new CEnemyShip(340, 500); new CEnemyShip(940, 500); }
From source file:com.matthewmichelotti.collider.demos.Scenarios.java
License:Apache License
private static void initDanmaku2() { Game.engine.setBG(new Color(0.0f, 0.02f, 0.05f, 1.0f)); new CBounds(); new CPlayerShip(); new CMorphEnemyShip(640, 650); new CMorphEnemyShip(340, 500); new CMorphEnemyShip(940, 500); }
From source file:com.matthewmichelotti.collider.demos.Scenarios.java
License:Apache License
private static void initCoagulation() { Game.engine.setBG(new Color(.95f, 0.98f, 1.0f, 1.0f)); new CBounds(); Game.engine.addEvent(new FunctionEvent() { @Override/*from w w w . j a va2 s .c o m*/ public void resolve() { for (int i = 0; i < 150; i++) { new CCoagParticle(); } setTime(getTime() + .1); Game.engine.addEvent(this); } }); }
From source file:com.matthewmichelotti.collider.demos.Scenarios.java
License:Apache License
private static void initFractal(double shotDiam) { Game.engine.setBG(new Color(0.0f, 0.02f, 0.05f, 1.0f)); new CBounds(); HBRect rect = Game.engine.makeRect(); rect.setPos(640, 360);//from w ww . ja v a2 s. com rect.setDims(80); rect.commit(Double.POSITIVE_INFINITY); new CTarget(rect, CPlayerShip.COLOR); for (int i = 0; i < 8; i++) { double angle = 2 * Math.PI * i / 8.0; double cos = Math.cos(angle); double sin = Math.sin(angle); new CStickyGun(640 + cos * 350, 360 + sin * 350, angle + Math.PI, shotDiam); } }
From source file:com.matthewmichelotti.collider.demos.Scenarios.java
License:Apache License
private static void initSpinners() { Game.engine.setBG(new Color(0.0f, 0.02f, 0.05f, 1.0f)); new CBounds(); new CMorphStickySpinner(640 - 200, 360 - 100); new CMorphStickySpinner(640 + 200, 360 + 100); }
From source file:com.matthewmichelotti.collider.demos.Scenarios.java
License:Apache License
private static void initIndicators() { Game.engine.setBG(new Color(0.0f, 0.02f, 0.05f, 1.0f)); new CBounds(); new CVarietyGun(50, 50, .25 * Math.PI); new CVarietyGun(1280 - 50, 50, .75 * Math.PI); new CVarietyGun(50, 720 - 50, -.25 * Math.PI); new CVarietyGun(1280 - 50, 720 - 50, -.75 * Math.PI); new CIndicator(640 - 300, 360, true); new CIndicator(640 + 300, 360, false); }
From source file:com.matthewmichelotti.collider.demos.Scenarios.java
License:Apache License
private static void makePoolBorder() { Game.engine.setBG(new Color(0.0f, 0.7f, 0.2f, 1.0f)); Color color = new Color(0.4f, 0.25f, 0.1f, 1.0f); for (int x = 0; x < 1280; x += 80) { HBRect rect = Game.engine.makeRect(); rect.setPos(x + 40, 20);// w w w . j a va 2 s . c o m rect.setDims(80, 40); rect.commit(Double.POSITIVE_INFINITY); new CTarget(rect, color); rect = Game.engine.makeRect(); rect.setPos(x + 40, 720 - 20); rect.setDims(80, 40); rect.commit(Double.POSITIVE_INFINITY); new CTarget(rect, color); } for (int y = 40; y < 720 - 40; y += 80) { HBRect rect = Game.engine.makeRect(); rect.setPos(20, y + 40); rect.setDims(40, 80); rect.commit(Double.POSITIVE_INFINITY); new CTarget(rect, color); rect = Game.engine.makeRect(); rect.setPos(1280 - 20, y + 40); rect.setDims(40, 80); rect.commit(Double.POSITIVE_INFINITY); new CTarget(rect, color); } }
From source file:com.mbrlabs.mundus.commons.g3d.MG3dModelLoader.java
License:Apache License
private Color parseColor(JsonValue colorArray) { if (colorArray.size >= 3) return new Color(colorArray.getFloat(0), colorArray.getFloat(1), colorArray.getFloat(2), 1.0f); else// w w w . j a v a 2s .c om throw new GdxRuntimeException("Expected Color values <> than three."); }
From source file:com.mikeduvall.GameObject.java
License:Apache License
void drawByteBufferOnPixMap(Pixmap pixmap, PaletteFile paletteFile, ByteBuffer byteBuffer0, int width, int height) { int currentIndex = 0; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { if (!byteBuffer0.hasRemaining()) { continue; }/* w w w . ja va2 s . c o m*/ byte nextByte = byteBuffer0.get(currentIndex); if (nextByte != 0) { int index = Byte.toUnsignedInt(nextByte); index = mapColorIndex(index); PaletteEntry paletteEntry = paletteFile.getPaletteEntries().get(index); float red = paletteEntry.getRed() / 63.0f; float green = paletteEntry.getGreen() / 63.0f; float blue = paletteEntry.getBlue() / 63.0f; Color color = new Color(red, green, blue, 1); pixmap.setColor(color); pixmap.drawPixel(x, y); } currentIndex++; } } }
From source file:com.mob.client.artemis.systems.render.GridRenderingSystem.java
License:Open Source License
/** * Este metodo se encarga de renderizar las * lneas de merca de nuestro GridSystem//from www.j av a 2s.c om * * @author rt * @param entity */ @Override protected void process(Entity entity) { // Obtenemos el component de cada lnea Line line = this.lm.get(entity); // Dibujamos la linea actual this.mShapeRenderer.setColor(new Color(0, 255, 0, 0.5f)); this.mShapeRenderer.line(line.start.x, line.start.y, line.end.x, line.end.y); }