Hello,
I was wondering how you can set a button to the width and height of the button’s textblock.
I have used adaptWidthToChildren = true but that would basically create a fullscreen button.
Here is a playground: https://playground.babylonjs.com/#XEQEVQ
I played a bit with your PG and came to the following solution:
I used
ctx.measureText()
method to do that, but have to say that I am really not that into HTML and webtech so you may tweak the code for your needs!
Can’t find any other way to do it via the Babylon.GUI yet…maybe it would be nice if our TextBlock-Class provides a matching property for this stuff (like GetMeasure or something like that, I have found a _currentMeasures field in the source but was too stupid to use it)