Question regarding window size

0 favourites
  • 7 posts
From the Asset Store
220 Food Sprites in 16x16 pixel size. Perfect for items for a retro style game.
  • So I have a game where I want to spawn objects right outside of the screen and have them move across it. The problem I'm having is exactly how I should go about determining where to spawn the objects. I've tried spawning them using the layoutHeight and Width properties but in fullscreen scaled mode it ends up spawning them inside the window. When I use windowHeight and Width it spawns them inside when in windowed mode and much too far outside when in fullscreen mode. I want my game to work on all screen sizes consistently and it doesn't seem to be possible. I've ran all my tests in full screen scaled mode.

    I included my

    capx

    Thanks for any input.

  • I've tried your capx, all seems to work accordingly to what you expect with windowWidth/Height, in fullscreen as not in fullscreen.

    I'm not sure what you need support for here.

  • Well the issue is that some of the lilypads are spawning off of the screen, or further away than they should be. I know it's not the values I'm using because I tried the same expressions with a fixed window size in non full screen scaled mode and they worked fine. Could this possibly be because I have a wide screen monitor?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • lilypadding.capx

    WindowWidth and WindowHeight are the real size of the display. either you put fullscreen on scale or crop mode, if you have a 1920 by 1080px like me (who has bought a dual screen 2x24" recently and can't seem to stop to brag about it) WindowWidth will be close to 1920 with a browser properly stretched.

    But the value you want is 640 since you scale to fit the display.

    If you were in crop mode you would use WindowWith, but there you have to create your own variable with 640x480

  • I get what you're saying Yann, so how would you suggest I set up my layout and window properties so that the game works properly and scales to correctly spawn lilypads just off the screen on any display? Should I set the dimensions based on the smallest resolution I want to display (mobile devices) and stretch it?

    I'm just not sure what the issue is. I tried changing the dimensions to the actual resolution of my desktop (1366,768) and it says the pads are spawning at x = 1398, but they are still spawning inside the window noticeably. Could this possibly be a bug with the scaling feature?

  • I honsetly don't know. I have to admit that I don't really know how fullscreen modes are calculated, by providing a capx in my last post I thought I found out, but it seems that there still was issue when kyat tested it.

    So you can try your chance in a bug reporte or we could directly ask Ashley here about this

  • Well thanks for taking the time to look into it. For the mean time I'm going to stick with a strict layout size and not run in full screen that way I can least continue to work on the mechanics of the gameplay. My main concern is how will various screen sizes and resolutions on mobile devices affect this, as my end goal is to turn this into a native phone app at some point.

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