Window Resize Breaks Layer Coordinates at Parallax of 0

0 favourites
  • 1 posts
From the Asset Store
Simple resize and rotate events for any sprite, quick and easy event sheet that you can use for your own projects.
  • So I have a layer, with the parallax set to 0,0.

    This is my UI layer, so I have a mini-map object placed in the top left of this layer.

    The mini-map is 200x200px and is positioned at x:100 y:100. It is also anchored to the top left of the window.

    When looking at the debug panel, it seems that layers set at a parallax of 0,0 have their own internal coordinates. So the top left of the layer always starts out at 0,0.

    This is good, and reasonably expected behavior. However, I run into a problem when I try to re-size the window.

    I should add that I'm using the NW.js preview option.

    By default, my window starts out at an arbitrary 1280x720 if I re-size the window, while watching the debug panel, I can see that my mini-map object moves into the negative range.

    So what this tells me is that when re-sized, the top left of my UI layer's origin is no longer internally 0x0.

    I'm hoping this is clear enough for people to understand, and if possible maybe someone could confirm this behavior?

    Also, if anyone knows how to compensate for this, I'm eager to hear your ideas and techniques.

    Update:

    After some more searching on this issue, I think I've found a previous example of the problem.

    https://www.scirra.com/forum/crop-fullscreen-breaks-0-0-parallax-layers_t120338

    Unfortunately this seems to be by design so I'll have to look into solving the problem with more awkward methods.

    Also I will add that... I'm not sure I see why Ashley considers the "crop" fullscreen mode to be a mistake. For some games, actually scaling graphics can cause them to look quite fuzzy and lose the "crisp" look that I normally try for in my games.

    Unless I am missing something, it makes more sense for me to use the "crop" fullscreen method.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)