Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
Is there any known issue to getting the windowwidth or height on mobile?
I'm trying to set a tiled background to windowwidth * 0.9 / windowheight * 0.9 and it always is larger than the screen.
If I tell it to be a specific size it seems to be fine. :/
Develop games in your browser. Powerful, performant & highly capable.
I'm guessing phone you're testing it on doesn't have the same resolution as the native resolution of the game you made.
Anyway, use ViewportRight(layer) as your "width" and ViewportBottom(layer) as your "height".
width = ViewportRight(layer) - ViewportLeft(layer)
height = ViewportBottom(layer) - ViewportTop(layer)
You can't rely on top and left being 0, in all configurations.
I forgot to mention that I've already tried those. Thanks though.
My project scale mode is crop.
On desktop the tiledBG sizes fine, on my nexus and bionic (mobile chrome, firefox, opera) it does not.