Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
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. :/
Any ideas?
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.
Develop games in your browser. Powerful, performant & highly capable.
I forgot to mention that I've already tried those. Thanks though.
More Info:
My project scale mode is crop.
On desktop the tiledBG sizes fine, on my nexus and bionic (mobile chrome, firefox, opera) it does not.