Crop fullscreen breaks (0,0) parallax layers

Bugs will be moved here once resolved.

Post » Thu Dec 04, 2014 1:34 pm

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
B
23
S
6
G
10
Posts: 1,041
Reputation: 7,553

Post » Thu Dec 04, 2014 1:54 pm

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.
B
51
S
20
G
10
Posts: 571
Reputation: 9,819

Post » Thu Dec 04, 2014 4:42 pm

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.
Scirra Founder
B
398
S
236
G
88
Posts: 24,441
Reputation: 194,661

Post » Thu Dec 04, 2014 5:07 pm

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.
B
23
S
6
G
10
Posts: 1,041
Reputation: 7,553

Post » Fri Dec 05, 2014 7:28 pm

Thank you for the info! It instantly made me figure out how to solve my HUD issue.
B
51
S
20
G
10
Posts: 571
Reputation: 9,819


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests