rexrainbow / phaser3-rex-notes

Notes of phaser3 engine
MIT License
1.18k stars 259 forks source link

"FixWidthSizer" unwanted expansion #454

Open dtturcotte opened 1 week ago

dtturcotte commented 1 week ago

Please see this forked code.

I've set the width: 100, but you'll notice extra long content forces the rexUIScrollablePanel to expand beyond its set width.

This is causing a lot of UI issues currently. How can I fix this and force the width I set?

Note: In this Fix-Width Sizer Documentation, it says that width, height : Minimum width, minimum height., meaning only the minimums are set. The same is true for Scroll-able Panel with Fix-Width Sizer. Any recommendations? Even if I set wordWrap, it still causes an issue.

Note, I am using both RexUIBBCodeText and Phaser.GameObjects.Text and it's causing the same issues.


I checked my scrollablePanel width and height after adding elements then layout() and the width seems to adjust itself. How can I prevent this?

rexrainbow commented 1 week ago

Minimum width, minimum height, is the minimum size of ui element, not the maximun size, therefore the actual size after layout might larger these minWidth, minHeight setting.

For that use case, might try sliderXY mode.