-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Option to restrict layer to a single tileset #153
Comments
There was also a plan to be able to associate a layer with a tileset, so that when switching to that layer, Tiled will automatically jump to the right tileset. |
Would be nice feature indeed |
Sometimes one would need multiple layers to use the same tileset, for example if we have an expansive map and for performance reasons can only display X regions at a time (one region per layer). Please take this use case into consideration. |
Or one can use a common tileset for universal tiles, together with level-specific ones, not to have to duplicate the common tiles in each. Being able to use more than one tileset in the same layer can be a pretty useful feature, please take it into account. |
@Jocchan Using more than one tileset in the same layer is already possible. The problem is that cocos2d-iphone does not support this, so this issue is about adding an option to Tiled to limit the user to one tileset per layer, to prevent him from creating maps that won't work with cocos2d-iphone. |
Oh, I know it's already possible. I guess I misread your comment, as it looked like you were planning to add the restriction of one tileset per layer, more than the option of doing so. My bad. |
The same goes for Andengine, it uses a sprite-batch to draw the tiles, so its only possible for a layer to use 1 tileset at a time, so its not really a problem if you manage the tile sets correctly. You could easily get around this by modifying the code to plonk all the tilesets in the same texture region on a layer, but is a disadvantage because you're using up resources. But as a feature for Tiled it would be quite nice. |
Musing on this, as this is a feature I'd quite like for my own projects. If all the tiles are in a single tileset, I can use a single batch draw call to draw the whole layer, and it would be very useful to enforce this in the editor. For now, I'm instead enforcing limitation of one tileset per map because it's much easier to keep track of. It would be most convenient if the layers in the TMX/JSON map files included a reference to the tileset they use. It would suck to have to figure out the tileset for each layer by finding a non-empty tile and checking its gid. Since these formats provide a list of tilesets, this reference could just be an index into that list. Since Tiled has gotten Projects since this issue was created, I think this should be a Project setting rather than a Preferences one. In Tiled itself, there are two major challenges for this feature:
Additionally, Tiled will need to communicate when a brush contains some tiles that will not be allowed to be placed. I think it would be intuitive if it showed the allowed tiles with the default brush preview highlight, and the disallowed tiles with the red highlight you get when trying to paint on a locked layer. |
I want this feature so badly :) |
This feature has been requested again on Discord, by jseb. |
I'd also like this. In my case, it's a separation between front vs back tiles, where back ones have a different tileset. My $0.02 on above questions:
Layer properties exist, and I'd prefer a manual setting to automated. Something like a string with a tileset name per line or similar would work. Or if "special" type is added for this, not unlike parallax offset, which has a float[2], normally not available as a custom property.
I'd argue warnings + a wizard makes sense. |
I don't think it's moot, since even manually, one can set up this limit after already adding a bunch of tiles from other tilesets. |
I just started using Tiled yesterday and this is the one feature I've been missing |
Cocos2d only allows one tileset per tile layer. It is very easy to accidentally click the tile stamp tool on the wrong layer and it can be difficult to undo the problem if it is not noticed immediately. What is worse, Cocos2d can not recover from this problem and completely fails to load the tileset.
I would like to request a checkbox option in preferences to enforce "one tileset per layer". After a given tileset has been used in a layer, then an error dialog will appear if the end user tries to use a different tileset with that layer.
The text was updated successfully, but these errors were encountered: