# UGUIMotionExtensions

Update uGUI graphics, text, images and canvas groups. Bind a color channel, text value, fill amount or alpha.

Namespace: MeatMotion.Extensions

Assembly: MeatMotion.UI

```csharp
public static partial class UGUIMotionExtensions
```

Requires com.unity.ugui

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L7](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L7)

## Fade a CanvasGroup

Attach a CanvasGroup to the target GameObject. In a MonoBehaviour, import `MeatMotion`, `MeatMotion.Extensions` and `UnityEngine`. Add `MeatMotion.UI` if using an assembly definition.

```csharp
var group = gameObject.GetComponent<CanvasGroup>();
var fade = MMotion.Create(0f, 1f, 0.4f)
    .BindToAlpha(group).AddTo(gameObject);
```

## BindToColor

Schedule a tween that writes the interpolated value to Color on the bound target and return its MotionHandle.

```csharp
public static MotionHandle BindToColor<TOptions, TAdapter>(this MotionBuilder<Color, TOptions, TAdapter> builder, Graphic graphic)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<Color, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<Color, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `graphic` (`Graphic`) Target Graphic that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L9](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L9)

## BindToColorR

Update only the R channel of Color, retaining the other color components.

```csharp
public static MotionHandle BindToColorR(this FloatMotionBuilder builder, Graphic graphic)
```

Parameters and return value

- `builder` (`this FloatMotionBuilder`) Configured builder, passed as the receiver for extension calls.
- `graphic` (`Graphic`) Target Graphic that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L14](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L14)

```csharp
public static MotionHandle BindToColorR<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Graphic graphic)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `graphic` (`Graphic`) Target Graphic that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L17](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L17)

## BindToColorG

Update only the G channel of Color, retaining the other color components.

```csharp
public static MotionHandle BindToColorG(this FloatMotionBuilder builder, Graphic graphic)
```

Parameters and return value

- `builder` (`this FloatMotionBuilder`) Configured builder, passed as the receiver for extension calls.
- `graphic` (`Graphic`) Target Graphic that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L27](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L27)

```csharp
public static MotionHandle BindToColorG<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Graphic graphic)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `graphic` (`Graphic`) Target Graphic that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L30](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L30)

## BindToColorB

Update only the B channel of Color, retaining the other color components.

```csharp
public static MotionHandle BindToColorB(this FloatMotionBuilder builder, Graphic graphic)
```

Parameters and return value

- `builder` (`this FloatMotionBuilder`) Configured builder, passed as the receiver for extension calls.
- `graphic` (`Graphic`) Target Graphic that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L40](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L40)

```csharp
public static MotionHandle BindToColorB<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Graphic graphic)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `graphic` (`Graphic`) Target Graphic that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L43](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L43)

## BindToColorA

Update only the A channel of Color, retaining the other color components.

```csharp
public static MotionHandle BindToColorA(this FloatMotionBuilder builder, Graphic graphic)
```

Parameters and return value

- `builder` (`this FloatMotionBuilder`) Configured builder, passed as the receiver for extension calls.
- `graphic` (`Graphic`) Target Graphic that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L53](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L53)

```csharp
public static MotionHandle BindToColorA<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Graphic graphic)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `graphic` (`Graphic`) Target Graphic that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L56](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L56)

## BindToFillAmount

Bind a float to Image.fillAmount.

```csharp
public static MotionHandle BindToFillAmount(this FloatMotionBuilder builder, Image image)
```

Parameters and return value

- `builder` (`this FloatMotionBuilder`) Configured builder, passed as the receiver for extension calls.
- `image` (`Image`) Target Image that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L66](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L66)

```csharp
public static MotionHandle BindToFillAmount<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Image image)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `image` (`Image`) Target Image that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L69](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L69)

## BindToAlpha

Bind a float to CanvasGroup.alpha to fade the group.

```csharp
public static MotionHandle BindToAlpha(this FloatMotionBuilder builder, CanvasGroup canvasGroup)
```

Parameters and return value

- `builder` (`this FloatMotionBuilder`) Configured builder, passed as the receiver for extension calls.
- `canvasGroup` (`CanvasGroup`) Target CanvasGroup that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L74](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L74)

```csharp
public static MotionHandle BindToAlpha<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, CanvasGroup canvasGroup)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `canvasGroup` (`CanvasGroup`) Target CanvasGroup that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L77](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L77)

## BindToFontSize

Schedule a tween that writes the interpolated value to FontSize on the bound target and return its MotionHandle.

```csharp
public static MotionHandle BindToFontSize<TOptions, TAdapter>(this MotionBuilder<int, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<int, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<int, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `text` (`Text`) Target Text that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L82](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L82)

## BindToText

Write interpolated text or a formatted numeric value to the text component.

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<FixedString32Bytes, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<FixedString32Bytes, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<FixedString32Bytes, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `text` (`Text`) Target Text that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L87](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L87)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<FixedString64Bytes, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<FixedString64Bytes, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<FixedString64Bytes, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `text` (`Text`) Target Text that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L92](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L92)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<FixedString128Bytes, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<FixedString128Bytes, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<FixedString128Bytes, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `text` (`Text`) Target Text that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L97](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L97)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<FixedString512Bytes, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<FixedString512Bytes, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<FixedString512Bytes, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `text` (`Text`) Target Text that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L102](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L102)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<FixedString4096Bytes, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<FixedString4096Bytes, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<FixedString4096Bytes, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `text` (`Text`) Target Text that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L107](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L107)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<int, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<int, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<int, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `text` (`Text`) Target Text that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L112](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L112)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<int, TOptions, TAdapter> builder, Text text, string format)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<int, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<int, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `text` (`Text`) Target Text that receives the update.
- `format` (`string`) Format string for converting the sampled value to text.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L117](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L117)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<long, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<long, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<long, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `text` (`Text`) Target Text that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L122](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L122)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<long, TOptions, TAdapter> builder, Text text, string format)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<long, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<long, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `text` (`Text`) Target Text that receives the update.
- `format` (`string`) Format string for converting the sampled value to text.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L127](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L127)

```csharp
public static MotionHandle BindToText(this FloatMotionBuilder builder, Text text)
```

Parameters and return value

- `builder` (`this FloatMotionBuilder`) Configured builder, passed as the receiver for extension calls.
- `text` (`Text`) Target Text that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L132](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L132)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Text text)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `text` (`Text`) Target Text that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L135](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L135)

```csharp
public static MotionHandle BindToText(this FloatMotionBuilder builder, Text text, string format)
```

Parameters and return value

- `builder` (`this FloatMotionBuilder`) Configured builder, passed as the receiver for extension calls.
- `text` (`Text`) Target Text that receives the update.
- `format` (`string`) Format string for converting the sampled value to text.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L140](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L140)

```csharp
public static MotionHandle BindToText<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Text text, string format)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `text` (`Text`) Target Text that receives the update.
- `format` (`string`) Format string for converting the sampled value to text.
- Returns: `MotionHandle`

[Runtime/Bindings/UGUI/UGUIMotionExtensions.cs · L143](../../../source/Runtime/Bindings/UGUI/UGUIMotionExtensions.cs.html#L143)
