Skip to content
Grzi edited this page Mar 18, 2024 · 13 revisions

Scion is a tiny 2D oriented game making library. This wiki will tell you everything you need to get started with scion.

The lib is built on top of three main libs, wgpu/winit (for the rendering and windowing) and hecs (for the ECS). Scion uses ECS under the hood to handle each behaviours and features that you can use in your game, like animation, hierarchy system or collision detection.

This lib is not an oerly optimized game making lib, it's a modest lib that exposes a little engine to make quick games.

A first main function

You can find examples of scion's usage in the example directory of the repository. Although, if you want to see it in action, here is a quick pic:

To create a scion app, create a main.

fn main() {
    Scion::app_with_config_path(&path_to_config())
        .run();
}

Then create a scene :

#[derive(Default)]
pub struct MyScene;

impl Scene for MyScene {
    fn on_start(&mut self, data: &mut GameData) { 
        data.add_default_camera(); // Adds a camera, mandatory to be able to render something.
    }

    fn on_update(&mut self, data: &mut GameData) {
        // do things ... 
    }
}

And add the scene as the main scene of the game :

fn main() {
    Scion::app_with_config_path(&path_to_config())
        .with_scene::<MyScene>()
        .run();
}

And that's it, the app is running until the window is closed. To go further, please take a look on "Get started" page

Features list

  • Entity component system
  • Basic objects
  • Basic UI
    • Images
    • Buttons
    • Text (Bitmap and truetype fonts)
    • Input Text
  • Scene & Scene controller
  • Audio
  • Material
    • Texture
    • Color
    • Tileset
  • Inputs
  • Signals & Events
  • Timers
  • Animations
    • Transformation
    • Sprite animation
    • Blinking
    • Color
    • Text
  • Collision detection
    • Square
    • Rectangle
    • Polygon
  • Tiled integration
    • Custom tiled tileset exporter
    • Custom tiled tilemap exporter

Entity components system

let entity_id = data.push((1, true, 9.0));

Resources

Basic objects

Each displayed object in a game is represented by an object type. For example, a background may be a rectangle with a color or a texture applied to it, a character may be a sprite, that can be animated by using different sprite id on a tileset material, and a game level may be a tilemap composed of n by m sprites.

To represents those objects, scion gives a list of objects that can be used :

  • Square :
  • Rectangle :
  • Triangle :
  • Line-Polygon :
  • Line :
  • Sprite :
  • Tilemap :

Basic UI

Scene & Scene controller

Audio

Material

Animations

Inputs

Signals & Events

Timers

Collision detection

Tiled integration