How to display property on a grid or a object?

I have a map with size 512*512, it’s a lot of grids and objects with. some properties. Sometimes I need to move a property from a object to another one. Is there a more efficient way to view specific properties without having to click on many objects? For example, display it on a grid?

No, there is not. Maybe you could use Tile Objects to visually represent the properties objects have to make it easier to find the ones you need, perhaps in combination with scripting to update the tile used based on the properties the Object has.

Objects are generally not intended to be used in a vast grid where you might need to swap things around like this or to paint en masse, but more for dynamic or otherwise “special” entities, such as items and NPCs. For defining properties in a grid, the more convenient solution is generally to use tile layers with special tiles that visually represent the data (you’d need as many layers of these as you may have different properties in a single cell, or fewer if you have different tiles representing different combinations of properties). These layers aren’t drawn in the game, they’re just used for the data represented by the tiles.

If the value of property ranges from 1 to 100, then I would need 100 separate tiles. It‘s a big work. I just need to see the numbers on grid,maybe I can use script for automatically add text objects in a new layer instead?

100 tiles that are trivial to create (by e.g. using a gradient as your tileset, or one of any the thousands of existing images with 1-100 on them). I think a single tile layer using these 100 tiles is actually the ideal solution in this case. You wouldn’t actually need to load this image in your game, or even include it with your game files, since all you need is the custom properties (or in this case, not even that - the tile ID would be enough, tiles 0-99 would map to the values 1-100).

Here’s an example image you can use:
These tiles are 50x50, but if you set the tileset’s tile render size to “map grid”, they’ll automatically scale to fit your map’s tile size. You can make it transparent if you prefer in an image editor, add a glow, whatever you like.

If you prefer a gradient, make a gradient of any colours you like in any image editor. A 100x1 pixel gradient loaded as 1x1 tiles, again with “map grid size” tile render size. I think for 100 values though, the numbers above would be clearer, as each value is more distinct.

Creating a text layer and automatically updating it is an option, but Tiled scripts can’t yet respond to Objects being created or updated, so you’d have to manually run it. It might be easier to use Text Objects to begin with, having them snap to the grid, and using their text as their value.

1 Like

En… OK. Use text object as property would be OK for me. I’ll have a try later. Thank you kindly.

Also I would like a dynamic scriptable object which display with properties, it should be more clearly.

1 Like

Sorry for bother you. I use object layer for it, but it’s not works, so I issue a new question.