General purpose modules for Roblox development. [Read-only Codeberg mirror]
1# TextTransform
2
3Transform text in a way that makes it easy to manipulate individual characters.
4
5[](https://create.roblox.com/store/asset/96268263581597/TextTransform)
6
7## Methods
8
9### `TransformText`
10
11`TransformText(labelToTransform: TextLabel)` → `Frame`
12
13Transforms a `TextLabel` into a `Frame` for easy manipulation of letters.
14Letter index is stored in `LayoutOrder` for each `Frame`.
15Stores necessary style information as attributes on the returned `Frame`.
16
17#### Parameters
18
19| Name | Type | Required |
20| ---------------- | ----------- | -------- |
21| labelToTransform | `TextLabel` | Yes |
22
23#### Returns
24
25| Type |
26| ------- |
27| `Frame` |
28
29---
30
31### `CreateFrameFromLabel`
32
33`CreateFrameFromLabel(labelTemplate: TextLabel)` → `Frame`
34
35Creates a `Frame` from a `TextLabel` for easy manipulation of letters.
36Intended to be used with [`InsertLetter`](#insertletter).
37
38#### Parameters
39
40| Name | Type | Required |
41| ------------- | ----------- | -------- |
42| labelTemplate | `TextLabel` | Yes |
43
44#### Returns
45
46| Type |
47| ------- |
48| `Frame` |
49
50---
51
52### `InsertLetter`
53
54`InsertLetter(listFrame: Frame, letter: string, index: number)` → `Frame?`
55
56Inserts a new letter (`Frame`) into the `listFrame` at the specified index.
57Adjusts `LayoutOrder` of subsequent letters.
58Returns the newly created letter `Frame` or `nil` if attributes are missing.
59
60#### Parameters
61
62| Name | Type | Required |
63| --------- | -------- | -------- |
64| listFrame | `Frame` | Yes |
65| letter | `string` | Yes |
66| index | `number` | Yes |
67
68#### Returns
69
70| Type |
71| -------- |
72| `Frame?` |