学ぶ
エンジンクラス
TextButton

*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。



APIリファレンス
プロパティ
ContentText
読み取り専用
複製されていません
並列読み取り
機能: UI
TextButton.ContentText:string

Font
非表示
複製されていません
並列読み取り
機能: UI
TextButton.Font:Enum.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
end

FontFace
並列読み取り
機能: UI
TextButton.FontFace:Font

FontSize
非推奨

LineHeight
並列読み取り
機能: UI
TextButton.LineHeight:number

LocalizedText
非表示
読み取り専用
複製されていません
並列読み取り
機能: UI
TextButton.LocalizedText:string

MaxVisibleGraphemes
並列読み取り
機能: UI
TextButton.MaxVisibleGraphemes:number

OpenTypeFeatures
並列読み取り
機能: UI
TextButton.OpenTypeFeatures:string

OpenTypeFeaturesError
読み取り専用
複製されていません
並列読み取り
機能: UI
TextButton.OpenTypeFeaturesError:string

RichText
並列読み取り
機能: UI
TextButton.RichText:boolean

Text
並列読み取り
機能: UI
TextButton.Text:string
コードサンプル
フェーディングバナー
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
end

TextBounds
読み取り専用
複製されていません
並列読み取り
機能: UI
TextButton.TextBounds:Vector2

TextColor
非推奨

TextColor3
並列読み取り
機能: UI
TextButton.TextColor3:Color3
コードサンプル
カウントダウンテキスト
-- このコードを 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)
end

TextDirection
並列読み取り
機能: UI
TextButton.TextDirection:Enum.TextDirection

TextFits
読み取り専用
複製されていません
並列読み取り
機能: UI
TextButton.TextFits:boolean

TextScaled
並列読み取り
機能: UI
TextButton.TextScaled:boolean

TextSize
並列読み取り
機能: UI
TextButton.TextSize:number

TextStrokeColor3
並列読み取り
機能: UI
TextButton.TextStrokeColor3:Color3

TextStrokeTransparency
並列読み取り
機能: UI
TextButton.TextStrokeTransparency:number

TextTransparency
並列読み取り
機能: UI
TextButton.TextTransparency:number

TextTruncate
並列読み取り
機能: UI
TextButton.TextTruncate:Enum.TextTruncate

TextWrap
非推奨

TextWrapped
並列読み取り
機能: UI
TextButton.TextWrapped:boolean

TextXAlignment
並列読み取り
機能: UI
TextButton.TextXAlignment:Enum.TextXAlignment

TextYAlignment
並列読み取り
機能: UI
TextButton.TextYAlignment:Enum.TextYAlignment

©2026 Roblox Corporation。Roblox(ロブロックス)、RobloxロゴおよびPowering Imaginationは、米国並びにその他の国における登録商標および非登録商標です。