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
builderUIBuilderThe builder to use for creating the button.
textLocaleStringThe text displayed on the button.
callbackButtonEventHandler<T>The ButtonPressed handler for the created relay.
argumentTThe Argument for the created relay.
doublePressDelayfloatThe DoublePressDelay for the created relay.
Returns
- Button
The unchanged button.
Type Parameters
TThe 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
builderUIBuilderThe builder to use for creating the button.
textLocaleStringThe text displayed on the button.
buttonTintcolorX?The background color of the button.
callbackButtonEventHandler<T>The ButtonPressed handler for the created relay.
argumentTThe Argument for the created relay.
doublePressDelayfloatThe DoublePressDelay for the created relay.
Returns
- Button
The unchanged button.
Type Parameters
TThe 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
builderUIBuilderThe builder to use for creating the button.
spriteIAssetProvider<Sprite>The sprite displayed on the button.
textLocaleStringThe text displayed on the button.
callbackButtonEventHandler<T>The ButtonPressed handler for the created relay.
argumentTThe Argument for the created relay.
doublePressDelayfloatThe DoublePressDelay for the created relay.
Returns
- Button
The unchanged button.
Type Parameters
TThe 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
builderUIBuilderThe builder to use for creating the button.
spriteIAssetProvider<Sprite>The sprite displayed on the button.
spriteTintcolorXThe tint of the sprite.
textLocaleStringThe text displayed on the button.
callbackButtonEventHandler<T>The ButtonPressed handler for the created relay.
argumentTThe Argument for the created relay.
doublePressDelayfloatThe DoublePressDelay for the created relay.
buttonTextSplitfloatThe ratio of the button to use for the sprite.
buttonTextSplitGapfloatThe 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
TThe 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
builderUIBuilderThe builder to use for creating the button.
spriteIAssetProvider<Sprite>The sprite displayed on the button.
buttonTintcolorX?The background color of the button.
spriteTintcolorXThe tint of the sprite.
callbackButtonEventHandler<T>The ButtonPressed handler for the created relay.
argumentTThe Argument for the created relay.
doublePressDelayfloatThe DoublePressDelay for the created relay.
Returns
- Button
The unchanged button.
Type Parameters
TThe 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
builderUIBuilderThe builder to use for creating the button.
spriteUrlUriThe url for the sprite displayed on the button.
textLocaleStringThe text displayed on the button.
callbackButtonEventHandler<T>The ButtonPressed handler for the created relay.
argumentTThe Argument for the created relay.
doublePressDelayfloatThe DoublePressDelay for the created relay.
Returns
- Button
The unchanged button.
Type Parameters
TThe 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
builderUIBuilderThe builder to use for creating the button.
spriteUrlUriThe url for the sprite displayed on the button.
textLocaleStringThe text displayed on the button.
buttonTintcolorX?The background color of the button.
spriteTintcolorXThe tint of the sprite.
callbackButtonEventHandler<T>The ButtonPressed handler for the created relay.
argumentTThe Argument for the created relay.
doublePressDelayfloatThe DoublePressDelay for the created relay.
Returns
- Button
The unchanged button.
Type Parameters
TThe 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
builderUIBuilderThe builder to use for creating the button.
spriteUrlUriThe url for the sprite displayed on the button.
callbackButtonEventHandler<T>The ButtonPressed handler for the created relay.
argumentTThe Argument for the created relay.
doublePressDelayfloatThe DoublePressDelay for the created relay.
Returns
- Button
The unchanged button.
Type Parameters
TThe 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
builderUIBuilderThe builder to use for creating the button.
spriteUrlUriThe url for the sprite displayed on the button.
buttonTintcolorX?The background color of the button.
spriteTintcolorXThe tint of the sprite.
callbackButtonEventHandler<T>The ButtonPressed handler for the created relay.
argumentTThe Argument for the created relay.
doublePressDelayfloatThe DoublePressDelay for the created relay.
Returns
- Button
The unchanged button.
Type Parameters
TThe 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
builderUIBuilderThe builder to use for creating the button.
spriteUrlUriThe url for the sprite displayed on the button.
buttonTintcolorX?The background color of the button.
callbackButtonEventHandler<T>The ButtonPressed handler for the created relay.
argumentTThe Argument for the created relay.
doublePressDelayfloatThe DoublePressDelay for the created relay.
Returns
- Button
The unchanged button.
Type Parameters
TThe 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
buttonTButtonThe button to set up with a FrooxEngine.UIX.ButtonRefRelay<T>.
callbackButtonEventHandler<TArgument>The ButtonPressed handler for the created relay.
argumentTArgumentThe Argument for the created relay.
doublePressDelayfloatThe DoublePressDelay for the created relay.
Returns
- TButton
The unchanged button.
Type Parameters
TButtonThe specific type of the button.
TArgumentThe 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
buttonTButtonThe button to set up with a FrooxEngine.UIX.ButtonRefRelay<T>.
callbackButtonEventHandler<TArgument>The ButtonPressed handler for the created relay.
argumentTArgumentThe Argument for the created relay.
doublePressDelayfloatThe DoublePressDelay for the created relay.
Returns
- TButton
The unchanged button.
Type Parameters
TButtonThe specific type of the button.
TArgumentThe type of the reference argument.