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

Point objects: rotation not imported #131

Open
mrgkingcs opened this issue Aug 10, 2020 · 1 comment
Open

Point objects: rotation not imported #131

mrgkingcs opened this issue Aug 10, 2020 · 1 comment

Comments

@mrgkingcs
Copy link

Plugin version
2.3

Issue description
Rotation is not imported for Point objects. It is useful for game logic.

Steps to reproduce

  1. In Tiled, add object layer.
  2. Add Point to layer.
  3. Click on rotation button to change rotation of point
  4. Import tilemap to Godot

Sample map or tileset
TestTrack.zip

code fix
Insert at line 361 in tiled_map_reader.gd:
if "point" in object and object.point:
var point = Position2D.new()
if not "x" in object or not "y" in object:
print_error("Missing coordinates for point in object layer.")
continue
point.position = Vector2(float(object.x), float(object.y))
if "rotation" in object:
point.rotation_degrees = float(object.rotation)

point.visible = bool(object.visible) if "visible" in object else true
...

@bjorn
Copy link

bjorn commented May 17, 2022

Hmm, in fact in Tiled, point objects can't be rotated. I guess this is something I've disabled after this issue was opened (though they could not be rotated already when mapeditor/tiled#1799 was merged).

I can see it has its uses though, as demonstrated by the provided example, so maybe it's worth properly supporting at some point.

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

No branches or pull requests

2 participants