Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix template & objects with custom collider rotations defined do not work appropriately #585

Merged
merged 5 commits into from
Jan 17, 2025

Conversation

eonarheim
Copy link
Member

@eonarheim eonarheim commented Jan 16, 2025

This PR covers 2 problems

  1. Tiles with custom collider rotations were not respected previously, this is fixed by actually applying the rotation to the point transformation. Tested on all polygon types Boxes and Polygons
      <tile id="117">
        <objectgroup draworder="index" id="2">
         <object id="1" x="0.181818" y="4.18182" rotation="88">
          <polygon points="0,0 2.09091,-2.36364 7.63636,-2.45455 9.81818,0.454545 14.3636,0.545455 15.5455,1.63636 15.9091,8.81818 14.7273,9.72727 1.90909,9.63636 -0.0909091,7.54545"/>
         </object>
         <object id="6" x="-0.272727" y="0.363636" width="3.81818" height="2.72727" rotation="31"/>
        </objectgroup>
      </tile>
  2. Objects using templates also did not work properly with custom colliders when flipped horizontally/vertically. Note the presence of gid on the template object, this was previously unhandled by the plugin and confused the parser.
      <object id="2" template="coin.tx" gid="3221225698" x="47.75" y="80" rotation="179" visible="1"/>

@eonarheim eonarheim changed the title fix issue where objects with rotations defined do not work appropriately fix template & objects with custom collider rotations defined do not work appropriately Jan 17, 2025
@eonarheim eonarheim merged commit e6b800e into main Jan 17, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant