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

Some improvements to TileSetScenesCollectionSource docs #94329

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Jul 13, 2024

Adds some clarifications to TileSetScenesCollectionSource description regarding how scenes are indexed. Also adds a code example how to get scene ID from a tile, because it's not obvious.

Closes #73645

@KoBeWi KoBeWi added this to the 4.3 milestone Jul 13, 2024
@KoBeWi KoBeWi requested a review from a team as a code owner July 13, 2024 20:39
@Mickeon
Copy link
Contributor

Mickeon commented Jul 13, 2024

Still insane to me that one would have to follow that relatively verbose example because the API is not exactly accessible.

@KoBeWi
Copy link
Member Author

KoBeWi commented Jul 13, 2024

It can be reduced to single (less safe) line, but it's not exactly friendly:

tile_set.get_source(tile_map_layer.get_cell_source_id(cell)).get_scene_tile_scene(tile_map_layer.get_cell_alternative_tile(cell))

We could add a method similar to get_cell_tile_data(), which is only relevant to TileSetAtlasSource, but there is no high demand for it.

@Mickeon
Copy link
Contributor

Mickeon commented Jul 13, 2024

Strictly speaking the fact that it takes so many operations to get the "starting information" that you need is insane. It's not just for getting Scene Collections, it's for getting information on tiles in general (I speak by experience). I guess it's also a byproduct of cell data being split in 3 like this.

@akien-mga akien-mga merged commit 5ace3fb into godotengine:master Jul 17, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@KoBeWi KoBeWi deleted the sceneles branch July 17, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get_tiles_count on Scene Collection returns wrong number
4 participants