StyleBase

非推奨を表示

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

作成できません

StyleSheetStyleRule のベースクラス。子のリスト StyleRules 、および 属性 として保存されるトークン定義を含む。

概要

方法

イベント

プロパティ

方法

GetStyleRules

Instances

関連する StyleRules のアレイを返します。


戻り値

Instances

StyleRules の配列。

InsertStyleRule

()

新しい StyleRule を規則の配列に挿入し、その Priority が以前のすべての StyleRules より大きいようにします。priority が指定されると、新しいルールの Priority が指定された値に設定されます。

パラメータ

rule: StyleRule

挿入する StyleRule

既定値: ""
priority: number

ルールの Priority を設定する番号。

既定値: ""

戻り値

()

SetStyleRules

()

InsertStyleRule() と似ていますが、一度に複数の StyleRules を宣言して設定できます。


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 })

パラメータ

rules: Instances

設定する StyleRules のアレイ。

既定値: ""

戻り値

()

イベント

StyleRulesChanged

例えば、InsertStyleRule() が呼ばれたとき、接続された StyleSheet または StyleRule で 1つまたは複数の StyleRules が明示的に変更されると、ファイアが発生します。