playcanvas / engine

JavaScript game engine built on WebGL, WebGPU, WebXR and glTF
https://playcanvas.com
MIT License
9.55k stars 1.33k forks source link

Add content size fitter for elements that resizes itself based on the children #2417

Open yaustar opened 4 years ago

yaustar commented 4 years ago

Something similar to https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/script-ContentSizeFitter.html or use cases when the content is dynamically filled. e.g scroll box/view for usernames.

yaustar commented 3 years ago

To extend on this, adding elements to a scroll view currently requires manual calculation on overall size (eg https://developer.playcanvas.com/en/tutorials/dynamic-ui-scroll-view/).

The engine should be able to do this and take into account of entity scales

We've had several of our partners mention that this is an issue they've had to workaround and really should be a core feature in our engine.