[r183] Global layer, parallax in editor display error

0 favourites
  • 4 posts
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • Problem Description

    Toggling the editor properties 'parallax in editor' (for a global layer) between No Yes causes objects to appear to move in the editor window - when the layer parallax is set to 0,0. Consequently, if the sprite is placed in the layout with the setting at 'Yes' then the sprite's position during run time will not be where you expect.

    Attach a Capx

    [attachment=0:37gd7tb0][/attachment:37gd7tb0]

    Description of Capx

    There is one sprite on a global layer - the layer "HUD" in Layout 1 - that has its parallax set to "0,0". With the layer selected, if you toggle the Editor Properties "parallax in editor" from No to Yes you will observe the sprite appear to move.

    Steps to Reproduce Bug

    • Select the global layer "HUD" in Layout 1
    • Toggle "parallax in editor" from No to Yes and observe
    • Position the sprite with setting at Yes and then run the layout and observe the sprite position

    Observed Result

    The sprite appears to move when the setting is toggled between No and Yes. If the sprite is positioned with the setting at Yes then it will appear in the wrong place when running in a browser.

    Expected Result

    With 0,0 parallax, I would expect there to be no discernible difference in the sprite's apparent position no matter what parallax setting is selected. I tried this in r178 and there was no movement of the sprite when conducting this test.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    W8.1 x64

    Construct 2 Version ID

    r183 x64

  • It looks like it's working correctly. By turning 'parallax in editor' on, you are making the editor display it like it does at runtime, and objects on a parallax 0,0 layer are fixed in the viewport. Since the editor viewport is a different size to the runtime viewport, it doesn't line up the same way. I can't see that this has anything to do with global layers either (it works the same - correctly - with global off). Are you sure it worked differently in r178?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It hasn't changed, but to help it be visualized a little more, Colludium I modified your capx to hopefully show more clearly how 0-parallax layers work. It's relative to the editor's viewport, which may be independent of the game's viewport. Remember, object placement is based off of that layer's 0,0 coordinate (top-left), which may appear differently with different parallax settings.

    I just quickly placed your sprites around to show the corners of the viewport and then filled the middle to make it clearer. Then, switching between parallax in editor yes/no will show how it's all relative.

  • Ahhh. Thanks for the explanation, Ashley, that makes sense. I misunderstood how the 0,0 parallax would be displayed in the editor - there is no bug here. I tried to replicate this again (or not) in r178 and it works just the same - I must have had the layout aligned by fluke perfectly so that the toggling of the setting made no apparent difference to the sprite when I tried it before...

    C-7, thanks for the example - I have (yet again) learned something new.

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