Gradient
This commit is contained in:
parent
fc7b2b7945
commit
d587940b45
@ -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);
|
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){
|
public void setTextureWrap(float[] texture){
|
||||||
this.textureWrap = texture;
|
this.textureWrap = texture;
|
||||||
this.vertexArray.swapTextureBufferObject(texture);
|
this.vertexArray.swapTextureBufferObject(texture);
|
||||||
|
@ -190,8 +190,10 @@ public class match {
|
|||||||
engine.add_uiElement(coordP2);
|
engine.add_uiElement(coordP2);
|
||||||
// Barre de vie
|
// Barre de vie
|
||||||
healthBarP1Obj = new HorizontalProgressBar(80f, 8.5f, 0.4f, 100f, p1.getCurrentHP(), p1.getMaxHP(), false);
|
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);
|
healthBarP1 = new UIElement(healthBarP1Obj, 0.0138f, 0.980f, engine);
|
||||||
healthBarP2Obj = new HorizontalProgressBar(80f, 8.5f, 0.4f, 100f, p2.getCurrentHP(), p2.getMaxHP(), true);
|
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);
|
healthBarP2 = new UIElement(healthBarP2Obj, 0.563f, 0.980f, engine);
|
||||||
engine.add_uiElement(healthBarP1);
|
engine.add_uiElement(healthBarP1);
|
||||||
engine.add_uiElement(healthBarP2);
|
engine.add_uiElement(healthBarP2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user