Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Classes | Static Public Member Functions | List of all members
TMPro.TMP_TextUtilities Class Reference

Static Public Member Functions

static float DistanceToLine (Vector3 a, Vector3 b, Vector3 point)
 Function returning the Square Distance from a Point to a Line. More...
 
static int FindIntersectingCharacter (TMP_Text text, Vector3 position, Camera camera, bool visibleOnly)
 Function returning the index of the character at the given position (if any). More...
 
static int FindIntersectingLine (TMP_Text text, Vector3 position, Camera camera)
 Function returning the index of the word at the given position (if any). More...
 
static int FindIntersectingLink (TMP_Text text, Vector3 position, Camera camera)
 Function returning the index of the Link at the given position (if any). More...
 
static int FindIntersectingWord (TMP_Text text, Vector3 position, Camera camera)
 Function to find the nearest character to position. More...
 
static int FindNearestCharacter (TMP_Text text, Vector3 position, Camera camera, bool visibleOnly)
 Function returning the index of the character at the given position (if any). More...
 
static int FindNearestCharacterOnLine (TMP_Text text, Vector3 position, int line, Camera camera, bool visibleOnly)
 Function returning the nearest character to position on a given line. More...
 
static int FindNearestLine (TMP_Text text, Vector3 position, Camera camera)
 Function returning the line nearest to the position. More...
 
static int FindNearestLink (TMP_Text text, Vector3 position, Camera camera)
 Function returning the index of the Link at the given position (if any). More...
 
static int FindNearestWord (TMP_Text text, Vector3 position, Camera camera)
 Function returning the index of the word at the given position (if any). More...
 
static int GetCursorIndexFromPosition (TMP_Text textComponent, Vector3 position, Camera camera)
 
static int GetCursorIndexFromPosition (TMP_Text textComponent, Vector3 position, Camera camera, out CaretPosition cursor)
 Function returning the index of the character whose origin is closest to the cursor. More...
 
static int GetSimpleHashCode (string s)
 Function which returns a simple hashcode from a string. More...
 
static uint GetSimpleHashCodeLowercase (string s)
 Function which returns a simple hashcode from a string converted to lowercase. More...
 
static int HexToInt (char hex)
 Function to convert Hex to Int More...
 
static bool IsIntersectingRectTransform (RectTransform rectTransform, Vector3 position, Camera camera)
 Function used to determine if the position intersects with the RectTransform. More...
 
static bool ScreenPointToWorldPointInRectangle (Transform transform, Vector2 screenPoint, Camera cam, out Vector3 worldPoint)
 Method to convert ScreenPoint to WorldPoint aligned with Rectangle More...
 
static int StringToInt (string s)
 Function to convert a properly formatted string which contains an hex value to its decimal value. More...
 
static char ToLowerFast (char c)
 Get lowercase version of this ASCII character. More...
 
static char ToUpperFast (char c)
 Get uppercase version of this ASCII character. More...
 

Member Function Documentation

static float TMPro.TMP_TextUtilities.DistanceToLine ( Vector3  a,
Vector3  b,
Vector3  point 
)
inlinestatic

Function returning the Square Distance from a Point to a Line.

Parameters
a
b
point
Returns
static int TMPro.TMP_TextUtilities.FindIntersectingCharacter ( TMP_Text  text,
Vector3  position,
Camera  camera,
bool  visibleOnly 
)
inlinestatic

Function returning the index of the character at the given position (if any).

Parameters
textA reference to the TextMeshPro component.
positionPosition to check for intersection.
cameraThe scene camera which is rendering the text or whichever one might be assigned to a Canvas using ScreenSpace Camera or WorldSpace render mode. Set to null is using ScreenSpace Overlay.
visibleOnlyOnly check for visible characters.
Returns
static int TMPro.TMP_TextUtilities.FindIntersectingLine ( TMP_Text  text,
Vector3  position,
Camera  camera 
)
inlinestatic

Function returning the index of the word at the given position (if any).

Parameters
textA reference to the TextMeshPro UGUI component.
position
cameraThe scene camera which may be assigned to a Canvas using ScreenSpace Camera or WorldSpace render mode. Set to null is using ScreenSpace Overlay.
Returns

Function returning the index of the word at the given position (if any).

Parameters
textA reference to the TextMeshPro UGUI component.
positionPosition to check for intersection.
cameraThe camera which is rendering the text object.
Returns

Function returning the line intersecting the position.

Parameters
textComponent
position
camera
Returns
static int TMPro.TMP_TextUtilities.FindIntersectingLink ( TMP_Text  text,
Vector3  position,
Camera  camera 
)
inlinestatic

Function returning the index of the Link at the given position (if any).

Parameters
textA reference to the TMP_Text component.
positionPosition to check for intersection.
cameraThe scene camera which may be assigned to a Canvas using ScreenSpace Camera or WorldSpace render mode. Set to null is using ScreenSpace Overlay.
Returns
static int TMPro.TMP_TextUtilities.FindIntersectingWord ( TMP_Text  text,
Vector3  position,
Camera  camera 
)
inlinestatic

Function to find the nearest character to position.

Parameters
textA reference to the TextMeshPro UGUI component.
positionPosition to check for intersection.
cameraThe scene camera which may be assigned to a Canvas using ScreenSpace Camera or WorldSpace render mode. Set to null is using ScreenSpace Overlay.
visibleOnlyOnly check for visible characters.
Returns

Function to find the nearest character to position.

Parameters
textA reference to the TextMeshPro component.
positionPosition to check for intersection.
cameraThe camera which is rendering the text object.
visibleOnlyOnly check for visible characters.
Returns

Function returning the index of the word at the given position (if any).

Parameters
textA reference to the TMP_Text component.
positionPosition to check for intersection.
cameraThe scene camera which may be assigned to a Canvas using ScreenSpace Camera or WorldSpace render mode. Set to null is using ScreenSpace Overlay.
Returns
static int TMPro.TMP_TextUtilities.FindNearestCharacter ( TMP_Text  text,
Vector3  position,
Camera  camera,
bool  visibleOnly 
)
inlinestatic

Function returning the index of the character at the given position (if any).

Parameters
textA reference to the TextMeshPro UGUI component.
positionPosition to check for intersection.
cameraThe camera which is rendering the text object.
visibleOnlyOnly check for visible characters.
Returns

Function to find the nearest character to position.

Parameters
textA reference to the TMP Text component.
positionPosition to check for intersection.
cameraThe scene camera which may be assigned to a Canvas using ScreenSpace Camera or WorldSpace render mode. Set to null is using ScreenSpace Overlay.
visibleOnlyOnly check for visible characters.
Returns
static int TMPro.TMP_TextUtilities.FindNearestCharacterOnLine ( TMP_Text  text,
Vector3  position,
int  line,
Camera  camera,
bool  visibleOnly 
)
inlinestatic

Function returning the nearest character to position on a given line.

Parameters
text
position
line
camera
Returns
static int TMPro.TMP_TextUtilities.FindNearestLine ( TMP_Text  text,
Vector3  position,
Camera  camera 
)
inlinestatic

Function returning the line nearest to the position.

Parameters
textComponent
position
camera
Returns
static int TMPro.TMP_TextUtilities.FindNearestLink ( TMP_Text  text,
Vector3  position,
Camera  camera 
)
inlinestatic

Function returning the index of the Link at the given position (if any).

Parameters
textA reference to the TextMeshPro UGUI component.
positionPosition to check for intersection.
cameraThe scene camera which may be assigned to a Canvas using ScreenSpace Camera or WorldSpace render mode. Set to null is using ScreenSpace Overlay.
Returns

Function returning the index of the Link at the given position (if any).

Parameters
textA reference to the TextMeshPro component.
positionPosition to check for intersection.
cameraThe camera which is rendering the text object.
Returns

Function returning the index of the word at the given position (if any).

Parameters
textA reference to the TMP_Text component.
positionPosition to check for intersection.
cameraThe scene camera which may be assigned to a Canvas using ScreenSpace Camera or WorldSpace render mode. Set to null is using ScreenSpace Overlay.
Returns
static int TMPro.TMP_TextUtilities.FindNearestWord ( TMP_Text  text,
Vector3  position,
Camera  camera 
)
inlinestatic

Function returning the index of the word at the given position (if any).

Parameters
textA reference to the TextMeshPro UGUI component.
positionPosition to check for intersection.
cameraThe scene camera which may be assigned to a Canvas using ScreenSpace Camera or WorldSpace render mode. Set to null is using ScreenSpace Overlay.
Returns

Function returning the index of the word at the given position (if any).

Parameters
textA reference to the TextMeshPro component.
positionPosition to check for intersection.
cameraThe camera which is rendering the text object.
Returns

Function returning the index of the word at the given position (if any).

Parameters
textA reference to the TMP_Text component.
position
cameraThe scene camera which may be assigned to a Canvas using ScreenSpace Camera or WorldSpace render mode. Set to null is using ScreenSpace Overlay.
Returns
static int TMPro.TMP_TextUtilities.GetCursorIndexFromPosition ( TMP_Text  textComponent,
Vector3  position,
Camera  camera 
)
inlinestatic

Parameters
textComponentA reference to the text object.
positionPosition to check for intersection.
cameraThe scene camera which may be assigned to a Canvas using ScreenSpace Camera or WorldSpace render mode. Set to null is using ScreenSpace Overlay.
Returns

Function returning the index of the character whose origin is closest to the cursor.

Parameters
textComponentA reference to the text object.
positionPosition to check for intersection.
cameraThe scene camera which may be assigned to a Canvas using ScreenSpace Camera or WorldSpace render mode. Set to null is using ScreenSpace Overlay.
Returns
static int TMPro.TMP_TextUtilities.GetCursorIndexFromPosition ( TMP_Text  textComponent,
Vector3  position,
Camera  camera,
out CaretPosition  cursor 
)
inlinestatic

Function returning the index of the character whose origin is closest to the cursor.

Parameters
textComponentA reference to the text object.
positionPosition to check for intersection.
cameraThe scene camera which may be assigned to a Canvas using ScreenSpace Camera or WorldSpace render mode. Set to null is using ScreenSpace Overlay.
cursorThe position of the cursor insertion position relative to the position.
Returns

Function returning the index of the character whose origin is closest to the cursor.

Parameters
textComponentA reference to the text object.
positionPosition to check for intersection.
cameraThe scene camera which may be assigned to a Canvas using ScreenSpace Camera or WorldSpace render mode. Set to null is using ScreenSpace Overlay.
cursorThe position of the cursor insertion position relative to the position.
Returns
static int TMPro.TMP_TextUtilities.GetSimpleHashCode ( string  s)
inlinestatic

Function which returns a simple hashcode from a string.

Returns
static uint TMPro.TMP_TextUtilities.GetSimpleHashCodeLowercase ( string  s)
inlinestatic

Function which returns a simple hashcode from a string converted to lowercase.

Returns
static int TMPro.TMP_TextUtilities.HexToInt ( char  hex)
inlinestatic

Function to convert Hex to Int

Parameters
hex
Returns
static bool TMPro.TMP_TextUtilities.IsIntersectingRectTransform ( RectTransform  rectTransform,
Vector3  position,
Camera  camera 
)
inlinestatic

Function used to determine if the position intersects with the RectTransform.

Parameters
rectTransformA reference to the RectTranform of the text object.
positionPosition to check for intersection.
cameraThe scene camera which may be assigned to a Canvas using ScreenSpace Camera or WorldSpace render mode. Set to null is using ScreenSpace Overlay.
Returns
static bool TMPro.TMP_TextUtilities.ScreenPointToWorldPointInRectangle ( Transform  transform,
Vector2  screenPoint,
Camera  cam,
out Vector3  worldPoint 
)
inlinestatic

Method to convert ScreenPoint to WorldPoint aligned with Rectangle

Parameters
transform
screenPoint
cam
worldPoint
Returns
static int TMPro.TMP_TextUtilities.StringToInt ( string  s)
inlinestatic

Function to convert a properly formatted string which contains an hex value to its decimal value.

Parameters
s
Returns
static char TMPro.TMP_TextUtilities.ToLowerFast ( char  c)
inlinestatic

Get lowercase version of this ASCII character.

static char TMPro.TMP_TextUtilities.ToUpperFast ( char  c)
inlinestatic

Get uppercase version of this ASCII character.


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