TextLabel

Mostrar obsoleto

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

Resumen

Propiedades

Propiedades heredados de GuiObjectPropiedades heredados de GuiBase2d

Métodos

Métodos heredados de GuiObject

Propiedades

ContentText

Solo lectura
No replicado
Leer paralelo
Oculto
No replicado
Leer paralelo

Muestras de código

Mostrar todas las fuentes

local frame = script.Parent
-- Crear una etiqueta de texto que muestre cada fuente
for _, font in pairs(Enum.Font:GetEnumItems()) do
local textLabel = Instance.new("TextLabel")
textLabel.Name = font.Name
-- Establecer las propiedades de texto
textLabel.Text = font.Name
textLabel.Font = font
-- Algunas propiedades de renderizado
textLabel.TextSize = 24
textLabel.TextXAlignment = Enum.TextXAlignment.Left
-- Redimensionar el marco igual a la altura del texto
textLabel.Size = UDim2.new(1, 0, 0, textLabel.TextSize)
-- Añadir al marco padre
textLabel.Parent = frame
end
-- Organiza 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

LineHeight

Leer paralelo

LocalizedText

Oculto
Solo lectura
No replicado
Leer paralelo

MaxVisibleGraphemes

Leer paralelo

OpenTypeFeatures

Leer paralelo

OpenTypeFeaturesError

Solo lectura
No replicado
Leer paralelo

RichText

Leer paralelo

Text

Leer paralelo

Muestras de código

Fading Banner

local TweenService = game:GetService("TweenService")
local textLabel = script.Parent
local content = {
"Welcome to my game!",
"Be sure to have fun!",
"Please give suggestions!",
"Be nice to other players!",
"Don't grief other players!",
"Check out the shop!",
"Tip: Don't die!",
}
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
-- Step 0: Fade out before doing anything
fadeOut:Play()
task.wait(tweenInfo.Time)
-- Step 1: pick content that wasn't the last displayed
local index
repeat
index = RNG:NextInteger(1, #content)
until lastIndex ~= index
-- Make sure we don't show the same thing next time
lastIndex = index
-- Step 2: show the content
textLabel.Text = content[index]
fadeIn:Play()
task.wait(tweenInfo.Time + 1)
end
Emoji in Text

local textLabel = script.Parent
local moods = {
["happy"] = "😃",
["sad"] = "😢",
["neutral"] = "😐",
["tired"] = "😫",
}
while true do
for mood, face in pairs(moods) do
textLabel.Text = "I am feeling " .. mood .. "! " .. face
task.wait(1)
end
end

TextBounds

Solo lectura
No replicado
Leer paralelo

TextColor3

Leer paralelo

Muestras de código

Countdown Text

-- Place this code in a LocalScript within a TextLabel/TextButton
local textLabel = script.Parent
-- Some colors we'll use with TextColor3
local colorNormal = Color3.new(0, 0, 0) -- black
local colorSoon = Color3.new(1, 0.5, 0.5) -- red
local colorDone = Color3.new(0.5, 1, 0.5) -- green
-- Loop infinitely
while true do
-- Count backwards from 10 to 1
for i = 10, 1, -1 do
-- Set the text
textLabel.Text = "Time: " .. i
-- Set the color based on how much time is left
if i > 3 then
textLabel.TextColor3 = colorNormal
else
textLabel.TextColor3 = colorSoon
end
task.wait(1)
end
textLabel.Text = "GO!"
textLabel.TextColor3 = colorDone
task.wait(2)
end

TextDirection

Leer paralelo

TextFits

Solo lectura
No replicado
Leer paralelo

TextScaled

Leer paralelo

TextSize

Leer paralelo

TextStrokeColor3

Leer paralelo

TextStrokeTransparency

Leer paralelo

TextTransparency

Leer paralelo

TextTruncate

Leer paralelo

TextWrapped

Leer paralelo

TextXAlignment

Leer paralelo

TextYAlignment

Leer paralelo

Métodos

Eventos