Colored Text Labels

There’s a game on Roblox where if you type words for example require the word require would be red, and if you type workspace its blue so like a coding system in a way. In a texbox.

Thank you for all who could help :smiley:

The game:

I found out its a syntax highlighter but I dont know how to code that :frowning:

The way they have words have different colourings is by making use of Rich Text, which allows you to do all sorts of formatting. Consider looking at the documentation for rich text:

You can try using this module:

Thank you for your help I got it to work! :slight_smile: if I could I would make both make solution because the first linked helped a little like to understand how it works

@Katrist I have a question, I got it to work but I cant get to see where the text position is, example when you text you see where the last key was

Can you show your code?

1 Like

Okay, I used the module heres the basic on what I do

local Textbox = script.Parent.TextBox
local TextLabel = script.Parent.TextLabel

local Module = require(script.Module)

Textbox:GetPropertyChangedSignal(“Text”):Connect(function()

-- After I get the updated code I do this
local T =Module.run(Textbox.Text)
TextLabel.Text = T

end)

@Katrist I get the code to work but I cant get the cursor to work because I set the Textbox text transparency to 1

@Katrist if you need more info one my problem here is the linkhttps://devforum.roblox.com/t/getting-text-to-be-transparent-and-showing-the-text-indictor/3090256

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.