mirror of
https://github.com/tiennm99/godot.git
synced 2026-08-06 06:24:01 +00:00
Add ability to bind typed arrays to script API
Note: Only replaced 2 instances to test, Node.get_children and TileMap.get_used_cells Note: Will do a mass replace on later PRs of whathever I can find, but probably need a tool to grep through doc. Warning: Mono will break, needs to be fixed (and so do TypeScript and NativeScript, need to ask respective maintainers)
This commit is contained in:
@@ -1691,14 +1691,14 @@ bool TileMap::is_centered_textures_enabled() const {
|
||||
return centered_textures;
|
||||
}
|
||||
|
||||
Array TileMap::get_used_cells() const {
|
||||
TypedArray<Vector2i> TileMap::get_used_cells() const {
|
||||
|
||||
Array a;
|
||||
TypedArray<Vector2i> a;
|
||||
a.resize(tile_map.size());
|
||||
int i = 0;
|
||||
for (Map<PosKey, Cell>::Element *E = tile_map.front(); E; E = E->next()) {
|
||||
|
||||
Vector2 p(E->key().x, E->key().y);
|
||||
Vector2i p(E->key().x, E->key().y);
|
||||
a[i++] = p;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user