I have a collection of images such as trees, rocks, etc… And it cool that you can design you level with them. My only issue is that I would like to offset some of the images of that collections. As far as I know, you can’t position freely an image (not talking about image layer). They all snap to the grid. For instance, I would like to position the same rock 5 times but each time with a small vertical offset to create a none linear composition.
Is this possible?
You can place the tiles as Tile Objects in an object layer, which lets you place them arbitrarily, without snapping (as long as you don’t use Snap to Grid in View > Snapping).
Keep in mind, however, that most generic Tiled map parsers will treat these as dynamic entities since that’s the more typical use for Objects, and may thus incur a performance penalty if you’re not careful because they usually can’t apply the same optimisations to Tile Objects that they can to tiles in tile layers. This isn’t an issue if you’re exporting just an image of your whole map, or if your set-up allows marking these objects as static in-engine.
cool, thanks for the performance note. Okey then, I’ll just use tile layer because I want to prevent any performance issue. The way I see that object layers are use is to create rectangles representing spawn points, or check points, etc… is this correct?
Object Layers can be used for much more than that, since multiple object types and shapes are available (rectangles, points, polygons, polylines, ellipses, and tile objects). Tile Objects are commonly used to represent NPCs, doors, and other dynamic elements that are represented by sprites in-game.
You should check what capabilities your game/engine have before you discount using Tile Objects for cosmetic things. As I said, if you have some way to turn them into static entities when you load the map, then performance should not be an issue. For example, if you know you have a layer of static trees/rocks/etc, you can turn those into a single static mesh similar to that of a tile layer, provided that your engine allows something like this.
FWIW the usual solution to positioning static tiles more “freely” is to use a smaller tile grid, so that you have more ways to position large entities next to each other. Tiled allows using larger tiles than your tile grid, you can keep using your large tree/rock/etc tiles on the smaller grid. However, if your base ground tiles are also large, then using them on a smaller grid will be annoying.
Ok, I’ll keep that in mind. I am using Axmol, which a cocos2dx fork. I 'll have to investigate what you mention about turning them into static entities.
I added an image of what I am doing. It’s a platformer game.
the columns are set as images using a collection of images tile layer.
The Statues are set as images in the object layer (let’s imagine they are enemies or npc).
My level can have easily 100 or 200 cosmetic sprites, so I guess I’ll test both options.