obsidian/MyObsidianVault/AWA/Godot/Learn GDScript from Zero/Random facts.md
2024-02-12 08:55:09 +01:00

10 lines
247 B
Markdown

pixel positions on the screen use Vector2 coordinates
cell to world using Vector2
```
var cell_size:Vector2 = Vector2(50.0, 50.0)
# or: var cell_size := Vector2(50.0, 50.0)
func grid_to_world(cell):
return cell + cell_size + cell_size / 2
```