I can display the vector position of my objects using the following code in the
simpleInitApp() method
text.setText(String.valueOf(“Object!:”+object1.getLocalTranslation()));
and I wanted to display the current position of the object by calling this in
the updateLoop: text.setText(String.valueOf(“Sphere2:”+sph2.getLocalTranslation()));
but the updateLoop calls the line of code too fast that it is hard to see the current position
of my objects. So, my question is, what can I do to control the updateLoop in a way that I am
able to see the position of my spheres?
Thanks in advanced!!!
Update the line only once in a while.
[java]
float timer = 0;
public void simpleUpdate(float tpf){
timer+=tpf;
if(timer>3000){
text.setText(String.valueOf(“Object!:”+object1.getLocalTranslation()));
timer = 0;
}
}
[/java]
1 Like