Hi i have a problem with bitmapText, each time on the start of application it works on
public void simpleInitApp() {
}
but if i try to use it out of it , it get never displayed , and i cant finde why ? ,may be i should force some update?
I’ve tried to test it with simple crossheir , just by making it added after 5 secs, and had no effect,
i can add any geometry or node ,but cant get BitmapText visible at any way
if(secondFive>5){
getExe().getLabelManager().makeLabel(20, " WTF");
BitmapFont myFont = exe.getMyAssetManager().loadFont("Interface/Fonts/Default.fnt");
BitmapText myText= new BitmapText(myFont,false);
myText.setSize(1);// lets say max rows are 15
myText.setText("WAAAA");
myText.setLocalTranslation(getExe().getAppSettings().getWidth()/7,getExe().getAppSettings().getHeight()/7,0);//
getExe().getNodesHolder().getKeysNode().attachChild(myText);
myText.setLocalScale(getExe().getAppSettings().getWidth()/7,getExe().getAppSettings().getHeight()/7,0);
}
now label does appear but bitmapText dont soo clock works properly
this si systemprintout
null (BitmapText) 1 KeysNode (Node) 2 Gui Node (Node) 3 WAAAA
System.out.println(myText +" 1 "+myText.getParent()+" 2 "+myText.getParent().getParent()+"
3
"+myText.getText());
May be i’ve found some walkaround ,by cloning one made on start, but lots of people complain on cloning results … soo im uncertain
i have made this , but helps nut mutch
myText.getWorldBound().setCenter(getExe().
getAppSettings().getWidth()/7,getExe().getAppSettings().getHeight()/7,0);
new code is
if(secondFive>5){
//////////////////////////
getExe().getLabelManager().makeLabel(20, " WTF");
BitmapFont myFont = exe.getMyAssetManager().loadFont("Interface/Fonts/Default.fnt");
BitmapText myText=
new BitmapText(myFont, true);
getExe().getNodesHolder().getKeysNode().attachChild(myText);
myText.setSize(10);// lets say max rows are 15
myText.setText("WAAAA");
myText.setLocalTranslation(getExe().getAppSettings().
getWidth()/7,getExe().getAppSettings().getHeight()/7,0);//
myText.setLocalScale(getExe().getAppSettings().
getWidth()/7,getExe().getAppSettings().getHeight()/7,0);
myText.getWorldBound().setCenter(getExe().
getAppSettings().getWidth()/7,getExe().getAppSettings().getHeight()/7,0);
System.out.println(myText +" 1 "+myText.getParent()+" 2
"+myText.getParent().getParent()+" 3 "+myText.getText());
System.out.println(myText.getWorldBound());
System.out.println(myText.getWorldTranslation());
//////////////////////////////////
systemouts are :
null (BitmapText) 1 KeysNode (Node) 2 Gui Node (Node) 3 WAAAA
BoundingBox [Center: (205.0, 128.0, 0.0) xExtent: 0.0 yExtent: 0.0 zExtent: 0.0]
(205.0, 128.0, 0.0)