Show / Hide Table of Contents

Class ColorBlock

A markup extension that represents UnityEngine.UI.ColorBlock.

Inheritance
Object
ColorBlock
Namespace: Mux.Markup
Assembly: Mux.Markup.UI.dll
Syntax
public class ColorBlock : IMarkupExtension<UnityEngine.UI.ColorBlock>
Examples
<m:RectTransform
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:m="clr-namespace:Mux.Markup;assembly=Mux.Markup"
    xmlns:mu="clr-namespace:Mux.Markup;assembly=Mux.Markup.UI"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:playgroundMarkup="clr-namespace:Mux.Playground.Markup;assembly=Assembly-CSharp">
    <!--
      Note that you can use "using" scheme instead of "clr-namespace" to omit assembly
      specification if:
      - the referenced type is in an assembly already loaded. (interpreter)
      - the referenced type is in the assembly containing the compiled XAML. (compiler)
    -->
    <mu:StandaloneInputModule />
    <mu:Canvas />
    <mu:CanvasScaler UiScale="{mu:ConstantPhysicalSize}" />
    <mu:GraphicRaycaster />
    <mu:VerticalLayoutGroup />
    <!--
        You have to give property name "Path" to Binding and "Name" to
        x:Reference only when you compile the interpreter with IL2CPP.
        It is because ContentPropertyAttribute does not work with IL2CPP.
    -->
    <mu:Selectable TargetGraphic="{Binding Path=Body, Source={x:Reference Name=targetGraphic}}">
        <mu:Selectable.Colors>
            <mu:ColorBlock
                ColorMultiplier="0.5"
                NormalColor="{m:Color R=0, G=0, B=0}"
                PressedColor="{m:Color R=0, G=0, B=1}"
                HighlightedColor="{m:Color R=0, G=1, B=0}"
                DisabledColor="{m:Color R=1, G=0, B=0}" />
        </mu:Selectable.Colors>
    </mu:Selectable>
    <mu:Image x:Name="targetGraphic" />
    <playgroundMarkup:TextTransform Text="See what happens if you click or change Interactive property of mu:Selectable!" />
</m:RectTransform>

Properties

| Improve this Doc View Source

ColorMultiplier

A property that represents UnityEngine.UI.ColorBlock.colorMultiplier.

Declaration
public float ColorMultiplier { get; set; }
Property Value
Type Description
Single
| Improve this Doc View Source

DisabledColor

A property that represents UnityEngine.UI.ColorBlock.disabledColor.

Declaration
public UnityEngine.Color DisabledColor { get; set; }
Property Value
Type Description
UnityEngine.Color
| Improve this Doc View Source

FadeDuration

A property that represents UnityEngine.UI.ColorBlock.fadeDuration.

Declaration
public float FadeDuration { get; set; }
Property Value
Type Description
Single
| Improve this Doc View Source

HighlightedColor

A property that represents UnityEngine.UI.ColorBlock.highlightedColor.

Declaration
public UnityEngine.Color HighlightedColor { get; set; }
Property Value
Type Description
UnityEngine.Color
| Improve this Doc View Source

NormalColor

A property that represents UnityEngine.UI.ColorBlock.normalColor.

Declaration
public UnityEngine.Color NormalColor { get; set; }
Property Value
Type Description
UnityEngine.Color
| Improve this Doc View Source

PressedColor

A property that represents UnityEngine.UI.ColorBlock.pressedColor.

Declaration
public UnityEngine.Color PressedColor { get; set; }
Property Value
Type Description
UnityEngine.Color
| Improve this Doc View Source

SelectedColor

A property that represents UnityEngine.UI.ColorBlock.selectedColor.

Declaration
public UnityEngine.Color SelectedColor { get; set; }
Property Value
Type Description
UnityEngine.Color

Methods

| Improve this Doc View Source

ProvideValue(IServiceProvider)

Declaration
public UnityEngine.UI.ColorBlock ProvideValue(IServiceProvider serviceProvider)
Parameters
Type Name Description
IServiceProvider serviceProvider
Returns
Type Description
UnityEngine.UI.ColorBlock
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX