NEOLearn

2D

Draw 2D games with the NEO engine: sprites, sprite sheets, 2D meshes and shapes, text in the world, 2D cameras and tilemaps.

Updated October 20, 2026

On this page

The NEO engine draws 2D scenes with the same entities, components and systems as 3D ones. A 2D scene is a Camera2d plus entities that carry something to draw: a Sprite, a Mesh2d with a material, a Text2d or a TilemapChunk. Each has a Transform, so you move, rotate and scale it like anything else.

2D rendering is part of the 2d profile, which NEO's builds turn on by default. It runs on every platform NEO supports, including the browser.

A minimal 2D scene#

src/main.rs
use neo::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_systems(Startup, setup)
        .run();
}

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
    commands.spawn(Camera2d);
    commands.spawn(Sprite::from_image(asset_server.load("branding/icon.png")));
}

With the default 2D camera, one world unit is one logical pixel and the origin is the centre of the window. +X is right and +Y is up. Z orders entities: higher translation.z draws on top.

What draws in 2D#

ComponentWhat it isPage
SpriteAn image, a solid colour or a frame of a sprite sheet.Sprites
TextureAtlasPicks one frame of a sprite sheet.Texture atlases
Mesh2d + MeshMaterial2dA flat mesh (a circle, a polygon, your own) with a material.2D shapes and meshes
Text2dText placed in the world.Text in 2D
Camera2dAn orthographic camera for 2D.2D cameras
TilemapChunkA grid of tiles drawn in one draw call.Tilemaps

For interface elements that follow the screen rather than the world, such as menus, health bars and buttons, use UI nodes instead.

Pages in this section#

  • Sprites: images, tints, flipping, sizing, slicing and tiling.
  • Texture atlases: sprite sheets, building atlases and frame animation.
  • 2D shapes and meshes: primitives, ColorMaterial and custom 2D materials.
  • Text in 2D: Text2d, fonts, wrapping and anchors.
  • 2D cameras: projection, zoom, cursor to world and pixel-perfect rendering.
  • Tilemaps: TilemapChunk and per-tile data.

Next steps#