Table of Contents

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

game IGame

The 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

game IGame

The 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

game IGame

The 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

game IGame

The game.

host StrideIcyHost

The host, or null.

Returns

bool

true when IcyUI is set up.

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

game IGame

The game; call this from a startup script's Start(), or after BeginRun() 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

game IGame

The game; call this from a startup script's Start(), or after BeginRun() in a code-only game.

configure Action<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

builder IAssetConfigurationBuilder

The asset configuration builder instance to configure.

game IGame

The 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

builder IConfigurationBuilder

The configuration builder instance to configure.

game IGame

The 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: