Skip to content

TextStudioPageNavigator

ClassTextStudioTextStudio
[DisallowMultipleComponent]
[AddComponentMenu("Text Studio/Layout/Page Navigator")]
public sealed class TextStudioPageNavigator : MonoBehaviour

Controls TextMeshPro page overflow manually or follows the page containing the latest revealed glyph.

public void SetTargets(TextStudioText textStudio, TMP_Text tmpText)

Assigns the playback host and paginated TextMeshPro output, then refreshes page state.

Parameters

Name Type
textStudio TextStudio.TextStudioText
tmpText TMPro.TMP_Text
public void Refresh()

Forces current text layout and updates the valid 1-based page range.

public void NextPage()

Moves to the next page, clamped to the current page count.

public void PreviousPage()

Moves to the previous page, clamped to page one.

public void FirstPage()

Displays the first page.

public void LastPage()

Displays the last currently known page.

public void GoToPage(int page)

Displays a 1-based page number clamped to the current layout.

Parameters

Name Type
page System.Int32
public bool FollowRevealNow()

Displays the page containing the most recently revealed semantic glyph.

Returns

System.Boolean: false when required targets or glyph mapping are unavailable.

public TextStudioPageNavigator()

public TextStudioText Target { get; set; }

Returns

TextStudio.TextStudioText

public TMP_Text TMPText { get; set; }

Returns

TMPro.TMP_Text

public bool FollowReveal { get; set; }

Returns

System.Boolean

public int CurrentPage { get; }

Returns

System.Int32

public int PageCount { get; }

Returns

System.Int32

public UnityEvent<int, int> OnPageChanged { get; }

Returns

UnityEngine.Events.UnityEvent{System.Int32,System.Int32}