学习
引擎类
StyleBase
无法创建

*此内容使用人工智能(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 是我们在美国及其他国家或地区的注册与未注册商标。