acron.canvas2d¶
The 2D stage: Godot’s 2D frame (x right, y DOWN, pixels) on Acron.
Godot 2D positions are in pixels with the origin top-left-ish (y grows down).
We map a Godot 2D point (x, y) to Acron world (x, 0, -y) – the XZ
plane, viewed by an orthographic camera looking down +Y. Distances stay in
pixels (Godot 2D “units” ARE pixels; ported constants like speed_x = 400
keep their meaning).
Draw order: Godot orders by z_index (then tree order). Depth
testing/writing is OFF for the whole canvas; everything renders in Acron’s
“fixed” cull bin with sort = z_index (ties resolve in scene-graph traversal
order, which mirrors Godot sibling order). Use set_z_index() on any
canvas node.
Viewport: Godot’s stretch/mode = "viewport" renders at the design
resolution and scales to the window; the ortho film size pins the visible area
to view_size pixels regardless of window size, which is the same behaviour.
|
Owns the canvas root and an orthographic 2D camera. |
Global Functions