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

Add a method to get TileData from a cell #54549

Merged
merged 1 commit into from
Aug 22, 2022

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Nov 3, 2021

So recently I tried the custom data in TileSets and discovered that to get custom data you need to do

var source = tile_set.get_source(get_cell_source_id(0, cell, false))
var data: TileData = source.get_tile_data(get_cell_atlas_coords(0, cell, false), 0)

if data.get_custom_data("actual_data"):
	stuff

That's a lot of writing for something so basic (and this snippet won't even work in all cases). So this PR adds a helper method to get the data easier.

Also it fixes use_proxies not defaulting to false as they should be.

Copy link
Member

@groud groud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that helper makes sense as used often. Maybe yous could add a comment stating this is a helper method, not an accessor vital to TileMap good functioning?

@KoBeWi KoBeWi force-pushed the fastcells branch 2 times, most recently from db4a3ac to cd8fb5f Compare July 29, 2022 22:47
@KoBeWi KoBeWi requested a review from groud July 29, 2022 22:47
@YuriSizov
Copy link
Contributor

@groud @KoBeWi Can this be moved forward? What needs to be fixed? Also a rebase

@KoBeWi
Copy link
Member Author

KoBeWi commented Aug 16, 2022

Rebased. I removed the use_proxies argument change (moved to #64496).

@YuriSizov YuriSizov merged commit d5052d9 into godotengine:master Aug 22, 2022
@YuriSizov
Copy link
Contributor

Thanks!

@KoBeWi KoBeWi deleted the fastcells branch August 22, 2022 10:58
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.

3 participants