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

Camera object is not always recognized #254

Closed
JumpLink opened this issue Nov 3, 2021 · 2 comments
Closed

Camera object is not always recognized #254

JumpLink opened this issue Nov 3, 2021 · 2 comments

Comments

@JumpLink
Copy link
Contributor

JumpLink commented Nov 3, 2021

The camera is not recognized if the object layer in the tmx file is not the first object layer even if it is displayed in tiled in the first place.

Steps to Reproduce

  1. Create a object layer called "Collision" (It is important that this is created first)
  2. Create a object layer called "Objects"
  3. Insite the Objects layer create a camera object

Alternatively, the object layer <objectgroup ...>...</objectgroup> can also be inserted via text editor under another objectgroup tag, the issue always occurs when the objectgroup in the file is not in the first position

Expected Result

The order of the object layer should not matter, the camera should always be recognized

Actual Result

The camera is only recognized if the object layer in the file is above all other object layers.

Environment

  • browsers and versions:
  • operating system:
  • Tiled version:
  • Excalibur versions:
  • Tiled plugin versions:
  • (anything else that may be relevant)
  • Latest excalibur version in master and latest excalibur-tiled version in master. Browser does not matter

Current Workaround

Change the order by hand in the file, it cannot be changed in Tiled although the position of the layer can be changed.

@eonarheim
Copy link
Member

Good find!

Agreed, the behavior should scan each object layer with the excalibur custom prop.

image

This logic would need to be updated to do something better than the first object layer. Maybe first valid camera in all the object layers?

ex.camera = excalibur[0].getCamera();

@eonarheim
Copy link
Member

@JumpLink I'm planning on cutting a release sometime this weekend with the latest fixes 🎉 thanks again for the report!

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