Enter fullscreen event & force widget "reposition"

Enter fullscreen event & force widget "reposition"
0.0 0


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!


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.