protected void renderParticles() { particleFrameBuffer.begin(); batch.begin(); Color initialColor = batch.getColor(); Values<Entity> values = particleEntities.values(); while (values.hasNext()) { Entity entity = values.next(); ParticleComponent particle = entity.getComponent(ParticleComponent.class); ColorComponent color = entity.getComponent(ColorComponent.class); if (color != null) { batch.setColor(color.color); } particle.effect.draw(batch); batch.setColor(initialColor); } batch.end(); particleFrameBuffer.end(); batch.begin(); batch.draw(particleRegion, 0.0f, 0.0f); batch.end(); }
@Override public void show() { float started = System.currentTimeMillis(); elapsedTime = 0f; alpha = 0; alphaStep = 1f / 60f; mode = 0; batchColor = batch.getColor(); System.out.println( "Splash screen showed [" + (System.currentTimeMillis() - started) + "ms] !!!"); }
@Override public void draw(SpriteBatch batcher, Vector2 offset, int width, int height) { Color c = batcher.getColor(); batcher.setColor(color); for (int t = 0; t < outlines.length; t++) { if (surrounding[t] == TileBlockState.NONE.getValue()) { batcher.draw(outlines[t], offset.x * width, offset.y * height, width, height); } } batcher.setColor(c); }