Is it possible to update the scroll view example to show how the scroll view content and text element width changes when the window width changes and how the text reflows to fill the width?
I figured it out by adjusting the scroll view anchor to 50%
Then adding the following script to the text element to adjust the content width as the viewport stretches and the content height to the text height as it changes
var TextHeight = pc.createScript('textHeight');
// initialize code called once per entity
TextHeight.prototype.initialize = function () {
const onResize = () => {
// set text width to viewport width
this.entity.element.width = this.entity.parent.element.width = this.entity.parent.parent.element.width
// set content height to new text height
this.entity.parent.element.height = this.entity.element.height
}
// monitor viewport size
this.entity.parent.parent.element.on('resize', onResize)
// adapt to initial size
onResize()
};