Table of Contents

Class ButtonRefExtensions

Namespace
MonkeyLoader.Resonite.UI
Assembly
MonkeyLoader.Resonite.Core.dll

Contains FrooxEngine.UIX.UIBuilder extension methods that simplify the creation of FrooxEngine.UIX.Buttons with FrooxEngine.UIX.ButtonRefRelay<T>s.

public static class ButtonRefExtensions
Inheritance
ButtonRefExtensions
Inherited Members

Methods

ButtonRef<T>(UIBuilder, in LocaleString, ButtonEventHandler<T>, T, float)

Creates a FrooxEngine.UIX.Button with text and adds a FrooxEngine.UIX.ButtonRefRelay<T> to it using the given parameters.

public static Button ButtonRef<T>(this UIBuilder builder, in LocaleString text, ButtonEventHandler<T> callback, T argument, float doublePressDelay = 0) where T : class, IWorldElement

Parameters

builder UIBuilder

The builder to use for creating the button.

text LocaleString

The text displayed on the button.

callback ButtonEventHandler<T>

The ButtonPressed handler for the created relay.

argument T

The Argument for the created relay.

doublePressDelay float

The DoublePressDelay for the created relay.

Returns

Button

The unchanged button.

Type Parameters

T

The type of the reference argument.

ButtonRef<T>(UIBuilder, in LocaleString, in colorX?, ButtonEventHandler<T>, T, float)

Creates a FrooxEngine.UIX.Button with text and adds a FrooxEngine.UIX.ButtonRefRelay<T> to it using the given parameters.

public static Button ButtonRef<T>(this UIBuilder builder, in LocaleString text, in colorX? buttonTint, ButtonEventHandler<T> callback, T argument, float doublePressDelay = 0) where T : class, IWorldElement

Parameters

builder UIBuilder

The builder to use for creating the button.

text LocaleString

The text displayed on the button.

buttonTint colorX?

The background color of the button.

callback ButtonEventHandler<T>

The ButtonPressed handler for the created relay.

argument T

The Argument for the created relay.

doublePressDelay float

The DoublePressDelay for the created relay.

Returns

Button

The unchanged button.

Type Parameters

T

The type of the reference argument.

ButtonRef<T>(UIBuilder, IAssetProvider<Sprite>, in LocaleString, ButtonEventHandler<T>, T, float)

Creates a FrooxEngine.UIX.Button with a sprite and text, and adds a FrooxEngine.UIX.ButtonRefRelay<T> to it using the given parameters.

public static Button ButtonRef<T>(this UIBuilder builder, IAssetProvider<Sprite> sprite, in LocaleString text, ButtonEventHandler<T> callback, T argument, float doublePressDelay = 0) where T : class, IWorldElement

Parameters

builder UIBuilder

The builder to use for creating the button.

sprite IAssetProvider<Sprite>

The sprite displayed on the button.

text LocaleString

The text displayed on the button.

callback ButtonEventHandler<T>

The ButtonPressed handler for the created relay.

argument T

The Argument for the created relay.

doublePressDelay float

The DoublePressDelay for the created relay.

Returns

Button

The unchanged button.

Type Parameters

T

The type of the reference argument.

ButtonRef<T>(UIBuilder, IAssetProvider<Sprite>, in colorX, in LocaleString, ButtonEventHandler<T>, T, float, float, float)

Creates a FrooxEngine.UIX.Button with a sprite and text, and adds a FrooxEngine.UIX.ButtonRefRelay<T> to it using the given parameters.

public static Button ButtonRef<T>(this UIBuilder builder, IAssetProvider<Sprite> sprite, in colorX spriteTint, in LocaleString text, ButtonEventHandler<T> callback, T argument, float doublePressDelay = 0, float buttonTextSplit = 0.33333, float buttonTextSplitGap = 0.05) where T : class, IWorldElement

Parameters

builder UIBuilder

The builder to use for creating the button.

sprite IAssetProvider<Sprite>

The sprite displayed on the button.

spriteTint colorX

The tint of the sprite.

text LocaleString

The text displayed on the button.

callback ButtonEventHandler<T>

The ButtonPressed handler for the created relay.

argument T

The Argument for the created relay.

doublePressDelay float

The DoublePressDelay for the created relay.

buttonTextSplit float

The ratio of the button to use for the sprite.

buttonTextSplitGap float

The ratio of the button to keep as space between sprite and text. The sprite and text ratios are decreased by half of it.

Returns

Button

The unchanged button.

Type Parameters

T

The type of the reference argument.

ButtonRef<T>(UIBuilder, IAssetProvider<Sprite>, in colorX?, in colorX, ButtonEventHandler<T>, T, float)

Creates a FrooxEngine.UIX.Button with a sprite and adds a FrooxEngine.UIX.ButtonRefRelay<T> to it using the given parameters.

public static Button ButtonRef<T>(this UIBuilder builder, IAssetProvider<Sprite> sprite, in colorX? buttonTint, in colorX spriteTint, ButtonEventHandler<T> callback, T argument, float doublePressDelay = 0) where T : class, IWorldElement

Parameters

builder UIBuilder

The builder to use for creating the button.

sprite IAssetProvider<Sprite>

The sprite displayed on the button.

buttonTint colorX?

The background color of the button.

spriteTint colorX

The tint of the sprite.

callback ButtonEventHandler<T>

The ButtonPressed handler for the created relay.

argument T

The Argument for the created relay.

doublePressDelay float

The DoublePressDelay for the created relay.

Returns

Button

The unchanged button.

Type Parameters

T

The type of the reference argument.

ButtonRef<T>(UIBuilder, Uri, in LocaleString, ButtonEventHandler<T>, T, float)

Creates a FrooxEngine.UIX.Button with a sprite and text, and adds a FrooxEngine.UIX.ButtonRefRelay<T> to it using the given parameters.

public static Button ButtonRef<T>(this UIBuilder builder, Uri spriteUrl, in LocaleString text, ButtonEventHandler<T> callback, T argument, float doublePressDelay = 0) where T : class, IWorldElement

Parameters

builder UIBuilder

The builder to use for creating the button.

spriteUrl Uri

The url for the sprite displayed on the button.

text LocaleString

The text displayed on the button.

callback ButtonEventHandler<T>

The ButtonPressed handler for the created relay.

argument T

The Argument for the created relay.

doublePressDelay float

The DoublePressDelay for the created relay.

Returns

Button

The unchanged button.

Type Parameters

T

The type of the reference argument.

ButtonRef<T>(UIBuilder, Uri, in LocaleString, in colorX?, in colorX, ButtonEventHandler<T>, T, float)

Creates a FrooxEngine.UIX.Button with a sprite and text, and adds a FrooxEngine.UIX.ButtonRefRelay<T> to it using the given parameters.

public static Button ButtonRef<T>(this UIBuilder builder, Uri spriteUrl, in LocaleString text, in colorX? buttonTint, in colorX spriteTint, ButtonEventHandler<T> callback, T argument, float doublePressDelay = 0) where T : class, IWorldElement

Parameters

builder UIBuilder

The builder to use for creating the button.

spriteUrl Uri

The url for the sprite displayed on the button.

text LocaleString

The text displayed on the button.

buttonTint colorX?

The background color of the button.

spriteTint colorX

The tint of the sprite.

callback ButtonEventHandler<T>

The ButtonPressed handler for the created relay.

argument T

The Argument for the created relay.

doublePressDelay float

The DoublePressDelay for the created relay.

Returns

Button

The unchanged button.

Type Parameters

T

The type of the reference argument.

ButtonRef<T>(UIBuilder, Uri, ButtonEventHandler<T>, T, float)

Creates a FrooxEngine.UIX.Button with a sprite and adds a FrooxEngine.UIX.ButtonRefRelay<T> to it using the given parameters.

public static Button ButtonRef<T>(this UIBuilder builder, Uri spriteUrl, ButtonEventHandler<T> callback, T argument, float doublePressDelay = 0) where T : class, IWorldElement

Parameters

builder UIBuilder

The builder to use for creating the button.

spriteUrl Uri

The url for the sprite displayed on the button.

callback ButtonEventHandler<T>

The ButtonPressed handler for the created relay.

argument T

The Argument for the created relay.

doublePressDelay float

The DoublePressDelay for the created relay.

Returns

Button

The unchanged button.

Type Parameters

T

The type of the reference argument.

ButtonRef<T>(UIBuilder, Uri, in colorX?, in colorX, ButtonEventHandler<T>, T, float)

Creates a FrooxEngine.UIX.Button with a sprite and adds a FrooxEngine.UIX.ButtonRefRelay<T> to it using the given parameters.

public static Button ButtonRef<T>(this UIBuilder builder, Uri spriteUrl, in colorX? buttonTint, in colorX spriteTint, ButtonEventHandler<T> callback, T argument, float doublePressDelay = 0) where T : class, IWorldElement

Parameters

builder UIBuilder

The builder to use for creating the button.

spriteUrl Uri

The url for the sprite displayed on the button.

buttonTint colorX?

The background color of the button.

spriteTint colorX

The tint of the sprite.

callback ButtonEventHandler<T>

The ButtonPressed handler for the created relay.

argument T

The Argument for the created relay.

doublePressDelay float

The DoublePressDelay for the created relay.

Returns

Button

The unchanged button.

Type Parameters

T

The type of the reference argument.

ButtonRef<T>(UIBuilder, Uri, in colorX?, ButtonEventHandler<T>, T, float)

Creates a FrooxEngine.UIX.Button with a sprite and adds a FrooxEngine.UIX.ButtonRefRelay<T> to it using the given parameters.

public static Button ButtonRef<T>(this UIBuilder builder, Uri spriteUrl, in colorX? buttonTint, ButtonEventHandler<T> callback, T argument, float doublePressDelay = 0) where T : class, IWorldElement

Parameters

builder UIBuilder

The builder to use for creating the button.

spriteUrl Uri

The url for the sprite displayed on the button.

buttonTint colorX?

The background color of the button.

callback ButtonEventHandler<T>

The ButtonPressed handler for the created relay.

argument T

The Argument for the created relay.

doublePressDelay float

The DoublePressDelay for the created relay.

Returns

Button

The unchanged button.

Type Parameters

T

The type of the reference argument.

SetupRefRelay<TButton, TArgument>(TButton, ButtonEventHandler<TArgument>, TArgument, float)

Creates a FrooxEngine.UIX.ButtonRefRelay<T> with the given parameters for this button.

[Obsolete("Use WithRefRelay instead.")]
public static TButton SetupRefRelay<TButton, TArgument>(this TButton button, ButtonEventHandler<TArgument> callback, TArgument argument, float doublePressDelay = 0) where TButton : IButton where TArgument : class, IWorldElement

Parameters

button TButton

The button to set up with a FrooxEngine.UIX.ButtonRefRelay<T>.

callback ButtonEventHandler<TArgument>

The ButtonPressed handler for the created relay.

argument TArgument

The Argument for the created relay.

doublePressDelay float

The DoublePressDelay for the created relay.

Returns

TButton

The unchanged button.

Type Parameters

TButton

The specific type of the button.

TArgument

The type of the reference argument.

WithRefRelay<TButton, TArgument>(TButton, ButtonEventHandler<TArgument>, TArgument, float)

Creates a FrooxEngine.UIX.ButtonRefRelay<T> with the given parameters for this button.

public static TButton WithRefRelay<TButton, TArgument>(this TButton button, ButtonEventHandler<TArgument> callback, TArgument argument, float doublePressDelay = 0) where TButton : IButton where TArgument : class, IWorldElement

Parameters

button TButton

The button to set up with a FrooxEngine.UIX.ButtonRefRelay<T>.

callback ButtonEventHandler<TArgument>

The ButtonPressed handler for the created relay.

argument TArgument

The Argument for the created relay.

doublePressDelay float

The DoublePressDelay for the created relay.

Returns

TButton

The unchanged button.

Type Parameters

TButton

The specific type of the button.

TArgument

The type of the reference argument.