selene

ECS game engine in MoonBit

Game Engine
moon add KKKIIO/selene@0.37.5
Download zip
Author
Version
0.37.5
License
Apache-2.0
Last updated
18 days ago
Downloads
58
README

#KKKIIO/selene

Core ECS/runtime package for Selene.

It includes app/runtime orchestration, ECS data flow, ordinary assets, named texture-atlas import/resolution, scenes, animation, 2D/3D rendering, UI, compiled View hosting, physics, and editor-bridge document codecs.

#Install

moon add KKKIIO/selene

#Backends

Use this package together with:

  • KKKIIO/selene_webgpu for web builds
  • KKKIIO/selene_raylib for native builds

#2D Geometry

KKKIIO/selene/mesh2d provides centered rectangle and circle primitives plus segment, polyline, triangle, convex polygon, ellipse, vertical capsule, regular polygon, circular sector, and annulus geometry. Explicit points use entity-local coordinates; ellipse sizes are half sizes, capsule length is the straight-section half length, and sector angles are radians centered on the positive x axis.

Filled primitives are triangulated into the backend-independent GeometryDrawCommand2D contract and render consistently through both the WebGPU and raylib backends. Tessellation and local bounds are cached when an asset is registered or updated. Segments and polylines use one-pixel line lists. Convex polygon points must describe a convex boundary in order. Textured ColorMaterial projection remains specific to rectangle meshes; other primitives use the material color.

Construct assets with Mesh2dAsset::ellipse(...), Mesh2dAsset::convex_polygon(...), and the other named constructors, or use the matching ellipse(...), convex_polygon(...), and related helpers to register an asset and receive a Mesh2dHandle.

#Learn More