update docs

This commit is contained in:
wooshings
2026-10-27 21:13:12 -07:00
parent f2654d8f8a
commit c45e6b1dbb
9 changed files with 372 additions and 121 deletions
+11 -10
View File
@@ -2,35 +2,36 @@ package shoal
import rl "vendor:raylib"
// what the app's window opens with: size, title, and the clear color
// DefaultPlugin paints at PRE_DRAW
// what the app's window opens with: size, title, and the clear color.
// DefaultPlugin opens the window from it at STARTUP and paints the clear
// color at PRE_DRAW
WindowComponent :: struct {
width: i32,
height: i32,
title: string,
background: rl.Color,
}
// pre-created global storage — just pass &Window, no need to declare it.
// the same goes for every storage in this file
Window: Storage(WindowComponent)
// the mouse position, refreshed every UPDATE by DefaultPlugin
CursorComponent :: struct {
position: rl.Vector2,
}
Cursor: Storage(CursorComponent)
// a texture DefaultPlugin draws at DRAW, placed by the same entity's
// Transform (so every sprite entity needs a Transform component too)
// TransformComponent (so every sprite entity needs a Transform component
// too)
SpriteComponent :: struct {
texture: rl.Texture2D,
}
Sprite: Storage(SpriteComponent)
// 2D translation + rotation, read back by draw_sprite when it places the
// entity's Sprite
// entity's SpriteComponent
TransformComponent :: struct {
translation: rl.Vector2,
rotation: f32,
}
Transform: Storage(TransformComponent)
// components are plain struct declarations. the world holds every storage
// internally, keyed by the component's typeid and created on first add (see
// get_storage in entities.odin), so there's nothing to declare next to a
// component