This repository has been archived by the owner on Nov 12, 2024. It is now read-only.
-
I'm wondering if there is a way to change the width and height of the kaboom context upon window resizing, is this possible? here's my code kaboom({
global: true,
width: 0.95*window.innerHeight*16/9,
height: 0.95*window.innerHeight,
clearColor: [1,1,1,1],
canvas: document.getElementById('game'),
debug: true
});
window.addEventListener('resize', function(event) {
// code that changes canvas width and height //
}); |
Beta Was this translation helpful? Give feedback.
Answered by
slmjkdbtl
Sep 6, 2021
Replies: 2 comments 3 replies
-
This is for kaboom2000 or kaboom@next: kaboom({
global: true,
stretch: true, // Resize the content
letterbox: true, // Keep the aspect ratio (adding black bars)
width: 220, //example
height: 95, // example
clearColor: [1,1,1,1],
canvas: document.getElementById('game'),
debug: true
}); |
Beta Was this translation helpful? Give feedback.
2 replies
-
Yeah I'm planning to have resize handler in the engine, stay tuned! |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
orumetsu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah I'm planning to have resize handler in the engine, stay tuned!