after Rotate layout, collision path is separated from sprite

Bugs will be moved here once resolved.

Post » Thu Dec 11, 2014 12:35 am

Problem Description
I'm making a tablet board game, where players can 90 degree rotate the Square layout to where they are sitting around the tablet, without sliding the tablet itself.
The example is the pan zoom example I used so players can zoom and pan around the game board.
The UI stays put so they can hit buttons without having to pan around looking for them.

The UI text boxes after rotating float in diagonal directions even though Parallax for their layer is 0,0. That didn't bother me, as sprite fonts seem to work, and I will switch the text to them.

However the Sprite collision polys also scroll the same way. As you can see in the example, the button sprite stays put, but to click it you have to click between the text arrows where ever they happen to be, even though they are all on the same 0,0 layer.

Attach a Capx
Rotatelayout.capx


Description of Capx
The only event added to your "Example: Touch Zooming" is #1, which rotates the Layout. (and LayoutAngle to the text, to confirm it wasn't out of range)
The layout was switched to Square, matching my original. (Fullscreen settings didn't seem to have any effect.)
Collision paths were only used for button touches.

Steps to Reproduce Bug
  • In the example, Click the rotate button sprite.
  • The layout offsets, but that wasn't the concern.
    While scrolling you see the text on the UI layer with parallax 0,0 floating in both x and y, even when scrolling in one.
  • The button's collision path is also floating the same as the text, as illustrated by being clickable where marked by the text.

    Observed Result
    Parallax 0,0 doesn't seem to hold up for text and collision polygons when the layout is rotated.

    Expected Result
    The text would stay in place like it does when right side up. And buttons would be clickable/touchable.

    Affected Browsers
    • Chrome: (YES) (exported win 7 and win 8)
    • FireFox: (YES)
    • Internet Explorer: (YES)

Operating System and Service Pack
Windows 7 64 bit

Construct 2 Version ID
first noticed in r190 now using r191
You do not have the required permissions to view the files attached to this post.
B
226
S
60
G
33
Posts: 902
Reputation: 39,989

Post » Tue Jan 06, 2015 4:35 pm

Thanks, turned out some of the math involved with rotated parallaxed layers was wrong. I managed to fix both issues, so both collision detection and the positioning of text objects is now correct.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,464


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests