0 Favourites

after Rotate layout, collision path is separated from sprite

  • 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

    [attachment=0:3e1t753p][/attachment:3e1t753p]

    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

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • 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.

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