com.badlogic.gdx.graphics.Color Java Examples
The following examples show how to use
com.badlogic.gdx.graphics.Color.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Window.java From uracer-kotd with Apache License 2.0 | 6 votes |
@Override public void draw (Batch batch, float parentAlpha) { keepWithinStage(); if (style.stageBackground != null) { Color color = getColor(); batch.setColor(color.r, color.g, color.b, color.a * parentAlpha); Stage stage = getStage(); stageToLocalCoordinates(/* in/out */tmpPosition.set(0, 0)); stageToLocalCoordinates(/* in/out */tmpSize.set(stage.getWidth(), stage.getHeight())); style.stageBackground .draw(batch, getX() + tmpPosition.x, getY() + tmpPosition.y, getX() + tmpSize.x, getY() + tmpSize.y); } super.draw(batch, parentAlpha); }
Example #2
Source File: EntityHelpers.java From xibalba with MIT License | 6 votes |
/** * Update sprite position (called after turn is over, after all tweens etc), and update the sprite * color based on cell they're in. * * @param entity The entity * @param cellX x position * @param cellY y position */ public void updateSprite(Entity entity, float cellX, float cellY) { VisualComponent visual = ComponentMappers.visual.get(entity); visual.sprite.setPosition(cellX * Main.SPRITE_WIDTH, cellY * Main.SPRITE_HEIGHT); MapCell cell = WorldManager.mapHelpers.getCell(cellX, cellY); if (cell.isWater()) { Color tinted = visual.color.cpy().lerp(cell.sprite.getColor(), .5f); if (visual.sprite.getColor() != tinted) { visual.sprite.setColor(tinted); } } else { if (visual.sprite.getColor() != visual.color) { visual.sprite.setColor(visual.color); } } }
Example #3
Source File: RibbonRenderer.java From talos with Apache License 2.0 | 6 votes |
public void adjustPointData() { float pointAlpha = accumulator.getPointAlpha(particleRef); Polyline polyline = polyline(); for(int i = 1; i < polyline.points.size; i++) { float topThickness = polyline.points.get(i).thickness; float bottomThickness = polyline.points.get(i-1).thickness; Color topColor = polyline.points.get(i).color; Color bottomColor = polyline.points.get(i).color; tmpColor.set(topColor.r+(bottomColor.r-topColor.r)*pointAlpha, topColor.g+(bottomColor.g-topColor.g)*pointAlpha, topColor.b+(bottomColor.b-topColor.b)*pointAlpha, topColor.a+(bottomColor.a-topColor.a)*pointAlpha); //polyline.setPointData(i, 0, 0, topThickness+(bottomThickness-topThickness)*pointAlpha, tmpColor); } }
Example #4
Source File: NormalBlockRenderer.java From Radix with MIT License | 6 votes |
@Override public void renderWest(int atlasIndex, float z1, float y1, float z2, float y2, float x, float lightLevel, PerCornerLightData pcld, MeshBuilder builder) { // NEGATIVE X float u = getU(atlasIndex); float v = getV(atlasIndex); builder.setUVRange(u, v, u, v); c00.setPos(x, y1, z1).setNor(-1, 0, 0); c01.setPos(x, y1, z2).setNor(-1, 0, 0); c10.setPos(x, y2, z1).setNor(-1, 0, 0); c11.setPos(x, y2, z2).setNor(-1, 0, 0); Color c = getColor((int) x, (int) y1, (int) z1); if(pcld == null) { builder.setColor(c.r*lightLevel, c.g*lightLevel, c.b*lightLevel, c.a); } else { c00.setCol(c.r*pcld.l00, c.g*pcld.l00, c.b*pcld.l00, c.a); c01.setCol(c.r*pcld.l01, c.g*pcld.l01, c.b*pcld.l01, c.a); c10.setCol(c.r*pcld.l10, c.g*pcld.l10, c.b*pcld.l10, c.a); c11.setCol(c.r*pcld.l11, c.g*pcld.l11, c.b*pcld.l11, c.a); } builder.rect(c01, c11, c10, c00); }
Example #5
Source File: DemoCamera.java From ud405 with MIT License | 6 votes |
/** * Renders a blue rectangle showing the field of view of the closeup camera */ public void render(ShapeRenderer renderer) { if (!inCloseupMode) { // Figure out the location of the camera corners in the world Vector2 bottomLeft = myUnproject(closeupCamera, 0, closeupCamera.viewportHeight); Vector2 bottomRight = myUnproject(closeupCamera, closeupCamera.viewportWidth, closeupCamera.viewportHeight); Vector2 topRight = myUnproject(closeupCamera, closeupCamera.viewportWidth, 0); Vector2 topLeft = myUnproject(closeupCamera, 0, 0); // Draw a rectangle showing the closeup camera's field of view renderer.begin(ShapeType.Line); renderer.setColor(Color.BLUE); float[] poly = {bottomLeft.x, bottomLeft.y, bottomRight.x, bottomRight.y, topRight.x, topRight.y, topLeft.x, topLeft.y }; renderer.set(ShapeType.Line); renderer.polygon(poly); renderer.end(); } }
Example #6
Source File: SkinTextFont.java From beatoraja with GNU General Public License v3.0 | 6 votes |
@Override public void draw(SkinObjectRenderer sprite, float offsetX, float offsetY) { if(font != null) { font.getData().setScale(region.height / parameter.size); sprite.setType(getFilter() != 0 ? SkinObjectRenderer.TYPE_LINEAR : SkinObjectRenderer.TYPE_NORMAL); final float x = (getAlign() == 2 ? region.x - region.width : (getAlign() == 1 ? region.x - region.width / 2 : region.x)); if(!getShadowOffset().isZero()) { setLayout(new Color(color.r / 2, color.g / 2, color.b / 2, color.a), region); sprite.draw(font, layout, x + getShadowOffset().x + offsetX, region.y - getShadowOffset().y + offsetY + region.getHeight()); } setLayout(color, region); sprite.draw(font, layout, x + offsetX, region.y + offsetY + region.getHeight()); } }
Example #7
Source File: CyclicOverlap.java From ud405 with MIT License | 6 votes |
@Override public void render() { Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); viewport.apply(); renderer.setProjectionMatrix(viewport.getCamera().combined); renderer.begin(ShapeType.Filled); renderer.setColor(Color.RED); renderer.rect(2, 3.5f, 3, 1.5f, 6, 1, 1, 1, 0); renderer.setColor(Color.GREEN); renderer.rect(2, 3.5f, 3, 1.5f, 6, 1, 1, 1, 120); renderer.setColor(Color.BLUE); renderer.rect(2, 3.5f, 3, 1.5f, 6, 1, 1, 1, 240); // TODO: Make it look like the left end of RED is on top of BLUE renderer.end(); }
Example #8
Source File: VisImageTextButton.java From vis-ui with Apache License 2.0 | 6 votes |
@Override public void draw (Batch batch, float parentAlpha) { updateImage(); Color fontColor; if (isDisabled() && style.disabledFontColor != null) fontColor = style.disabledFontColor; else if (isPressed() && style.downFontColor != null) fontColor = style.downFontColor; else if (isChecked() && style.checkedFontColor != null) fontColor = (isOver() && style.checkedOverFontColor != null) ? style.checkedOverFontColor : style.checkedFontColor; else if (isOver() && style.overFontColor != null) fontColor = style.overFontColor; else fontColor = style.fontColor; if (fontColor != null) label.getStyle().fontColor = fontColor; super.draw(batch, parentAlpha); if (focusBorderEnabled && drawBorder && style.focusBorder != null) style.focusBorder.draw(batch, getX(), getY(), getWidth(), getHeight()); }
Example #9
Source File: SplatMap.java From Mundus with Apache License 2.0 | 6 votes |
public void clearChannel(SplatTexture.Channel channel) { Pixmap pixmap = getPixmap(); for (int smX = 0; smX < pixmap.getWidth(); smX++) { for (int smY = 0; smY < pixmap.getHeight(); smY++) { c0.set(pixmap.getPixel(smX, smY)); if (channel == SplatTexture.Channel.R) { c0.set(0, c0.g, c0.b, c0.a); } else if (channel == SplatTexture.Channel.G) { c0.set(c0.r, 0, c0.b, c0.a); } else if (channel == SplatTexture.Channel.B) { c0.set(c0.r, c0.g, 0, c0.a); } else if (channel == SplatTexture.Channel.A) { c0.set(c0.r, c0.g, c0.b, 0); } pixmap.drawPixel(smX, smY, Color.rgba8888(c0)); } } }
Example #10
Source File: TextureUtil.java From seventh with GNU General Public License v2.0 | 6 votes |
/** * Applying mask into image using specified masking color. Any Color in the * image that matches the masking color will be converted to transparent. * * @param img The source image * @param keyColor Masking color * @return Masked image */ public static Pixmap applyMask(Pixmap img, Color keyColor) { Pixmap alpha = new Pixmap(img.getWidth(), img.getHeight(), Format.RGBA8888); //alpha.drawPixmap(img, 0, 0); int width = alpha.getWidth(); int height = alpha.getHeight(); int colorMask = Color.rgba8888(keyColor); //alpha.setColor(0xff00009f); for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { int col = img.getPixel(x, y); if ( col != colorMask ) { alpha.drawPixel(x, y, img.getPixel(x, y)); } } } return alpha; }
Example #11
Source File: SplatMap.java From Mundus with Apache License 2.0 | 6 votes |
public int additiveBlend(int pixelColor, SplatTexture.Channel channel, float strength) { c0.set(pixelColor); if (channel == SplatTexture.Channel.BASE) { c0.sub(strength, strength, strength, strength); } else if (channel == SplatTexture.Channel.R) { c0.add(strength, 0, 0, 0); } else if (channel == SplatTexture.Channel.G) { c0.add(0, strength, 0, 0); } else if (channel == SplatTexture.Channel.B) { c0.add(0, 0, strength, 0); } else if (channel == SplatTexture.Channel.A) { c0.add(0, 0, 0, strength); } // prevent the sum to be greater than 1 final float sum = c0.r + c0.g + c0.b + c0.a; if (sum > 1f) { final float correction = 1f / sum; c0.r *= correction; c0.g *= correction; c0.b *= correction; c0.a *= correction; } return Color.rgba8888(c0); }
Example #12
Source File: RectangularFlower.java From ud405 with MIT License | 6 votes |
@Override public void render () { Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); shapeRenderer.begin(ShapeType.Filled); shapeRenderer.setColor(Color.GREEN); shapeRenderer.rectLine(100, 0, 100, 300, 20); // TODO: Draw two leaves on the stem // TODO: Set the active color to yellow // TODO: Use a loop to draw 20 of these petals in a circle float petalAngle = 45.0f; shapeRenderer.rect(100, 300, 0, 0, 40, 40, 1, 1, petalAngle); shapeRenderer.end(); }
Example #13
Source File: Renderer.java From VuforiaLibGDX with MIT License | 6 votes |
public Renderer() { lights = new Environment(); lights.set(new ColorAttribute(ColorAttribute.AmbientLight, Color.WHITE)); camera = new PerspectiveCamera(60, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); camera.near = 1.0F; camera.far = 1000.0F; //set camera into "Vuforia - style" direction camera.position.set(new Vector3(0,0,0)); camera.lookAt(new Vector3(0,0,1)); IntBuffer buffer = BufferUtils.newIntBuffer(16); Gdx.gl.glGetIntegerv(GL20.GL_MAX_TEXTURE_IMAGE_UNITS, buffer); int units = buffer.get(0); Log.d("TAG", "Max texture units: "+units); modelBatch = new ModelBatch(new RenderContext(new DefaultTextureBinder(DefaultTextureBinder.WEIGHTED, 0))); }
Example #14
Source File: Utils3D.java From bladecoder-adventure-engine with Apache License 2.0 | 6 votes |
public static void createFloor() { ModelBuilder modelBuilder = new ModelBuilder(); modelBuilder.begin(); MeshPartBuilder mpb = modelBuilder.part("parts", GL20.GL_TRIANGLES, Usage.Position | Usage.Normal | Usage.ColorUnpacked, new Material( ColorAttribute.createDiffuse(Color.WHITE))); mpb.setColor(1f, 1f, 1f, 1f); // mpb.box(0, -0.1f, 0, 10, .2f, 10); mpb.rect(-10, 0, -10, -10, 0, 10, 10, 0, 10, 10, 0, -10, 0, 1, 0); floorModel = modelBuilder.end(); floorInstance = new ModelInstance(floorModel); // TODO Set only when FBO is active floorInstance.materials.get(0).set(new BlendingAttribute(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA)); }
Example #15
Source File: DrawingLines.java From ud405 with MIT License | 6 votes |
@Override public void render() { // As always, first we clear the screen Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); // Then we start our shapeRenderer batch, this time with ShapeType.Line shapeRenderer.begin(ShapeType.Line); // A Simple white line shapeRenderer.setColor(Color.WHITE); shapeRenderer.line(0, 0, 100, 100); // We can set different colors using two methods. We can use constants like so. shapeRenderer.setColor(Color.MAGENTA); shapeRenderer.line(10, 0, 110, 100); // We can also set a color using RGBA values shapeRenderer.setColor(0, 1, 0, 1); shapeRenderer.line(20, 0, 120, 100); // We can also do fancy things like gradients shapeRenderer.line(30, 0, 130, 100, Color.BLUE, Color.RED); // The last interesting thing we can do is draw a bunch of connected line segments using polyline // First we set up the list of vertices, where the even positions are x coordinates, and the odd positions are the y coordinates float[] verticies = {100, 200, 300, 300, 200, 300, 300, 200}; shapeRenderer.polyline(verticies); // Finally, as always, we end the batch shapeRenderer.end(); }
Example #16
Source File: ColorAttribute.java From uracer-kotd with Apache License 2.0 | 5 votes |
@Override public void set (MaterialAttribute attr) { ColorAttribute colAttr = (ColorAttribute)attr; name = colAttr.name; final Color c = colAttr.color; color.r = c.r; color.g = c.g; color.b = c.b; color.a = c.a; }
Example #17
Source File: GradientColorModule.java From talos with Apache License 2.0 | 5 votes |
public ColorPoint createPoint (Color color, float pos) { ColorPoint colorPoint = new ColorPoint(); colorPoint.pos = pos; colorPoint.color.set(color); points.add(colorPoint); points.sort(comparator); return colorPoint; }
Example #18
Source File: GdxCanvas.java From seventh with GNU General Public License v2.0 | 5 votes |
@Override public void drawLine(int x1, int y1, int x2, int y2, Integer color, float thickness) { Color c=setTempColor(color); Gdx.gl.glEnable(GL20.GL_BLEND); Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA); Gdx.gl.glLineWidth(thickness); this.shapes.setColor(c); this.shapes.begin(ShapeType.Line); this.shapes.line(x1, y1, x2, y2); this.shapes.end(); Gdx.gl.glDisable(GL20.GL_BLEND); }
Example #19
Source File: DialogSceneComposerJavaBuilder.java From skin-composer with MIT License | 5 votes |
private static MethodSpec renderMethod() { Color color = rootActor.backgroundColor == null ? Color.WHITE : rootActor.backgroundColor.color; return MethodSpec.methodBuilder("render") .addModifiers(Modifier.PUBLIC) .addStatement("$T.gl.glClearColor($Lf, $Lf, $Lf, $Lf)", Gdx.class, color.r, color.g, color.b, color.a) .addStatement("$T.gl.glClear($T.GL_COLOR_BUFFER_BIT)", Gdx.class, GL20.class) .addStatement("stage.act()") .addStatement("stage.draw()") .returns(void.class).build(); }
Example #20
Source File: DefaultAnimator.java From uracer-kotd with Apache License 2.0 | 5 votes |
private void updateLights (TrackProgressData progressData, Color ambient, Color trees, float collisionFactor) { float base = 0.1f; float timeModFactor = URacer.Game.getTimeModFactor(); float blue = (base * 3f * timeModFactor) * (1 - AMath.sigmoidT(collisionFactor, 0.7f, true)); // Gdx.app.log("DefaultAnimator", "blue=" + blue); //@off ambient.set( base * 1.5f, base, base + blue, 0.55f + 0.05f * timeModFactor ); //@on ambient.clamp(); trees.set(ambient); // Gdx.app.log("", "" + ambient); // update point lights, more intensity from lights near the player PlayerCar player = world.getPlayer(); PointLight[] lights = world.getLights(); if (lights != null && player != null) { for (int l = 0; l < lights.length; l++) { float dist = player.getWorldPosMt().dst2(lights[l].getPosition()); float maxdist = 30; maxdist *= maxdist; dist = 1 - MathUtils.clamp(dist, 0, maxdist) / maxdist; float r = 1f; float g = 1f; float b = 1f; float a = 0.65f; lights[l].setColor(r, g, b, a);// + AMath.fixup(0.4f * dist)); } } }
Example #21
Source File: BusyBar.java From gdx-texture-packer-gui with Apache License 2.0 | 5 votes |
@Override public void draw(Batch batch, float parentAlpha) { super.draw(batch, parentAlpha); batch.flush(); if (clipBegin()) { Color c = getColor(); batch.setColor(c.r, c.g, c.b, c.a * parentAlpha); patternDrawable.draw(batch, getX() - shift, getY(), getWidth() + shift, getHeight()); if (isVisible()) Gdx.graphics.requestRendering(); batch.flush(); clipEnd(); } }
Example #22
Source File: DialogColors.java From skin-composer with MIT License | 5 votes |
private void renameColor(ColorData color, String newName) { //style properties for (Array<StyleData> datas : main.getJsonData().getClassStyleMap().values()) { for (StyleData data : datas) { for (StyleProperty property : data.properties.values()) { if (property != null && property.type.equals(Color.class) && property.value != null && property.value.equals(color.getName())) { property.value = newName; } } } } for (DrawableData drawableData : main.getAtlasData().getDrawables()) { //tinted drawables if (drawableData.tintName != null && drawableData.tintName.equals(color.getName())) { drawableData.tintName = newName; } //ten patch drawables else if (drawableData.tenPatchData != null && drawableData.tenPatchData.colorName.equals(color.getName())) { drawableData.tenPatchData.colorName = newName; } } try { color.setName(newName); } catch (ColorData.NameFormatException ex) { Gdx.app.error(getClass().getName(), "Error trying to rename a color.", ex); main.getDialogFactory().showDialogError("Name Error...","Error while naming a color.\\nPlease ensure name is formatted appropriately:\\nNo spaces, don't start with a number, - and _ acceptable.\n\nOpen log?"); } main.getUndoableManager().clearUndoables(); main.getRootTable().refreshStyleProperties(true); main.getRootTable().refreshPreview(); main.getProjectData().setChangesSaved(false); refreshTable(); }
Example #23
Source File: BasicColorPicker.java From vis-ui with Apache License 2.0 | 5 votes |
/** * @param allowAlphaEdit if false this picker will have disabled editing color alpha channel. If current picker color * has alpha it will be reset to 1. If true alpha editing will be re-enabled. For better UX this should not be called * while ColorPicker is visible. */ public void setAllowAlphaEdit (boolean allowAlphaEdit) { this.allowAlphaEdit = allowAlphaEdit; hexField.setMaxLength(allowAlphaEdit ? HEX_COLOR_LENGTH_WITH_ALPHA : HEX_COLOR_LENGTH); if (allowAlphaEdit == false) { setColor(new Color(color)); } }
Example #24
Source File: TopPanelModList.java From ModTheSpire with MIT License | 5 votes |
@SpireInsertPatch( locator=Locator.class ) public static void Insert(TopPanel __instance, SpriteBatch sb) { FontHelper.renderFontRightTopAligned( sb, FontHelper.cardDescFont_N, MainMenuModList.makeMTSVersionModCount("ModTheSpire " + Loader.MTS_VERSION), Settings.WIDTH - 16 * Settings.scale, Settings.HEIGHT - 104 * Settings.scale, new Color(1, 1, 1, 0.3f) ); }
Example #25
Source File: ParticleActor.java From dice-heroes with GNU General Public License v3.0 | 5 votes |
@Override public void draw(Batch batch, float parentAlpha) { effect.setPosition(getX(), getY()); Color c = getColor(); batch.setColor(c.r, c.g, c.b, c.a * parentAlpha); effect.draw(batch, Gdx.graphics.getDeltaTime()); if (effect.isComplete()) { ChangeListener.ChangeEvent event = Pools.obtain(ChangeListener.ChangeEvent.class); fire(event); Pools.free(event); } }
Example #26
Source File: ResumeVsJoinTest.java From gdx-ai with Apache License 2.0 | 5 votes |
@Override public void render (float delta) { update(delta); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); gameOver = sheeps.size == 0; if (gameOver) { if (!gameOverButton.isVisible()) { String winner = (resumePredator.score > joinPredator.score ? "Fish" : "Badlogics") + " wins!!!"; if (resumePredator.score == joinPredator.score) winner = "There's no winner!!!"; gameOverButton.setText("Game Over\n\n" + winner); gameOverButton.setVisible(true); } } else { Sheep target1 = resumePredator.target; Sheep target2 = joinPredator.target; if (target1 != null || target2 != null) { // Draw circles shapeRenderer.begin(ShapeType.Line); if (target1 != null) { shapeRenderer.setColor(Color.GREEN); shapeRenderer.circle(target1.getPosition().x, target1.getPosition().y, target1.getBoundingRadius() + 4); } if (target2 != null) { shapeRenderer.setColor(Color.RED); shapeRenderer.circle(target2.getPosition().x, target2.getPosition().y, target2.getBoundingRadius() + 6); } shapeRenderer.end(); } } stage.draw(); }
Example #27
Source File: SkinObject.java From beatoraja with GNU General Public License v3.0 | 5 votes |
public SkinObjectDestination(long time, Rectangle region, Color color, int angle, int acc) { this.time = time; this.region = region; this.color = color; this.angle = angle; this.acc = acc; }
Example #28
Source File: LibgdxGraphicsTest.java From mini2Dx with Apache License 2.0 | 5 votes |
@Before public void setup() { mockery = new Mockery(); mockery.setImposteriser(ClassImposteriser.INSTANCE); fonts = mockery.mock(Fonts.class); gameFont = mockery.mock(GameFont.class); gameWrapper = mockery.mock(GameWrapper.class); spriteBatch = mockery.mock(LibgdxSpriteBatchWrapper.class); polygonSpriteBatch = mockery.mock(PolygonSpriteBatch.class); shapeRenderer = mockery.mock(ShapeRenderer.class); gdxGraphics = mockery.mock(com.badlogic.gdx.Graphics.class); Mdx.fonts = fonts; Gdx.graphics = gdxGraphics; mockery.checking(new Expectations() { { one(shapeRenderer).setAutoShapeType(true); one(fonts).defaultFont(); will(returnValue(gameFont)); one(gdxGraphics).getWidth(); will(returnValue(800)); one(gdxGraphics).getHeight(); will(returnValue(600)); one(spriteBatch).getColor(); will(returnValue(new Color())); } }); graphics = new LibgdxGraphics(gameWrapper, spriteBatch, polygonSpriteBatch, shapeRenderer); }
Example #29
Source File: VfxManager.java From gdx-vfx with Apache License 2.0 | 5 votes |
/** Cleans up the {@link VfxPingPongWrapper}'s buffers with the color specified. */ public void cleanUpBuffers(Color color) { if (applyingEffects) throw new IllegalStateException("Cannot clean up buffers when applying effects."); if (capturing) throw new IllegalStateException("Cannot clean up buffers when capturing a scene."); pingPongWrapper.cleanUpBuffers(color); }
Example #30
Source File: Emitters.java From seventh with GNU General Public License v2.0 | 5 votes |
public static Emitter newSingleSparksEmitter(final Vector2f pos, Vector2f targetVel) { final Vector2f vel = targetVel.createClone(); final int maxParticles = 60; final Emitter emitter = new Emitter(pos.createClone(), Integer.MAX_VALUE, maxParticles) .setName("SparksEmitter") .setDieInstantly(false); BatchedParticleGenerator gen = new BatchedParticleGenerator(5050, 8200, maxParticles); gen.addSingleParticleGenerator(new SingleParticleGenerator() { @Override public void onGenerateParticle(int index, TimeStep timeStep, ParticleData particles) { particles.speed[index] = 285; particles.pos[index].set(emitter.getPos()); } }) .addSingleParticleGenerator(new SetPositionSingleParticleGenerator()) .addSingleParticleGenerator(new RandomColorSingleParticleGenerator(new Color(0xF7DC6Fff), new Color(0xF9E79Fff),new Color(0xF4D03Fff))) .addSingleParticleGenerator(new RandomVelocitySingleParticleGenerator(vel, 60)) .addSingleParticleGenerator(new RandomTimeToLiveSingleParticleGenerator(2000, 2050)) ; emitter.addParticleGenerator(gen); emitter.addParticleUpdater(new KillUpdater()); emitter.addParticleUpdater(new RandomMovementParticleUpdater(285, 0.6f, 0f)); emitter.addParticleUpdater(new AlphaDecayUpdater(0f, 0.9822718f)); emitter.addParticleRenderer(new CircleParticleRenderer()); return emitter; }