PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

MaxVisibleGraphemes

TextButton

int

This property controls the maximum number of graphemes (or units of text) that are shown on the TextButton. It is primarily provided as an easy way to create a “typewriter effect” where the characters appear one at a time.

Changing the property does not change the position or size of the visible graphemes - the layout will be calculated as if all graphemes are visible.

Setting the property to -1 disables the limit and shows the entirety of the TextButton/Text.


Code Samples


Typewriter Effect with MaxVisibleGraphemes

This example uses TweenService to animate the grapheme count in a typewriter-like fashion.

The final grapheme count comes from a combination of the text object’s ContentText property, which excludes style tags used for rich text, and utf8.len, which returns the grapheme count.