Class StrideBuildingExtensions
- Namespace
- Icy.Stride.Configuration
- Assembly
- IcyUI.Stride.dll
Provides extension methods for configuring IcyUI in Stride applications.
public static class StrideBuildingExtensions
- Inheritance
-
StrideBuildingExtensions
- Inherited Members
Methods
GetIcyCanvas(IGame)
Gets the main canvas of the game.
public static Canvas GetIcyCanvas(this IGame game)
Parameters
gameIGameThe game.
Returns
- Canvas
The host's MainCanvas.
Exceptions
- InvalidOperationException
IcyUI isn't set up yet: call UseIcyUI(IGame) first.
GetIcyConfiguration(IGame)
Gets the configuration IcyUI runs with in the game.
public static IcyConfiguration GetIcyConfiguration(this IGame game)
Parameters
gameIGameThe game.
Returns
- IcyConfiguration
The host's Configuration.
Exceptions
- InvalidOperationException
IcyUI isn't set up yet: call UseIcyUI(IGame) first.
GetIcyHost(IGame)
Gets the IcyUI host of the game.
public static StrideIcyHost GetIcyHost(this IGame game)
Parameters
gameIGameThe game.
Returns
- StrideIcyHost
The host UseIcyUI(IGame) created.
Exceptions
- InvalidOperationException
IcyUI isn't set up yet: call UseIcyUI(IGame) first.
TryGetIcyHost(IGame, out StrideIcyHost?)
Gets the IcyUI host of the game, if UseIcyUI(IGame) ran.
public static bool TryGetIcyHost(this IGame game, out StrideIcyHost? host)
Parameters
gameIGameThe game.
hostStrideIcyHostThe host, or null.
Returns
UseIcyUI(IGame)
Sets IcyUI up in the game with the default Stride configuration: the default theme, markup support,
system fonts with "Segoe UI", and log messages in Stride's log.
public static StrideIcyHost UseIcyUI(this IGame game)
Parameters
gameIGameThe game; call this from a startup script's
Start(), or afterBeginRun()in a code-only game.
Returns
- StrideIcyHost
The host, whose MainCanvas is ready for elements.
Exceptions
- InvalidOperationException
IcyUI is already set up for this game, or the scene has no graphics compositor yet.
UseIcyUI(IGame, Action<IConfigurationBuilder>)
Sets IcyUI up in the game: the default Stride configuration first, then configure.
public static StrideIcyHost UseIcyUI(this IGame game, Action<IConfigurationBuilder> configure)
Parameters
gameIGameThe game; call this from a startup script's
Start(), or afterBeginRun()in a code-only game.configureAction<IConfigurationBuilder>Changes the defaults, for example
ui => ui.ConfigureFonts().WithDefaultFontFamily("Arial").
Returns
- StrideIcyHost
The host, whose MainCanvas is ready for elements.
Exceptions
- InvalidOperationException
IcyUI is already set up for this game, or the scene has no graphics compositor yet.
UseStrideImporters(IAssetConfigurationBuilder, IGame)
Adds Stride-specific importers to the asset configuration builder.
public static IAssetConfigurationBuilder UseStrideImporters(this IAssetConfigurationBuilder builder, IGame game)
Parameters
builderIAssetConfigurationBuilderThe asset configuration builder instance to configure.
gameIGameThe game used for configuration.
Returns
- IAssetConfigurationBuilder
The updated asset configuration builder instance for fluent configuration.
WithDefaultStrideConfiguration(IConfigurationBuilder, IGame)
Configures the default settings for Stride in the provided configuration builder.
public static IConfigurationBuilder WithDefaultStrideConfiguration(this IConfigurationBuilder builder, IGame game)
Parameters
builderIConfigurationBuilderThe configuration builder instance to configure.
gameIGameThe game used for configuration.
Returns
- IConfigurationBuilder
The updated configuration builder instance for fluent configuration.
Remarks
Besides the Stride rendering, input and asset importers, the defaults are:
- markup support (AddMarkupSupport(IConfigurationBuilder));
- the built-in theme (UseDefaultTheme(IConfigurationBuilder));
- system fonts, with
"Segoe UI"as the default family; - log messages in Stride's log (
GlobalLogger), shown in the game console and Game Studio's output.