Aprender
Clase de motor
TextButton

*Este contenido se traduce usando la IA (Beta) y puede contener errores. Para ver esta página en inglés, haz clic en aquí.



Referencia API
Propiedades
ContentText
Solo lectura
No replicado
Leer paralelo
Capacidades: UI
TextButton.ContentText:string

Font
Oculto
No replicado
Leer paralelo
Capacidades: UI
TextButton.Font:Enum.Font
Muestras de código
Mostrar todas las fuentes
local frame = script.Parent
-- Crear un TextLabel mostrando cada fuente
for _, font in pairs(Enum.Font:GetEnumItems()) do
local textLabel = Instance.new("TextLabel")
textLabel.Name = font.Name
-- Establecer las propiedades del texto
textLabel.Text = font.Name
textLabel.Font = font
-- Algunas propiedades de renderizado
textLabel.TextSize = 24
textLabel.TextXAlignment = Enum.TextXAlignment.Left
-- Dimensionar el marco igual a la altura del texto
textLabel.Size = UDim2.new(1, 0, 0, textLabel.TextSize)
-- Agregar al marco padre
textLabel.Parent = frame
end
-- Organizar los marcos en una lista (si no lo están ya)
if not frame:FindFirstChildOfClass("UIListLayout") then
local uiListLayout = Instance.new("UIListLayout")
uiListLayout.Parent = frame
end

FontFace
Leer paralelo
Capacidades: UI
TextButton.FontFace:Font

FontSize
Obsoleto

LineHeight
Leer paralelo
Capacidades: UI
TextButton.LineHeight:number

LocalizedText
Oculto
Solo lectura
No replicado
Leer paralelo
Capacidades: UI
TextButton.LocalizedText:string

MaxVisibleGraphemes
Leer paralelo
Capacidades: UI
TextButton.MaxVisibleGraphemes:number

OpenTypeFeatures
Leer paralelo
Capacidades: UI
TextButton.OpenTypeFeatures:string

OpenTypeFeaturesError
Solo lectura
No replicado
Leer paralelo
Capacidades: UI
TextButton.OpenTypeFeaturesError:string

RichText
Leer paralelo
Capacidades: UI
TextButton.RichText:boolean

Text
Leer paralelo
Capacidades: UI
TextButton.Text:string
Muestras de código
Banner Desvanecido
local TweenService = game:GetService("TweenService")
local textLabel = script.Parent
local content = {
"¡Bienvenido a mi juego!",
"¡Asegúrate de divertirte!",
"¡Por favor, haz sugerencias!",
"¡Sé amable con otros jugadores!",
"¡No molestes a otros jugadores!",
"¡Echa un vistazo a la tienda!",
"Consejo: ¡No mueras!",
}
local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local RNG = Random.new()
local fadeIn = TweenService:Create(textLabel, tweenInfo, {
TextTransparency = 0,
})
local fadeOut = TweenService:Create(textLabel, tweenInfo, {
TextTransparency = 1,
})
local lastIndex
while true do
-- Paso 0: Desvanecer antes de hacer cualquier cosa
fadeOut:Play()
task.wait(tweenInfo.Time)
-- Paso 1: elegir contenido que no fue el último mostrado
local index
repeat
index = RNG:NextInteger(1, #content)
until lastIndex ~= index
-- Asegúrate de no mostrar lo mismo la próxima vez
lastIndex = index
-- Paso 2: mostrar el contenido
textLabel.Text = content[index]
fadeIn:Play()
task.wait(tweenInfo.Time + 1)
end
Emoji en Texto
local textLabel = script.Parent
local moods = {
["happy"] = "😃",
["sad"] = "😢",
["neutral"] = "😐",
["tired"] = "😫",
}
while true do
for mood, face in pairs(moods) do
textLabel.Text = "¡Me siento " .. mood .. "! " .. face
task.wait(1)
end
end

TextBounds
Solo lectura
No replicado
Leer paralelo
Capacidades: UI
TextButton.TextBounds:Vector2

TextColor
Obsoleto

TextColor3
Leer paralelo
Capacidades: UI
TextButton.TextColor3:Color3
Muestras de código
Texto de Cuenta Regresiva
-- Coloca este código en un LocalScript dentro de un TextLabel/TextButton
local textLabel = script.Parent
-- Algunos colores que usaremos con TextColor3
local colorNormal = Color3.new(0, 0, 0) -- negro
local colorSoon = Color3.new(1, 0.5, 0.5) -- rojo
local colorDone = Color3.new(0.5, 1, 0.5) -- verde
-- Bucle infinito
while true do
-- Cuenta hacia atrás desde 10 hasta 1
for i = 10, 1, -1 do
-- Establece el texto
textLabel.Text = "Tiempo: " .. i
-- Establece el color basado en cuánto tiempo queda
if i > 3 then
textLabel.TextColor3 = colorNormal
else
textLabel.TextColor3 = colorSoon
end
task.wait(1)
end
textLabel.Text = "¡VAMOS!"
textLabel.TextColor3 = colorDone
task.wait(2)
end

TextDirection
Leer paralelo
Capacidades: UI
TextButton.TextDirection:Enum.TextDirection

TextFits
Solo lectura
No replicado
Leer paralelo
Capacidades: UI
TextButton.TextFits:boolean

TextScaled
Leer paralelo
Capacidades: UI
TextButton.TextScaled:boolean

TextSize
Leer paralelo
Capacidades: UI
TextButton.TextSize:number

TextStrokeColor3
Leer paralelo
Capacidades: UI
TextButton.TextStrokeColor3:Color3

TextStrokeTransparency
Leer paralelo
Capacidades: UI
TextButton.TextStrokeTransparency:number

TextTransparency
Leer paralelo
Capacidades: UI
TextButton.TextTransparency:number

TextTruncate
Leer paralelo
Capacidades: UI
TextButton.TextTruncate:Enum.TextTruncate

TextWrap
Obsoleto

TextWrapped
Leer paralelo
Capacidades: UI
TextButton.TextWrapped:boolean

TextXAlignment
Leer paralelo
Capacidades: UI
TextButton.TextXAlignment:Enum.TextXAlignment

TextYAlignment
Leer paralelo
Capacidades: UI
TextButton.TextYAlignment:Enum.TextYAlignment

©2026 Roblox Corporation. Roblox, el logotipo de Roblox y "Powering Imagination" son algunas de nuestras marcas registradas y no registradas en los Estados Unidos y otros países.