Screen resize call back for 3.x

Hi may I know what’s the code for screen resize callback in cocos creator 3.x?

Thanks

I can ask engineering to have a look.

I assumed you were asking for web.

// Create your own function "myResizeCallback"
(window as any).addEventListener("resize", myResizeCallback);

For Example
Using version 3.x (3.3.0) as an example, you can use the screen.requestFullScreen interface

Do you have thing equivalent to this?
cc.view.setResizeCallback(this.makeResponsive.bind(this));


I’m not sure how to use it, it says Property ‘setResizeCallback’ does not exist on type ‘typeof View’.

view.setResizeCallback

this ‘view’ is the singleton View object.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Ahh I see. Thanks!