[SOLVED] Trying to switch between Fill Mode to Keep Aspect ratio

Hie everyone ,
Not able to set Fillmode to keep Aspect ratio in runtime

Calling this line in intialize function but nothing seems work still I am having output in fill window

initialize() { this.app.setCanvasFillMode(pc.FILLMODE_KEEP_ASPECT); };

Honestly, changing fill mode at runtime is a mess and you have to workaround it. Here’s a project example: https://playcanvas.com/project/965801/overview/switch-fill-mode-2

Press 1 and 2 in the launch tab to change between fill window and keep aspect ratio of 16:9

2 Likes

Yes , its working.
Thanks.