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

Issues with Image Layer in 0.15 #1185

Closed
NonlinearIdeas opened this issue Jan 25, 2016 · 9 comments

Comments

Projects
None yet
2 participants
@NonlinearIdeas
Copy link

commented Jan 25, 2016

Using Windows 10 and the 0.15 version of Tiled. I have constructed a simple tilemap with a tileset and an image layer. There appear to be some issues.

(1) When I move the image layer, the top corner of the grid moves with the mouse (is this expected?), but the image itself appears to move 2x the mouse movement. This makes placement difficult, although the snap to grid appears to work correctly.

(2) Per the documentation, in 0.15, the x,y have been deprecated from the image layer. I have confirmed that they do not appear in the .tmx file. In the UI Layer Properties for the Image Layer, I see that x,y are still there, but offsetx and offsety (the values replacing them) are not present. So I have to "eye-ball" in the image and cannot explicitly set its position.

(3) When the position for the image is set, it appears to be off by a factor of 2 in the .tmx file.

It seems like issues (1) and (3) might be related.

I have attached all the files I am using to document this.
Tiled Issue.zip

@bjorn

This comment has been minimized.

Copy link
Owner

commented Jan 25, 2016

Right, I've fixed these issues already for a 0.15.1 patch release. Please try a daily build for now. Let me know if there are still issues!

@bjorn bjorn added the bug label Jan 25, 2016

@NonlinearIdeas

This comment has been minimized.

Copy link
Author

commented Jan 25, 2016

I pulled the latest release (http://files.mapeditor.org/daily/tiled-v0.15.0-25-g7043246-win64-setup.exe) and it looks to be fixed.

It would be a little cleaner if the grid did not move at all...trying to align the image position with the grid is difficult when it is following the image. Should I suggest this as a separate feature request (lock the grid or let it follow the image)?

Thanks.

@bjorn

This comment has been minimized.

Copy link
Owner

commented Jan 25, 2016

@NonlinearIdeas Hmm, you're right, that's maybe an indication that the image layer should still have its own position attributes in addition to these offset attributes.

However, I'm much more tempted to deprecate the image layer functionality. Do you have a reason to prefer it over using a tile object with your image?

@NonlinearIdeas

This comment has been minimized.

Copy link
Author

commented Jan 26, 2016

I often create scenes with images interspersed with the tile layers. This allows characters to walk "between" trees and and other objects by placing the images in front of and behind the people.

I could "tileize" the images and then offset the layers (this is an option), but I prefer to just be able to put the image into the layer stack and move it around. This way I don't have to keep adding new tiles to the tileset every time I want to add an image. Does that make sense?

@bjorn

This comment has been minimized.

Copy link
Owner

commented Jan 26, 2016

Note that I was talking about tile objects, not a tile layer.

Still, it makes sense but I think mainly because of the UI. It happens to be easier to choose an image for an image layer than for a tile object, since the latter requires adding the image to a tileset first (can be an image collection, but still). And you also can't change the image of a tile object yet (you'd just create a new object).

@NonlinearIdeas

This comment has been minimized.

Copy link
Author

commented Jan 26, 2016

I thought about this a bit more and realized I can add a tileset as "1 tile for the whole image". Then I can place a tile layer with just the one tile (very large) in it and offset it as needed to place it where I want it in the layer stack. Perhaps this is what you meant by "tile object"?

This is somewhat workable. I can create the tileset as a single image and align the image to the grid. If I wanted to offset the layer (I don't always want the image aligned to a tile edge), I could control the offset of the layer, but this does not appear to be supported in CocosSharp :(...yet. Changing the x,y of the tileset itself is not supported either and would mean the tile could not be reused.

At least it is better than dropping the entire image, as is what happens when image layer is not supported at all.

@bjorn

This comment has been minimized.

Copy link
Owner

commented Jan 26, 2016

I thought about this a bit more and realized I can add a tileset as "1 tile for the whole image". Then I can place a tile layer with just the one tile (very large) in it and offset it as needed to place it where I want it in the layer stack. Perhaps this is what you meant by "tile object"?

No, I'm calling it "object" because a tile object is one of the object types you can place on an Object Layer. There, you can freely place the tile (unrestricted to the grid). You can even scale and rotate the image if you want.

Also, I did not mean adding the image as a tileset with a single tile. While this works, it is very clumsy to specify the exact tile size and it will become hard to select once you have a lot of images. Instead, when you add a new tileset you would choose "Collection of Images" so that you can add individual images as tiles to the tileset using the small button below the Tileset view.

I would not be surprised if layer offset was not supported yet by CocosSharp given how recent this feature was added (Tiled 0.14).

@NonlinearIdeas

This comment has been minimized.

Copy link
Author

commented Jan 27, 2016

I tried this and I see what you are referring to now. It seems like an excellent replacement for the Image Layer functionality.

This feature is not supported by CocosSharp either :(, but I can parse out the data from the .tmx file if needed to create it.

Removing image layers entirely may impact other users, but making such a decision is not my call.

Thanks for the help.

@bjorn

This comment has been minimized.

Copy link
Owner

commented Jan 30, 2016

Yeah, I can't simply remove image layers. Another idea was to expand their functionality to include for example repeating the image. But really, that'd be nice to support for tile objects as well. In the end I want to re-think the map format from the ground up and make it more generic, and until then I think I'll just leave the image layers as they are.

Closing this issue now since the originally reported issue was fixed after all. :-)

@bjorn bjorn closed this Jan 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.