diff --git a/src/engine/object/ObjectGl.java b/src/engine/object/ObjectGl.java index 2d5fd69..17c935b 100644 --- a/src/engine/object/ObjectGl.java +++ b/src/engine/object/ObjectGl.java @@ -216,6 +216,16 @@ public class ObjectGl { this.vertexArray = new VertexArray(Primitive.createRectangle(this.zPos, this.width, this.height), Primitive.rectangle_indices, colorBuffer, Primitive.stdTexWrap); } + public void setColorVerticalGradient(Vector3f color1, Vector3f color2){ + float[] colorBuffer = new float[] { + color1.x, color1.y, color1.z, + color1.x, color1.y, color1.z, + color2.x, color2.y, color2.z, + color2.x, color2.y, color2.z + }; + this.vertexArray = new VertexArray(Primitive.createRectangle(this.zPos, this.width, this.height), Primitive.rectangle_indices, colorBuffer, Primitive.stdTexWrap); + } + public void setTextureWrap(float[] texture){ this.textureWrap = texture; this.vertexArray.swapTextureBufferObject(texture); diff --git a/src/gameplay/match/match.java b/src/gameplay/match/match.java index 59e8f8e..5446658 100644 --- a/src/gameplay/match/match.java +++ b/src/gameplay/match/match.java @@ -190,8 +190,10 @@ public class match { engine.add_uiElement(coordP2); // Barre de vie healthBarP1Obj = new HorizontalProgressBar(80f, 8.5f, 0.4f, 100f, p1.getCurrentHP(), p1.getMaxHP(), false); + healthBarP1Obj.setColorVerticalGradient(new Vector3f(39f/255f, 201f/255f, 30f/255f), new Vector3f(19f/255f, 89f/255f, 15f/255f)); healthBarP1 = new UIElement(healthBarP1Obj, 0.0138f, 0.980f, engine); healthBarP2Obj = new HorizontalProgressBar(80f, 8.5f, 0.4f, 100f, p2.getCurrentHP(), p2.getMaxHP(), true); + healthBarP2Obj.setColorVerticalGradient(new Vector3f(39f/255f, 201f/255f, 30f/255f), new Vector3f(19f/255f, 89f/255f, 15f/255f)); healthBarP2 = new UIElement(healthBarP2Obj, 0.563f, 0.980f, engine); engine.add_uiElement(healthBarP1); engine.add_uiElement(healthBarP2);