Pryme8 Posted August 3, 2017 Share Posted August 3, 2017 so if you try to set for(var i=0; ...){ var text1 = new BABYLON.GUI.TextBlock(); text1.text = i; } and the text is a Number you will drop and error instead of it just parsing it as text. quick fix is to add +"" behind the variable or number and it will fix it but I figured it would be worth mentioning that this should be auto parsed. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted August 4, 2017 Share Posted August 4, 2017 Or use String () instead of +''" text1.text = String(i); But it is true that this could be forced into 'string' directly in BABYLON.GUI since this should return only strings and not 'int' or 'float' Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 4, 2017 Author Share Posted August 4, 2017 i wonder what's faster string() or +"" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.