dbs2000 Posted July 2, 2015 Share Posted July 2, 2015 I started looking at this thread (http://www.html5gamedevs.com/topic/7238-label-on-top-of-an-objects/) but could not find what I wanted. I have followed this example also (http://playground.babylonjs.com/#O4OXG#4). But the problem is that the text is on a plane that is a square. In most places the labels are going to be long for me, like several words & I may also have the requirement of clicking the label to take some action. I can have a big plane & make it tranparent, as in this example, but the click (through actionManager.registerAction) would be on the plane which is now much bigger than the text. I tried using Ground instead of plane & making it a rectangular but the text gets squished if it is a rectangle An ideal situation for me would be to have a piece of text independent of plane, where by the text itself is an object or otherwise have a rectangular plane or ground or mesh (of the size of the label) where the text does not get squished. Is any of these possible? Or is there any object labeling facility available directly in babylon that I am missing. Also let me take the opportunity to ask one more related question. Will it be possible to put line breaks/newline in the texts. Thanks Quote Link to comment Share on other sites More sharing options...
Temechon Posted July 2, 2015 Share Posted July 2, 2015 Hello, You can check the code I wrote for bGUI : https://github.com/Temechon/bGUI/tree/master/src Maybe you can find what you are looking for Quote Link to comment Share on other sites More sharing options...
dbs2000 Posted July 4, 2015 Author Share Posted July 4, 2015 Hi Temechon,Thanks for your reply. I tried what you suggested but without success. Here, is the code that I wrote. var gSys = new bGUI.GUISystem(scene, 600, 600);var txt = new bGUI.GUIText("txt1", 200, 100, { text: 'My test text', font: 'bold 25px Segoe UI' }, gSys);txt.guiPosition.x = 10;txt.guiPosition.y = 15;txt.guiPosition.z = 5; It came as a static piece of text on the top left corner of the canvas, half cut & it would not rotate or zoom with the mouse. Do I need to do something different? 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.