Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
UIMarquee Class Reference

Utility Marquee tool for TMPro labels, moves the text horizontally when it's being truncated. More...

Inheritance diagram for UIMarquee:
UIMarquee_ActionField UIMarquee_PAW

Public Types

enum  ScrollType { ScrollType.Left, ScrollType.Right, ScrollType.LeftThenRight, ScrollType.RightThenLeft }
 What marquee movement the text should do if its needed More...
 

Public Member Functions

void OnPointerEnter (PointerEventData eventData)
 
void OnPointerExit (PointerEventData eventData)
 

Public Attributes

bool autoScrollOnShow = true
 Shoud the marquee start on mouseover/PAW show More...
 
float delayAfterLoop = 1f
 The time after each loop, if loop is enabled More...
 
float delayBeforeLoop = 0.7f
 The time before each loop, if loop is enabled More...
 
bool isMoving = false
 Is the marquee currently moving More...
 
bool loop = false
 Should the marquee restart when it reaches the end of its movement More...
 
TMPro.TextAlignmentOptions movingHorizontalAlign = TMPro.TextAlignmentOptions.MidlineLeft
 Alignment when the text IS moving More...
 
TMPro.TextOverflowModes movingOverflowMode = TMPro.TextOverflowModes.Overflow
 Overflow mode when the text IS moving More...
 
float movingOverrun = 10f
 How many pixels past the end of the text should the marquee move to give more time and space More...
 
float movingSpeed = 20
 How fast should the marquee move More...
 
ScrollType scrollMode = ScrollType.LeftThenRight
 Direction this target text will be marquee'd More...
 
float startDelay = 0.4f
 How long after show/mouseover until it should start moving More...
 
TMPro.TextAlignmentOptions staticHorizontalAlign = TMPro.TextAlignmentOptions.MidlineRight
 Alignment when the text is NOT moving More...
 
TMPro.TextOverflowModes staticOverflowMode = TMPro.TextOverflowModes.Ellipsis
 Overflow mode when the text is NOT moving More...
 
bool stopOnMouseOff = true
 Should the marquee stop once the mouse stops hovering More...
 

Protected Member Functions

void AutoStartMarquee ()
 
virtual void Awake ()
 
virtual void Field_OnValueModified (object arg1)
 
IEnumerator Initialize ()
 
virtual void OnDestroy ()
 
virtual void Start ()
 
void StartMarquee ()
 

Protected Attributes

PointerEnterExitHandler enterExitHandler
 ref to mouse handler More...
 
bool isActive
 Is the text long enough to need a scroll marquee More...
 
bool isMouseOver
 Is the mouse over the mask More...
 
bool isRightAnchored = false
 True if target label is anchored to the right, false if anchored to the left or stretched. Needed for movement calculations More...
 
ContentSizeFitter labelFitter
 fitter for controlling/measuring sizes More...
 
Transform labelParentGO
 The GO that the label was parented to and the marquee wrapper will be attached to More...
 
float leftX = 0
 
IEnumerator marqueeMovementCoroutine
 Used to start and stop the movement coroutine More...
 
GameObject marqueeObject
 The new object for holding the label More...
 
float marqueeWidth
 Width of the marquee has to be cached for calculations, because if anchors are set to stretch, sizedelta wont return a useful value to us More...
 
RectMask2D mask
 The mask component for hiding More...
 
float movementAmount
 
bool movingLeft
 
Vector3 movingTransform
 Transform to track and use for moving the text label More...
 
float originalFontSizeMax
 
bool ready = false
 
TMPro.TextMeshProUGUI targetLabel = null
 The target label that will be able to marquee if the text is too wide More...
 

Detailed Description

Utility Marquee tool for TMPro labels, moves the text horizontally when it's being truncated.

Member Enumeration Documentation

What marquee movement the text should do if its needed

Enumerator
Left 
Right 
LeftThenRight 
RightThenLeft 

Member Function Documentation

void UIMarquee.AutoStartMarquee ( )
inlineprotected
virtual void UIMarquee.Awake ( )
inlineprotectedvirtual
virtual void UIMarquee.Field_OnValueModified ( object  arg1)
inlineprotectedvirtual
IEnumerator UIMarquee.Initialize ( )
inlineprotected
virtual void UIMarquee.OnDestroy ( )
inlineprotectedvirtual

Reimplemented in UIMarquee_PAW, and UIMarquee_ActionField.

void UIMarquee.OnPointerEnter ( PointerEventData  eventData)
inline
void UIMarquee.OnPointerExit ( PointerEventData  eventData)
inline
virtual void UIMarquee.Start ( )
inlineprotectedvirtual

Reimplemented in UIMarquee_ActionField, and UIMarquee_PAW.

void UIMarquee.StartMarquee ( )
inlineprotected

Member Data Documentation

bool UIMarquee.autoScrollOnShow = true

Shoud the marquee start on mouseover/PAW show

float UIMarquee.delayAfterLoop = 1f

The time after each loop, if loop is enabled

float UIMarquee.delayBeforeLoop = 0.7f

The time before each loop, if loop is enabled

PointerEnterExitHandler UIMarquee.enterExitHandler
protected

ref to mouse handler

bool UIMarquee.isActive
protected

Is the text long enough to need a scroll marquee

bool UIMarquee.isMouseOver
protected

Is the mouse over the mask

bool UIMarquee.isMoving = false

Is the marquee currently moving

bool UIMarquee.isRightAnchored = false
protected

True if target label is anchored to the right, false if anchored to the left or stretched. Needed for movement calculations

ContentSizeFitter UIMarquee.labelFitter
protected

fitter for controlling/measuring sizes

Transform UIMarquee.labelParentGO
protected

The GO that the label was parented to and the marquee wrapper will be attached to

float UIMarquee.leftX = 0
protected
bool UIMarquee.loop = false

Should the marquee restart when it reaches the end of its movement

IEnumerator UIMarquee.marqueeMovementCoroutine
protected

Used to start and stop the movement coroutine

GameObject UIMarquee.marqueeObject
protected

The new object for holding the label

float UIMarquee.marqueeWidth
protected

Width of the marquee has to be cached for calculations, because if anchors are set to stretch, sizedelta wont return a useful value to us

RectMask2D UIMarquee.mask
protected

The mask component for hiding

float UIMarquee.movementAmount
protected
TMPro.TextAlignmentOptions UIMarquee.movingHorizontalAlign = TMPro.TextAlignmentOptions.MidlineLeft

Alignment when the text IS moving

bool UIMarquee.movingLeft
protected
TMPro.TextOverflowModes UIMarquee.movingOverflowMode = TMPro.TextOverflowModes.Overflow

Overflow mode when the text IS moving

float UIMarquee.movingOverrun = 10f

How many pixels past the end of the text should the marquee move to give more time and space

float UIMarquee.movingSpeed = 20

How fast should the marquee move

Vector3 UIMarquee.movingTransform
protected

Transform to track and use for moving the text label

float UIMarquee.originalFontSizeMax
protected
bool UIMarquee.ready = false
protected
ScrollType UIMarquee.scrollMode = ScrollType.LeftThenRight

Direction this target text will be marquee'd

float UIMarquee.startDelay = 0.4f

How long after show/mouseover until it should start moving

TMPro.TextAlignmentOptions UIMarquee.staticHorizontalAlign = TMPro.TextAlignmentOptions.MidlineRight

Alignment when the text is NOT moving

TMPro.TextOverflowModes UIMarquee.staticOverflowMode = TMPro.TextOverflowModes.Ellipsis

Overflow mode when the text is NOT moving

bool UIMarquee.stopOnMouseOff = true

Should the marquee stop once the mouse stops hovering

TMPro.TextMeshProUGUI UIMarquee.targetLabel = null
protected

The target label that will be able to marquee if the text is too wide


The documentation for this class was generated from the following file: