Table of Contents

Class GameExtensions

Namespace
Stride.CommunityToolkit.Skyboxes
Assembly
Stride.CommunityToolkit.Skyboxes.dll

Provides extension methods for the Game class to enhance functionality such as adding skyboxes and other game elements.

public static class GameExtensions
Inheritance
GameExtensions

Remarks

These methods allow for easy integration of common game elements into a Stride game project, reducing the need for manual setup.

Methods

AddSkybox(Game, string?)

Adds a skybox to the specified game scene, providing a background texture to create a more immersive environment.

public static Entity AddSkybox(this Game game, string? entityName = "Skybox")

Parameters

game Game

The Game instance to which the skybox will be added.

entityName string

The optional name for the skybox entity. If null, a default name ("Skybox") will be used.

Returns

Entity

The created Entity representing the skybox.

Examples

This example demonstrates how to add a skybox to a game:

game.AddSkybox();

Remarks

The skybox texture is loaded from the Resources folder and is used to generate a skybox using the SkyboxGenerator. The skybox entity is created with both a BackgroundComponent and a LightComponent, configured for the skybox. The entity is added to the root scene of the game and placed at the default position (0.0f, 2.0f, -2.0f).