-
Notifications
You must be signed in to change notification settings - Fork 2
Coordinate Spaces
Gondwana uses several coordinate spaces on purpose, and understanding them early will save you a lot of confusion.
Grid space is tile-relative. A position like (4, 7) means “column 4, row 7” on a given SceneLayer.
This is useful for:
- tile addressing
- map logic
- spawn placement
- coordinate-system-aware movement
World space is Gondwana’s primary simulation space.
Most core engine logic happens here:
- camera position
- dirty rectangles
- sprite placement
- collision bounds
- layer origins
- view transforms
This is the engine’s real “source of truth.”
Screen space is render-surface space. These are the pixel coordinates on the destination surface after camera, parallax, viewport placement, and zoom have been applied.
This is where:
- the backbuffer is actually drawn
- dirty presentation regions are tracked
- view overlays live
Each SceneLayer has a coordinate system implementation that converts grid positions to world pixels. Orthogonal, isometric, and hex variants are handled at this layer.
That means grid-to-world math is layer-specific, not global.
Gameplay logic should usually think in world or grid space. Rendering code is where world becomes screen.
Grid -> World -> Screen
That pipeline is everywhere in Gondwana.
Gondwana/Scenes/SceneLayer.csGondwana/Rendering/Views/View.cs- coordinate classes under
Gondwana/Drawing/Coordinates/