Enter fullscreen event & force widget "reposition"

Enter fullscreen event & force widget "reposition"
0.0 0

#1

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 ?


#2

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!


#3

This did work, thanks!

I’m looking forward an upcoming solution. Maybe temporarily disable the isAlignOnce option.


#4

This feature will be landed on v1.10.