Hello,
I’m adding a control to an advanced dynamic texture and would like to align it top left on that texture, is this possible? (default is centered vertically & horizontally)
I know a texture has a rootContainer, would I need to configure that?
My specific use case is this: https://playground.babylonjs.com/?snapshot=refs/pull/11710/merge#Q9VZS9#930
My end goal is to have the InputTextArea sit in the top left of the texture and expand to the right and down as text is entered.
Thanks very much!
Related PR:
BabylonJS:master
← Valerian-Perez-Wanadev:master
opened 10:11AM - 05 Jan 22 UTC
Based on fneitzel prototype ([Added prototype of InputTextArea](https://github.c… om/BabylonJS/Babylon.js/pull/8275)), I improved the component to support the margin, the deletion (backspace/del.), the highlighting, deadkeys and copy/paste/cut shortcuts.
A lot of things remained to do :
- fix the CR on last line
- find why the text clip on single line during autostreching
- resolve todos
- clean/fix/update the code
My approach was highly naïve, so maybe a cleaner architecture will be necessery.
Great thanks, would it be possible to show an example in the playground link above?
I tried: advancedTexture.rootContainer.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP
but it does not seem to have any effect.
Is there somewhere else I should be applying the alignment?
it does look like the answer is as simple as:
textInput.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP
textInput.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_LEFT
but for some reason this does not work in the playground, it does work in my local project though:
Thanks!