kaboom icon indicating copy to clipboard operation
kaboom copied to clipboard

the scale component within kaboom initialization is not working with a custom canvas size

Open qsun81 opened this issue 2 years ago • 2 comments

hi, The playground in kaboomjs.com might be using an older version, but it can still replicate the error. In the playground option "platformer", I have set the width and height of the canvas, and changed the scale. When the scale is less than 1, the issue is shown. The image below is when the scale is 1. (width 960, and height 640)
image

below is when scale is 0.5 image

I'm trying to make a reactive screen that can fit also into mobile devices by dynamically change the scale, but apparently, I need to find another way around if the issue persists.

Thank you! and Pls Help~!

qsun81 avatar Aug 14 '23 06:08 qsun81

this works for me.

js kaboom({ scale:1 });

css transform: scale(0.5);

mqce avatar Aug 24 '23 08:08 mqce

this works for me.

js

kaboom({ scale:1 });

css

transform: scale(0.5);

Thank you!

I guess the scale factor works fine as long as I don't set the width and height of the canvas in the kaboom options.

qsun81 avatar Aug 25 '23 03:08 qsun81