Added remove method in Text.java

This commit is contained in:
Antoine
2021-06-03 20:19:58 +02:00
parent a6f25bb75b
commit 9cb1bcc12d
2 changed files with 8 additions and 2 deletions

View File

@ -33,6 +33,12 @@ public class Text {
}
}
public void remove(){
for (ObjectGl obj : this.charList){
this.engine.remove_objectGl(obj);
}
}
private ObjectGl charToObjectGl(char a){
ObjectGl objectGl = new ObjectGl(this.zPos, 1.0f, 1.0f, this.size, "textures/dejavu10x10_gs_tc.png", null);
objectGl.setShader("shaders/StylishShaders/BasicVert.glsl","shaders/StylishShaders/TextFrag.glsl");
@ -40,7 +46,7 @@ public class Text {
objectGl.setTextureWrap(0.0f + (a - 97) * 10.0f,40.0f,10.0f,10.0f, ObjectGl.DEFAULT);
}
else if (a < 91 && a > 64){
objectGl.setTextureWrap(0.0f + (a - 97) * 10.0f,30.0f,10.0f,10.0f, ObjectGl.DEFAULT);
objectGl.setTextureWrap(0.0f + (a - 65) * 10.0f,30.0f,10.0f,10.0f, ObjectGl.DEFAULT);
}
return objectGl;
}