Table of Contents

Class SceneSetup

Namespace
Stride.CommunityToolkit.Engine
Assembly
Stride.CommunityToolkit.dll

What a code-only game needs before its own content, as data: the graphics compositor, the camera, the ground, the physics engine and the engine settings. Run(Game, SceneSetup, Action<Scene>?, Action<Scene, GameTime>?, GameContext?) applies it before the start callback, in a fixed order, so the callback holds only the scene's own content.

public abstract class SceneSetup
Inheritance
SceneSetup
Derived
Extension Methods

Remarks

The set is closed: SceneSetup3D adds the lighting and the sky, SceneSetup2D an orthographic camera and a flat ground, and None applies nothing. Every property has a default, so new SceneSetup3D() is the whole bundle and a property changes one thing. A null Camera or Ground leaves that piece out.

A physics package and the skyboxes package add their pieces through extension methods on the setup (UseBepu(), UseSkybox()), which set the typed properties Physics and Skybox. The setup is a convenience layered on the Game extension methods; every helper also works without it, in a Game Studio project.

Properties

Camera

The camera on the compositor's first slot, or null for no camera.

public CameraSetup? Camera { get; set; }

Property Value

CameraSetup

ClearColor

The clear colour of the compositor, or null for the compositor's own default.

public Color? ClearColor { get; set; }

Property Value

Color?

DebugOverlay

Creates the DebugOverlay, so the first section added shows at once.

public bool DebugOverlay { get; set; }

Property Value

bool

GameSettings

Configures the engine's GameSettings before the window is created, through UseGameSettings(Game, Action<GameSettings>?): the graphics profile, the colour space, the window size.

public Action<GameSettings>? GameSettings { get; set; }

Property Value

Action<GameSettings>

Ground

The ground, or null for none. The physics engine gives it a collider when it has one.

public GroundSetup? Ground { get; set; }

Property Value

GroundSetup

Instancing

Puts the instancing render feature in the compositor, so instanced masters draw from the first frame; UseInstancing() sets it. Without it a master draws as one model and the run loop warns.

public bool Instancing { get; set; }

Property Value

bool

Msaa

The multisampling level of the forward renderer.

public MultisampleCount Msaa { get; set; }

Property Value

MultisampleCount

None

A setup that adds nothing to the scene: for a game that builds its compositor and scene by hand, and for the headless tests. What is not scene still applies when set, the physics engine, the game settings, the overlay and the profiler, so SceneSetup.None.UseBepu() is a hand-built scene whose primitives get Bepu bodies. A new instance each time, so what one game sets on it is not seen by the next.

public static SceneSetup None { get; }

Property Value

SceneSetup

Physics

The physics engine that CreatePrimitive and the grounds attach bodies and colliders with. A physics package sets it (UseBepu(), UseBullet()); None attaches nothing.

public PhysicsSetupBase Physics { get; set; }

Property Value

PhysicsSetupBase

PostEffects

Configures the compositor's post effects, which are otherwise all off but the tone map.

public Action<PostProcessingEffects>? PostEffects { get; set; }

Property Value

Action<PostProcessingEffects>

Profiler

Adds the frame-time profiler readout.

public bool Profiler { get; set; }

Property Value

bool