Motor Sınıfı
TextButton
*Bu içerik, yapay zekâ (beta) kullanılarak çevrildi ve hatalar içerebilir. Sayfayı İngilizce görüntülemek için buraya tıkla.
Özet
Özellikler
API Referansı
Özellikler
Font
Kod Örnekleri
Tüm Yazı Tiplerini Göster
local frame = script.Parent
-- Her yazı tipini görüntüleyen bir TextLabel oluştur
for _, font in pairs(Enum.Font:GetEnumItems()) do
local textLabel = Instance.new("TextLabel")
textLabel.Name = font.Name
-- Metin özelliklerini ayarla
textLabel.Text = font.Name
textLabel.Font = font
-- Bazı görüntüleme özellikleri
textLabel.TextSize = 24
textLabel.TextXAlignment = Enum.TextXAlignment.Left
-- Çerçevenin boyutunu metnin yüksekliği ile eşit yap
textLabel.Size = UDim2.new(1, 0, 0, textLabel.TextSize)
-- Ana çerçeveye ekle
textLabel.Parent = frame
end
-- Çerçeveleri bir liste halinde yerleştir (zaten değillerse)
if not frame:FindFirstChildOfClass("UIListLayout") then
local uiListLayout = Instance.new("UIListLayout")
uiListLayout.Parent = frame
endFontSize
Text
Kod Örnekleri
Soluk Afiş
local TweenService = game:GetService("TweenService")
local textLabel = script.Parent
local content = {
"Oyunumda hoşgeldin!",
"Eğlenmeyi unutma!",
"Lütfen önerilerde bulunun!",
"Diğer oyunculara nazik olun!",
"Diğer oyuncuları rahatsız etmeyin!",
"Dükkanı kontrol edin!",
"İpucu: Ölmemeye çalışın!",
}
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
-- Adım 0: Bir şey yapmadan önce soluklaştır
fadeOut:Play()
task.wait(tweenInfo.Time)
-- Adım 1: Son gösterilen içerik dışında bir içerik seç
local index
repeat
index = RNG:NextInteger(1, #content)
until lastIndex ~= index
-- Bir sonraki sefer aynı şeyi göstermemek için
lastIndex = index
-- Adım 2: İçeriği göster
textLabel.Text = content[index]
fadeIn:Play()
task.wait(tweenInfo.Time + 1)
endMetin İçinde Emojiler
local textLabel = script.Parent
local moods = {
["happy"] = "😃",
["sad"] = "😢",
["neutral"] = "😐",
["tired"] = "😫",
}
while true do
for mood, face in pairs(moods) do
textLabel.Text = "Ben " .. mood .. " hissediyorum! " .. face
task.wait(1)
end
endTextColor
TextColor3
Kod Örnekleri
Geri Sayım Metni
-- Bu kodu bir LocalScript içerisinde TextLabel/TextButton'a yerleştirin
local textLabel = script.Parent
-- TextColor3 ile kullanacağımız bazı renkler
local colorNormal = Color3.new(0, 0, 0) -- siyah
local colorSoon = Color3.new(1, 0.5, 0.5) -- kırmızı
local colorDone = Color3.new(0.5, 1, 0.5) -- yeşil
-- Sonsuz döngü
while true do
-- 10'dan 1'e geri say
for i = 10, 1, -1 do
-- Metni ayarla
textLabel.Text = "Zaman: " .. i
-- Kalan zamana göre rengi ayarla
if i > 3 then
textLabel.TextColor3 = colorNormal
else
textLabel.TextColor3 = colorSoon
end
task.wait(1)
end
textLabel.Text = "BAŞLA!"
textLabel.TextColor3 = colorDone
task.wait(2)
endTextWrap