[r183] Global layer, parallax in editor display error

Bugs will be moved here once resolved.

Post » Sun Oct 05, 2014 2:50 am

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
parallax global layer in editor.capx


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
You do not have the required permissions to view the files attached to this post.
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,193

Post » Mon Oct 06, 2014 3:34 pm

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?
Scirra Founder
B
387
S
230
G
88
Posts: 24,249
Reputation: 192,450

Post » Mon Oct 06, 2014 4:02 pm

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.
You do not have the required permissions to view the files attached to this post.
B
103
S
38
G
19
Posts: 962
Reputation: 17,986

Post » Mon Oct 06, 2014 7:10 pm

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.
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,193


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 4 guests