Crop fullscreen breaks (0,0) parallax layers

0 favourites
  • 5 posts
From the Asset Store
Set of 10 Parallax Background to make pixel art game.
  • Problem Description

    Objects on a layer with (0,0) parallax get displaced from their positions set in the layout editor when the fullscreen mode is set to "Crop".

    Attach a Capx

    Capx not required, please open the Top-down shooter template.

    Description of Capx

    In the top-down shooter template, there is a (0,0) parallax layer with a text object on it placed in the top-left corner.

    Steps to Reproduce Bug

    • Open the Top-down shooter template.
    • Set the fullscreen mode to "Crop".
    • Run a preview of the layout.

    Observed Result

    The text object appears displaced and doesn't remain in its top-left position set in the layout. Playing with the size of the browser window you can observe that the displacement changes. It is in its correct position when the window does match the window size setting in the project properties.

    If you observe the viewport values in the debugger, you will see that the non-scrolling layer gets negative values for the left and top viewports for every bit that the window is bigger than the window size set in the project properties.

    Expected Result

    The text object on the (0,0) parallax layer should remain in the correct position at all times.

    Affected Browsers

    • Chrome: Yes
    • FireFox: Yes
    • Internet Explorer: Yes

    Operating System and Service Pack

    Win 7 Home Premium 64bit SP1

    Construct 2 Version ID

    r190

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can confirm. I have recently ran into this issue with Crop being strange with positioning, exactly like you have described.

    I have a top-level "HUD" layer with (0,0) parallax. I have a HUD Sprite that need to position according to Sprites in another layer called "Game" (No parallax). This means I need to use CanvasToLayer or LayerToCanvas (forgot which) to convert the "Game"'s layer coordinates into the "HUD"'s layer.

    This works perfectly and things position correctly, but if I use Fullscreen Crop and resize the window to not match the window size property (Like you said), the HUD Sprite gets displaced.

  • Closing as by design/wont fix - the intent of "crop" mode is just to roll out the viewport in all directions compared to "Off" fullscreen mode. If you compare the two then you can see it's keeping the text in the same place in the overall browser viewport. Arguably this isn't useful, but I think the "crop" fullscreen mode was a mistake and I've considered removing it (it's only really there for backwards compatibility). The letterbox or scale inner/outer modes are more useful in practice I think. Still if this issue bothers you, just position objects with events using the viewport expressions.

  • I was going to use crop fullscreen for an editing tool rather than a game. And in that case other fullscreen modes aren't very useful , since I simply want to use the whole available screen space and not scale the content to it.

    If crop was removed my only option would be to resize the canvas to the current window size I guess.

  • Thank you for the info! It instantly made me figure out how to solve my HUD issue.

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