요약
속성
상속된 멤버
API 참조
속성
Font
코드 샘플
모든 글꼴 보기
local frame = script.Parent
-- 각 글꼴을 표시하는 TextLabel 생성
for _, font in pairs(Enum.Font:GetEnumItems()) do
local textLabel = Instance.new("TextLabel")
textLabel.Name = font.Name
-- 텍스트 속성 설정
textLabel.Text = font.Name
textLabel.Font = font
-- 일부 렌더링 속성
textLabel.TextSize = 24
textLabel.TextXAlignment = Enum.TextXAlignment.Left
-- 텍스트 높이에 맞게 프레임 크기 조정
textLabel.Size = UDim2.new(1, 0, 0, textLabel.TextSize)
-- 부모 프레임에 추가
textLabel.Parent = frame
end
-- 프레임을 목록으로 레이아웃(이미 레이아웃이 아닌 경우)
if not frame:FindFirstChildOfClass("UIListLayout") then
local uiListLayout = Instance.new("UIListLayout")
uiListLayout.Parent = frame
endFontSize
Text
코드 샘플
사라지는 배너
local TweenService = game:GetService("TweenService")
local textLabel = script.Parent
local content = {
"내 게임에 오신 것을 환영합니다!",
"재미있게 놀아보세요!",
"제안해 주세요!",
"다른 플레이어에게 친절하세요!",
"다른 플레이어를 괴롭히지 마세요!",
"상점을 확인해 보세요!",
"팁: 죽지 마세요!",
}
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
-- 0단계: 아무것도 하기 전에 사라지게 함
fadeOut:Play()
task.wait(tweenInfo.Time)
-- 1단계: 마지막에 표시되지 않았던 콘텐츠 선택
local index
repeat
index = RNG:NextInteger(1, #content)
until lastIndex ~= index
-- 다음 번에 동일한 것을 표시하지 않도록 해야 함
lastIndex = index
-- 2단계: 콘텐츠 표시
textLabel.Text = content[index]
fadeIn:Play()
task.wait(tweenInfo.Time + 1)
end텍스트의 이모지
local textLabel = script.Parent
local moods = {
["happy"] = "😃",
["sad"] = "😢",
["neutral"] = "😐",
["tired"] = "😫",
}
while true do
for mood, face in pairs(moods) do
textLabel.Text = "나는 " .. mood .. " 기분이야! " .. face
task.wait(1)
end
endTextColor
TextColor3
코드 샘플
카운트다운 텍스트
-- 이 코드를 TextLabel/TextButton 내의 LocalScript에 배치하세요
local textLabel = script.Parent
-- TextColor3와 함께 사용할 몇 가지 색상
local colorNormal = Color3.new(0, 0, 0) -- 검정색
local colorSoon = Color3.new(1, 0.5, 0.5) -- 빨간색
local colorDone = Color3.new(0.5, 1, 0.5) -- 초록색
-- 무한 루프
while true do
-- 10에서 1까지 카운트 다운
for i = 10, 1, -1 do
-- 텍스트 설정
textLabel.Text = "시간: " .. i
-- 남은 시간에 따라 색상 설정
if i > 3 then
textLabel.TextColor3 = colorNormal
else
textLabel.TextColor3 = colorSoon
end
task.wait(1)
end
textLabel.Text = "시작!"
textLabel.TextColor3 = colorDone
task.wait(2)
endTextWrap