Novolis Docs
novolis-rendering / design-two-d.md

2D rendering (`Novolis.Rendering.TwoD`)

dotnetgraphicsrenderingnovolis

Orthographic 2D renderer for platformers (Mario-style): backgrounds, sprite animation, static polygons with colliders, HUD, and menus.

Packages

PackageRole
Novolis.Rendering.TwoDHost-neutral scene, collision, HUD, menus
Novolis.Rendering.Backends.TwoD.SilkSilk.NET OpenGL draw + window loop + PNG load

Path tracing packages (Novolis.Rendering.Runtime, Backends.Cpu, etc.) stay separate. Apps can use both stacks if needed.

Conventions

  • World space: BCL Vector3 on the XZ plane (Y = 0).
  • Screen HUD/menus: pixel coordinates, origin top-left.
  • No Vector2 in public API.

Mario-style checklist

FeatureAPI
Background imageTwoDScenePrimitives.AddBackground + SilkTwoDPngLoader
Character animationTwoDAnimatedSprite + TwoDAnimationClip.FromRow
Platforms / blocksTwoDScene.AddPlatform or TwoDStaticPolygon
CollisionTwoDCollisionWorld.MoveCircle
HUDTwoDHud.AddText / AddSprite
MenusTwoDMenuStack.Push + SilkTwoDGame menu keys

Layered grid export

TwoDSceneGridRasterizer / TwoDScene.ToLayeredGrids() produce per-TwoDDrawLayer DenseGrid<Rgba32> buffers for unit tests and ASCII debug (TwoDLayerGridSet.ToAscii). No Silk/OpenGL required.

Related