Added remove method in Text.java
This commit is contained in:
parent
a6f25bb75b
commit
9cb1bcc12d
@ -230,7 +230,7 @@ public class Engine {
|
|||||||
background.translate(new Vector3f(-3011.0f, 1400.0f, 1.0f));
|
background.translate(new Vector3f(-3011.0f, 1400.0f, 1.0f));
|
||||||
engine.add_objectGl(background);
|
engine.add_objectGl(background);
|
||||||
|
|
||||||
Text TexTest = new Text("ABCDEFGHIJKLMNOPQRSTUVWXYZ",20.0f, 10, engine);
|
Text texTest = new Text("ABCDEFGHIJKLMNOPQRSTUVWYZ",20.0f, 10, engine);
|
||||||
|
|
||||||
long timer = System.currentTimeMillis();
|
long timer = System.currentTimeMillis();
|
||||||
long lastFrame;
|
long lastFrame;
|
||||||
|
@ -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){
|
private ObjectGl charToObjectGl(char a){
|
||||||
ObjectGl objectGl = new ObjectGl(this.zPos, 1.0f, 1.0f, this.size, "textures/dejavu10x10_gs_tc.png", null);
|
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");
|
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);
|
objectGl.setTextureWrap(0.0f + (a - 97) * 10.0f,40.0f,10.0f,10.0f, ObjectGl.DEFAULT);
|
||||||
}
|
}
|
||||||
else if (a < 91 && a > 64){
|
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;
|
return objectGl;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user