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 TextOverflowModes.Page; otherwise TextStudioPageUtility.NoPageFilter.

Parameters

NameType
tmpTextTMPro.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

NameType
characterTMPro.TMP_CharacterInfo
displayedPageSystem.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

NameType
pageNumberSystem.Int32
displayedPageSystem.Int32

Returns

System.Boolean

public static int GetPageCount(TMP_Text tmpText)

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

Parameters

NameType
tmpTextTMPro.TMP_Text

Returns

System.Int32