2D scene support (SpriteComponent + 2D render system) #14

Closed
opened 2026-09-25 20:36:45 -07:00 by burkkyy · 0 comments
Owner

A 2D scene is just a Scene: persistent 2D content lives in the ECS like everything else. Canvas stays separate as immediate-mode drawing (see the Canvas immediate-mode issue).

What already exists

  • CameraComponent with Projection::Orthographic
  • TransformComponent: position.xy for placement, position.z (or a separate sort key) for draw order, rotate only around Z
  • Scene views, hierarchy/inspector panels, scene registry

Needed

  • SpriteComponent: texture handle, color/tint, size, and maybe UV rect / pivot
  • Maybe a ShapeComponent for untextured quads/circles
  • A 2D render system in SceneRenderer that batches sprites, sorted by draw order
  • Texture resource + pool, if there isn't one yet
  • Inspector support for the new components

Done when

  • A scene with an orthographic camera and sprite entities renders in a scene view
  • Sprites can be added/edited through the editor inspector
  • An example (e.g. port boids_2d) uses a 2D scene instead of Canvas
A 2D scene is just a `Scene`: persistent 2D content lives in the ECS like everything else. Canvas stays separate as immediate-mode drawing (see the Canvas immediate-mode issue). ## What already exists - `CameraComponent` with `Projection::Orthographic` - `TransformComponent`: `position.xy` for placement, `position.z` (or a separate sort key) for draw order, rotate only around Z - Scene views, hierarchy/inspector panels, scene registry ## Needed - `SpriteComponent`: texture handle, color/tint, size, and maybe UV rect / pivot - Maybe a `ShapeComponent` for untextured quads/circles - A 2D render system in `SceneRenderer` that batches sprites, sorted by draw order - Texture resource + pool, if there isn't one yet - Inspector support for the new components ## Done when - A scene with an orthographic camera and sprite entities renders in a scene view - Sprites can be added/edited through the editor inspector - An example (e.g. port `boids_2d`) uses a 2D scene instead of Canvas
burkkyy added the enhancement label 2026-09-25 20:36:45 -07:00
burkkyy added this to the sophia project 2026-09-25 20:37:54 -07:00
burkkyy moved this to Todo in sophia on 2026-09-25 20:43:57 -07:00
burkkyy moved this to Done in sophia on 2026-09-30 15:56:41 -07:00
Sign in to join this conversation.