WindowWidth and WindowHeight not working

0 favourites
  • 6 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • When in fullscreen - scale mode, WindowWidth and WindowHeight doesn't return correct values as R0J0hound explains on second page of this thread:

    construct.net/en

    in theory scrollx-WindowWidth/2 should always return left edge of the viewport. it doesnt in fullscreen - scale mode. it does though, when in fullscreen - crop mode and width layout scale set to: min(WindowWidth/640,windowheight/480) - for 640x480 app.

  • I'm glad to find I'm not the only one having a similar problem. I made a post in the "How Do I?" sub-forum. Wasn't sure if it was a bug until R0J0 said something in this Ranma's topic.

    http://www.scirra.com/forum/bottom-of-window-hud-scaling-issues_topic49009.html

    My original post in the "How Do I?" has a more detailed description and a capx, but basically I can confirm it's an issue with improper window scaling in "Fullscreen (Scale)" mode.

  • As far as I can tell WindowWidth and WindowHeight always return the correct values. They are only supposed to return the browser inner window size and not the viewport in the game and that's what they do. If your calculations don't match up with the game then your math is wrong, because I think the expressions are working fine. Think this should be closed as not a bug.

  • I'd like to make a correction, it's not a bug at all. Instead of using the WindowWidth and WindowHeight expressions when in Fullscreen(scaled) mode, use the Edit time window size.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • if game has a layout of 100x100 pixels and unbounded scrolling on, the fullscreen scaled option on, the set X to scrollX - windowWidth/2 should always position sprite on the left edge. If it should, this is a bug as it doesn't :) if it shouldn't this can be closed, but please, Ashley or if you can help me in the other thread, please do, would be grateful! cheers!

  • ranma, no your math is wrong, as you scale up the window size the game viewport zooms according to the scale setting to keep roughly the same number of layout-coordinates between the middle of the screen and the left edge, but the WindowWidth expression will keep increasing so the object moves off to the left. Closing as not a bug.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)