Catlike Coding
Unity Code Documentation
Public Attributes | Protected Member Functions | Protected Attributes | List of all members
CatlikeCoding.TextBox.ClippedTextBox Class Reference

Clipped element that adds clipping support to a text box. More...

Inherits CatlikeCoding.Clipping.ClippedElement.

Inherited by CatlikeCoding.TextBox.ClippedTextBoxCollider3D.

Public Attributes

bool ignoreOverflowBox = true
 Whether to ignore Rendered events from an overflow box. More...
 
- Public Attributes inherited from CatlikeCoding.Clipping.ClippedElement
bool clipsChildren
 Whether the element uses its content bounds to clip its children. More...
 
bool notifiesParent = true
 Whether the element notifies its parent when its bounds have changed. More...
 

Protected Member Functions

override void OnClipBoundsChanged ()
 Called when the clip bounds have changed, because the hierarchy bounds have changed. More...
 
override void OnDestroy ()
 Called by Unity when the component is destroyed. More...
 
override void OnEnable ()
 Called by Unity when the component is enabled. More...
 
virtual void OnTextBoxRendered (TextBox textBox)
 This method is called when the Rendered event of the relevant text box is triggered. More...
 
- Protected Member Functions inherited from CatlikeCoding.Clipping.ClippedElement
virtual void OnContentBoundsChanged ()
 Called when the content bounds have changed, by setting ContentBounds. More...
 

Protected Attributes

TextBox textBox
 The text box component attached to the same game object. More...
 
- Protected Attributes inherited from CatlikeCoding.Clipping.ClippedElement
Bounds2D clipBounds
 Clip bounds. More...
 
List< ClippedElementclipChildren
 Clip children. More...
 
ClippedElement clipParent
 Clip parent. More...
 
Bounds2D contentBounds
 Content bounds. More...
 

Additional Inherited Members

- Public Member Functions inherited from CatlikeCoding.Clipping.ClippedElement
void InitializeClipHierarchy ()
 Initialize the clip hierarchy. This method is already called at the appropriate places, you typically should have no reason to call it yourself. More...
 
void UpdateClipHierarchy ()
 Update the clip hierarchy if this element's parent changed. Call this method after changing the transform parent of this element, if it was or is now part of a clip hierarchy. More...
 
void UpdateHierarchyBounds ()
 Update the bounds of the entire clip hierarchy that this element is a part of. More...
 
- Properties inherited from CatlikeCoding.Clipping.ClippedElement
Bounds2D ClipBounds [get]
 Get the clip bounds. More...
 
Bounds2D ContentBounds [get, set]
 Get or set the content bounds. More...
 
Bounds2D ContentBoundsForParent [get]
 Get the content bounds for use by the element's direct parent. More...
 

Detailed Description

Clipped element that adds clipping support to a text box.

Needs to be attached to a game object with a TextBox component.

Member Function Documentation

override void CatlikeCoding.TextBox.ClippedTextBox.OnClipBoundsChanged ( )
protectedvirtual

Called when the clip bounds have changed, because the hierarchy bounds have changed.

Does nothing. Override if you need to respond to this change.

Reimplemented from CatlikeCoding.Clipping.ClippedElement.

Reimplemented in CatlikeCoding.TextBox.ClippedTextBoxCollider3D.

override void CatlikeCoding.TextBox.ClippedTextBox.OnDestroy ( )
protectedvirtual

Called by Unity when the component is destroyed.

Subclasses with their own OnDestroy functionality should override this method and call this base version. It ensures that the clip hierarchy stays valid.

Reimplemented from CatlikeCoding.Clipping.ClippedElement.

override void CatlikeCoding.TextBox.ClippedTextBox.OnEnable ( )
protectedvirtual

Called by Unity when the component is enabled.

Subclasses with their own OnEnable functionality should override this method and call this base version. It ensures that clip hierarchy gets initialized.

Reimplemented from CatlikeCoding.Clipping.ClippedElement.

virtual void CatlikeCoding.TextBox.ClippedTextBox.OnTextBoxRendered ( TextBox  textBox)
protectedvirtual

This method is called when the Rendered event of the relevant text box is triggered.

Subclasses should call the base method to make sure the content bounds are set correctly.

Parameters
textBoxText box.

Reimplemented in CatlikeCoding.TextBox.ClippedTextBoxCollider3D.

Member Data Documentation

bool CatlikeCoding.TextBox.ClippedTextBox.ignoreOverflowBox = true

Whether to ignore Rendered events from an overflow box.

Typically the entire overflow chain is contained in one clipping hierarchy, in which case you only need to react to the Rendered event of the first box in the chain.

TextBox CatlikeCoding.TextBox.ClippedTextBox.textBox
protected

The text box component attached to the same game object.