public GradientPanel (GradientColorValue value, String name, String description, boolean hideGradientEditor) { super(value, name, description); this.value = value; initializeComponents(); if (hideGradientEditor) { gradientEditor.setVisible(false); } gradientEditor.percentages.clear(); for (float percent : value.getTimeline()) gradientEditor.percentages.add(percent); gradientEditor.colors.clear(); float[] colors = value.getColors(); for (int i = 0; i < colors.length;) { float r = colors[i++]; float g = colors[i++]; float b = colors[i++]; gradientEditor.colors.add(new Color(r, g, b)); } if (gradientEditor.colors.isEmpty() || gradientEditor.percentages.isEmpty()) { gradientEditor.percentages.clear(); gradientEditor.percentages.add(0f); gradientEditor.percentages.add(1f); gradientEditor.colors.clear(); gradientEditor.colors.add(Color.white); } setColor(gradientEditor.colors.get(0)); }
public GradientPanel (GradientColorValue value, String name, String description, boolean hideGradientEditor) { super(value, name, description); this.value = value; initializeComponents(); if (hideGradientEditor) { gradientEditor.setVisible(false); } gradientEditor.percentages.clear(); for (float percent : value.getTimeline()) gradientEditor.percentages.add(percent); gradientEditor.colors.clear(); float[] colors = value.getColors(); for (int i = 0; i < colors.length;) { float r = colors[i++]; float g = colors[i++]; float b = colors[i++]; gradientEditor.colors.add(new Color(r, g, b)); } if (gradientEditor.colors.isEmpty() || gradientEditor.percentages.isEmpty()) { gradientEditor.percentages.clear(); gradientEditor.percentages.add(0f); gradientEditor.percentages.add(1f); gradientEditor.colors.clear(); gradientEditor.colors.add(Color.white); } setColor(gradientEditor.colors.get(0)); }
float[] colors = backgroundColor.getColors(); Gdx.gl.glClearColor(colors[0], colors[1], colors[2], 1.0f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
float[] colors = backgroundColor.getColors(); Gdx.gl.glClearColor(colors[0], colors[1], colors[2], 1.0f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
fx.baseEmitter.getTransparency().setHighMax(t); float[] colors = fx.baseEmitter.getTint().getColors(); float v = 0.3f; colors[0] = v * dfactor;
public GradientPanel (GradientColorValue value, String name, String description, boolean hideGradientEditor) { super(value, name, description); this.value = value; initializeComponents(); if (hideGradientEditor) { gradientEditor.setVisible(false); } gradientEditor.percentages.clear(); for (float percent : value.getTimeline()) gradientEditor.percentages.add(percent); gradientEditor.colors.clear(); float[] colors = value.getColors(); for (int i = 0; i < colors.length;) { float r = colors[i++]; float g = colors[i++]; float b = colors[i++]; gradientEditor.colors.add(new Color(r, g, b)); } if (gradientEditor.colors.isEmpty() || gradientEditor.percentages.isEmpty()) { gradientEditor.percentages.clear(); gradientEditor.percentages.add(0f); gradientEditor.percentages.add(1f); gradientEditor.colors.clear(); gradientEditor.colors.add(Color.white); } setColor(gradientEditor.colors.get(0)); }
@Override public void setColor(Color color) { for(ParticleEmitter e:this.emitter.getEmitters()){ if(e.getTint().getColors().length != 3)return; float[] colors = new float[e.getTint().getColors().length]; for(int i=0;i<colors.length;i+=3){ colors[i] = color.r; colors[i+1] = color.g; colors[i+2] = color.b; } e.getTint().setColors(colors); } super.setColor(color); } public ParticleEffect getEmitter() {
float[] colors = backgroundColor.getColors(); Gdx.gl.glClearColor(colors[0], colors[1], colors[2], 1.0f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);