godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Add `TileMap::set_cell_autotile_coord()` method #2898

Open berarma opened 3 years ago

berarma commented 3 years ago

Describe the project you are working on

A demo for a platformer game.

Describe the problem or limitation you are having in your project

I want to change tiles dynamically in a tilemap depending on users actions. I use an Atlas for related tiles, multiple possible states for a tile element.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Similarly, to the TileMap::get_cell_autotile_coord() I think it would be useful to have a corresponding setter method. It would make it possible to create dynamic/procedural tile maps using atlases.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I think the new functionality is self explanatory. It's just filing a hole in the API.

If this enhancement will not be used often, can it be worked around with a few lines of script?

I don't know of any workaround unless I use individual tiles instead of atlases, but that would take a lot of time and make management of tile resources harder.

Is there a reason why this should be core and not an add-on in the asset library?

I think it's an elemental building block in the API that would complement the corresponding getter.

Calinou commented 3 years ago

cc @groud