學習
引擎類別
StyleBase
無法建立

*此內容是使用 AI(Beta 測試版)翻譯,可能含有錯誤。若要以英文檢視此頁面,請按一下這裡


概要
方法
InsertStyleRule(rule: StyleRule,priority: number?):()
SetStyleRules(rules: Instances):()
繼承成員

API 參考
方法
GetStyleRules
功能: UI
StyleBase:GetStyleRules():{StyleRule}
返回

InsertStyleRule
功能: UI
StyleBase:InsertStyleRule(
rule:StyleRule, priority:number?
):()
參數
priority:number?
返回
()

SetStyleRules
功能: UI
StyleBase:SetStyleRules(rules:Instances):()
參數
rules:Instances
返回
()
範例程式碼
設定樣式規則
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local coreSheet = Instance.new("StyleSheet")
coreSheet.Name = "CoreSheet"
coreSheet.Parent = ReplicatedStorage
local styleRuleA = Instance.new("StyleRule")
styleRuleA.Selector = "Frame"
styleRuleA:SetProperty("BackgroundColor3", Color3.new(1, 0, 0))
local styleRuleB = Instance.new("StyleRule")
styleRuleB.Selector = "Frame"
styleRuleB:SetProperty("BackgroundColor3", Color3.new(0, 1, 0))
coreSheet:SetStyleRules({ styleRuleA, styleRuleB })

活動
StyleRulesChanged
功能: UI
StyleBase.StyleRulesChanged():RBXScriptSignal

©2026 Roblox Corporation、Roblox、Roblox 標誌及 Powering Imagination 是我們在美國及其他國家地區的部分註冊與未註冊商標。