Skip to content

TextStudioPageUtility

ClassTextStudioTextStudio
public static class TextStudioPageUtility

Shared TMP page-overflow helpers for renderers and decorations.

public const int NoPageFilter = -1

Sentinel meaning page filtering is inactive.

Returns

System.Int32

public static int GetDisplayedPageIndex(TMP_Text tmpText)

Returns the zero-based displayed page when overflow is TMPro.TextOverflowModes.Page; otherwise TextStudio.TextStudioPageUtility.NoPageFilter.

Parameters

Name Type
tmpText TMPro.TMP_Text

Returns

System.Int32

IsDisplayedPage(in TMP_CharacterInfo, int)

Section titled “IsDisplayedPage(in TMP_CharacterInfo, int)”
public static bool IsDisplayedPage(in TMP_CharacterInfo character, int displayedPage)

Reports whether a character belongs to the displayed page, or always true when filtering is inactive.

Parameters

Name Type
character TMPro.TMP_CharacterInfo
displayedPage System.Int32

Returns

System.Boolean

public static bool IsDisplayedPage(int pageNumber, int displayedPage)

Reports whether a stored page index belongs to the displayed page, or always true when filtering is inactive or the page is unknown.

Parameters

Name Type
pageNumber System.Int32
displayedPage System.Int32

Returns

System.Boolean

public static int GetPageCount(TMP_Text tmpText)

Returns TMP’s laid-out page count, clamped to at least one.

Parameters

Name Type
tmpText TMPro.TMP_Text

Returns

System.Int32