Enter fullscreen event & force widget "reposition"

Is there an event to detect when the game enters fullscreen mode on a mobile device ?

And when such an event is fired, is there a way to force a widgets with isAlignOnce true to recalculate their position ?

You can use

            if (cc.sys.isMobile) {
                window.addEventListener('resize', YourCallback);
            }
            else {  // desktop browser
                cc.eventManager.addCustomListener('canvas-resize', YourCallback);
            }

We discuss about it, thank you for your advise!

1 Like

This did work, thanks!

Iā€™m looking forward an upcoming solution. Maybe temporarily disable the isAlignOnce option.

This feature will be landed on v1.10.

1 Like