Text+
DevForum Topic
  • Welcome
  • Installation
  • Fundamentals
    • Introduction
    • Line breaks
    • Customization
      • Fonts
      • Scale-size
      • Truncation
    • Modification
    • Text bounds
  • Fine-control
    • Introduction
    • Full iteration
  • Specific indexing and iteration
  • Transform and style
  • Custom fonts
    • Introduction
    • Font to XML
    • XML to Lua
    • Upload font image
    • Import to Text+
Powered by GitBook
On this page
  • Character (requires having no sorting)
  • Word (requires word sorting)
  • Line (requires line sorting)

Specific indexing and iteration

You can always access the exact line, word or character number you want by indexing like this:

frame["1"]

With some sorting enabled, you'll be able to loop through specific lines and words.

Character (requires having no sorting)

for _, character in frame:GetChildren() do
	-- For Roblox fonts, 'character' will be a TextLabel.
	-- For custom fonts, 'character' will be an ImageLabel.
end

Word (requires word sorting)

local word = frame["1"] -- (Word1) — Word sorting.
local word = frame["1"]["1"] -- (Line1->Word1) — Line and word sorting.
for _, character in word:GetChildren() do
	-- For Roblox fonts, 'character' will be a TextLabel.
	-- For custom fonts, 'character' will be an ImageLabel.
end

Line (requires line sorting)

local line = frame["1"] -- (Line1)

-- Line and word sorting:
for _, word in line:GetChildren() do
	-- 'word' will be a folder.
	for _, character in word:GetChildren() do
		-- For Roblox fonts, 'character' will be a TextLabel.
		-- For custom fonts, 'character' will be an ImageLabel.
	end
end

-- Line sorting:
for _, character in line:GetChildren() do
	-- For Roblox fonts, 'character' will be a TextLabel.
	-- For custom fonts, 'character' will be an ImageLabel.
end
PreviousFull iterationNextTransform and style

Last updated 5 days ago