you get the iframe's width and height with plain innerWidth
That's what I'm currently doing and it doesn't work. I'm using 'window.innerWidth' in the IFrame. example of what I'm basically doing:
var canvas = createCanvas(1280, 720); var scale = window.innerWidth/width; // width is the width of the canvas canvas.elt.style.width = scale * width + "px"; // update canvas style to scale it down canvas.elt.style.height = scale * height + "px";
Can you post a link to one of your games on itch where it works?
Are you trying to do something fancier?
Nah, I'm just trying to get scaling to work. The solution I came to was accessing the iframes parent width which is not possible. Does that make things more clear? Is there something specifically confusing?