Public classes

Controller
DisplayModel
DotMatrix
ImageToContent
TextToContent

Commands/

   AbsCmd
   AbsCmdPosition
   AbsCmdSpeed
   CallbackCommand
   ClearCommand
   ContentCommand
   PauseCommand
   TextCommand

Displays/

   Display
   DisplayObj
   Display_3D
   Display_Sprite
   Display_Texture
   Display_UI


Introduction page

Display_UI
Derived from DisplayObj


Display where dots are based on images that change colors when turning on and off. This display is meant to be used is UI element. It's position follows pivot point of RectTransform. Display (dots) size can be also set to fit inside the RectTransform so the actual size of display will change depending on UI layout settings.


Enums

public enum UIFitsList of different types how to fit this display in UI RectTransform.
public enum UIPositionsList of positions inside RectTransform if display doesn't fill whole RectTransform area.

Properties

public int ColorCountGets or sets the count of colors this display's dots can have.
public Vector2 DotSizeSize of single dot.
public Color OffColorColor of single dot sprite when it is turned to off-state (color 0).
public Color OnColorColor of single dot sprite when it is turned to on-state (color 1).
public UIFits UIFitSet or get UI fit type, one of the values from enum UIFits.
public UIPositions UIPositionSet or get position of the display inside RectTransform, one of the values from enum UIPositions.

Methods

public Color GetColor (int state)Gets color used in dot sprites when dot state is set to 'index'.
public void SetColor (int state, Color color)Sets color used in dot sprites when dot state is set to 'index'.
public void checkAndSetParent ()Check whatever this object is child of UI Canvas and tries to set the parent if not.

Enums

public enum UIFits

List of different types how to fit this display in UI RectTransform.

ItemsKeepDotSizeUse dot size defined in Display.
 FitToRectTransformShrink or enlarge all the dots so that they fill RectTransform of this component.
 FitButKeepAspectRatioShrink or enlarge all the dots so that they fill RectTransform of this component but keep original aspect ratio of dots.


public enum UIPositions

List of positions inside RectTransform if display doesn't fill whole RectTransform area.

ItemsFollowPivotPointPosition follows pivot point.
 UpperLeftSet display to upper left corner of RectTransform.
 UpperCenterSet display to upper center position of RectTransform.
 UpperRightSet display to upper right corner of RectTransform.
 MiddleLeftSet display to middle left position of RectTransform.
 MiddleCenterSet display to middle center position of RectTransform.
 MiddleRightSet display to middle right position of RectTransform.
 LowerLeftSet display to lower left corner of RectTransform.
 LowerCenterSet display to lower center position of RectTransform.
 LowerRightSet display to lower right corner of RectTransform.


Properties

public int ColorCount

Gets or sets the count of colors this display's dots can have. Default and minimum is two colors.

ValueAmount of different possible color states.


public Vector2 DotSize

Size of single dot.

ValueSize of single dot as Vector2


public Color OffColor

Color of single dot sprite when it is turned to off-state (color 0). This have same effect than using SetColor(0,Color) or GetColor(0,Color) methods and is here for backward compatibility.

ValueDot color when in off-state.


public Color OnColor

Color of single dot sprite when it is turned to on-state (color 1). This have same effect than using SetColor(1,Color) or GetColor(1,Color) methods and is here for backward compatibility.

ValueDot color when in on-state.


public UIFits UIFit

Set or get UI fit type, one of the values from enum UIFits. When using type that tries to fit the display inside RectTransform, make sure this GameObject RectTransform width and height are not set to zero.

ValueOne of the choices from enum UIFits


public UIPositions UIPosition

Set or get position of the display inside RectTransform, one of the values from enum UIPositions. This setting have no effect if UIFit is set FitToRectTransform because then display is filling whole RectTransform area.

ValueOne of the choices from enum UIPositions


Methods

public Color GetColor (int state)

Gets color used in dot sprites when dot state is set to 'index'.

Parametersstate0 is dot 'off' state, 1 is default 'on' state, 2 and above are additional 'on' state colors.

ReturnsColor used.


public void SetColor (int state, Color color)

Sets color used in dot sprites when dot state is set to 'index'.

Parametersstate0 is dot 'off' state, 1 is default 'on' state, 2 and above are additional 'on' state colors.
 colorColor to use.


public void checkAndSetParent ()

Check whatever this object is child of UI Canvas and tries to set the parent if not. If there is no canvas in hierarchy, this method will create one. If this object parent is changed, object's scale and anchored position will reset also.

Note that this method is normally used only internally in Unity Editor and there is no need to call this when application is running. If you create new UI-type DotMatrix from prefab runtime, rather make sure your scene already contains Canvas and then use normal myUIDotMatrix.transform.SetParent(myKnownCanvasOrOtherUIElement.transform) method to set parent as with any UI object.