creates a new scene
adds a manager to this scene
called internally on scene creation
create an entity given a name
create an entity given a name and a 2d position
create an entity given a name and a 3d position
called internally on scene destruction
called at the start of the scene
window resize event
run postprocessors
called internally to render ecs
may optionally be used to render global things from a scene
setup that hapostprocessorsens after begin, but before the child scene starts
called right before cleanup
called internally to update ecs. can be overridden, but super.update() must be called.
gets the render resolution. initialized to Core.default_resolution
sets the render resolution and updates the render target
the mode for compositing a scene onto the display buffer
the cleared background color
the mode of compositing
the entity manager
updatable managers
postprocessors effects
the render target
create a test game, with a test scene, and update it
import re.util.test : TestGame; static class TestScene : Scene2D { class Plant : Component, Updatable { public int height = 0; void update() { height++; } } override void on_start() { // create a basic entity auto nt = create_entity("apple"); // add a basic component nt.add_component(new Plant()); } } auto my_scene = new TestScene(); class Game : TestGame { override void initialize() { load_scenes([my_scene]); } } auto game = new Game(); game.run(); // make sure scene is accessible assert(game.primary_scene == my_scene, "primary scene does not match loaded scene"); // make sure components worked assert(my_scene.get_entity("apple").get_component!(TestScene.Plant)() .height > 0, "test Updatable was not updated"); game.destroy(); // clean up // make sure scene is cleaned up assert(my_scene.ecs is null, "scene was not cleaned up");
represents a collection of entities that draw to a texture