Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
qsun81 opened this issue Aug 14, 2023 · 2 comments

Comments

@qsun81
Copy link

qsun81 commented Aug 14, 2023

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~!

@mqce
Copy link

mqce commented Aug 24, 2023

this works for me.

js
kaboom({ scale:1 });

css
transform: scale(0.5);

@qsun81
Copy link
Author

qsun81 commented Aug 25, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants