요약
메서드
GetDefaultPropertyTransition():Variant |
GetProperty(name: string):Variant |
SetDefaultPropertyTransition(transitionParams: Variant):() |
SetProperties(styleProperties: Dictionary):() |
SetProperty(name: string,value: Variant):() |
SetPropertyTransition(property: string,transitionParams: Variant):() |
SetPropertyTransitions(properties: Dictionary):() |
상속된 멤버
API 참조
속성
Selector
코드 샘플
UI 클래스 선택기
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local screenGui = script.Parent
local coreSheet = Instance.new("StyleSheet")
coreSheet.Parent = ReplicatedStorage
local styleLink = Instance.new("StyleLink")
styleLink.StyleSheet = coreSheet
styleLink.Parent = screenGui
local rule = Instance.new("StyleRule")
rule.Parent = coreSheet
-- 클래스 선택기
rule.Selector = "TextButton"
-- 규칙 속성 설정
rule:SetProperties({
["BackgroundColor3"] = Color3.fromHex("335FFF"),
["TextColor3"] = Color3.fromHex("E1E1E1"),
["Size"] = UDim2.new(0.15, 0, 0, 40),
["BorderSizePixel"] = 0,
})
local button = Instance.new("TextButton")
button.Text = "메인 메뉴"
button.Parent = screenGuiUI 태그 선택기
local CollectionService = game:GetService("CollectionService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local screenGui = script.Parent
local coreSheet = Instance.new("StyleSheet")
coreSheet.Parent = ReplicatedStorage
local styleLink = Instance.new("StyleLink")
styleLink.StyleSheet = coreSheet
styleLink.Parent = screenGui
local rule = Instance.new("StyleRule")
rule.Parent = coreSheet
-- 태그 선택기
rule.Selector = ".ButtonPrimary"
-- 규칙 속성 설정
rule:SetProperties({
["BackgroundColor3"] = Color3.fromHex("FF0099"),
["TextColor3"] = Color3.fromHex("E1E1E1"),
["Size"] = UDim2.new(0.15, 0, 0, 40),
["BorderSizePixel"] = 0,
})
local button = Instance.new("TextButton")
button.Text = "메인 메뉴"
button.Parent = screenGui
-- 버튼에 태그 적용
CollectionService:AddTag(button, "ButtonPrimary")UI 수정자 선택기
local CollectionService = game:GetService("CollectionService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local screenGui = script.Parent
local coreSheet = Instance.new("StyleSheet")
coreSheet.Parent = ReplicatedStorage
local styleLink = Instance.new("StyleLink")
styleLink.StyleSheet = coreSheet
styleLink.Parent = screenGui
local rule = Instance.new("StyleRule")
rule.Parent = coreSheet
-- UI 구성 요소 선택기
rule.Selector = "Frame.RoundedCorner20::UICorner"
-- 규칙 속성 설정
rule:SetProperty("CornerRadius", UDim.new(0, 20))
-- 프레임 생성
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0.4, 0, 0.2, 0)
frame.Parent = screenGui
-- 프레임에 태그 적용
CollectionService:AddTag(frame, "RoundedCorner20")UI 스타일 쿼리 선택기
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local screenGui = script.Parent
local coreSheet = Instance.new("StyleSheet")
coreSheet.Parent = ReplicatedStorage
local styleLink = Instance.new("StyleLink")
styleLink.StyleSheet = coreSheet
styleLink.Parent = screenGui
local smallRule = Instance.new("StyleRule")
smallRule.Parent = coreSheet
local mediumRule = Instance.new("StyleRule")
mediumRule.Parent = coreSheet
-- 스타일 쿼리 선택기를 선언합니다
smallRule.Selector = "@Small"
mediumRule.Selector = "@Medium"
-- 규칙 속성을 설정합니다
smallRule:SetProperties({
["BackgroundColor3"] = Color3.fromHex("FF0099"),
["Text"] = "작은 컨테이너",
["TextColor3"] = Color3.fromHex("E1E1E1"),
["TextSize"] = 12,
})
mediumRule:SetProperties({
["BackgroundColor3"] = Color3.fromHex("F0F0F0"),
["Text"] = "중간 컨테이너",
["TextColor3"] = Color3.fromHex("0022FC"),
["TextSize"] = 24,
})
local button = Instance.new("TextButton")
button.Text = "메인 메뉴"
button.Parent = screenGui
button.Size = UDim2.fromScale(0.5, 0.2)
-- 스타일 규칙 선택자와 일치하는 이름으로 스타일 쿼리를 생성합니다
local mediumSQ = Instance.new("StyleQuery")
mediumSQ.Parent = button
mediumSQ.Name = "Medium"
mediumSQ:SetConditions({
["MinSize"] = Vector2.new(200, 0),
})
local smallSQ = Instance.new("StyleQuery")
smallSQ.Parent = button
smallSQ.Name = "Small"
smallSQ:SetConditions({
["MaxSize"] = Vector2.new(200, math.huge),
["MinSize"] = Vector2.new(0, 0),
})메서드
GetDefaultPropertyTransition
StyleRule:GetDefaultPropertyTransition():Variant
반환
Variant
GetPropertyTransitions
코드 샘플
GetPropertyTransitions()
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local coreSheet = ReplicatedStorage:FindFirstChild("CoreSheet")
-- 스타일 규칙에 대한 참조를 가져옵니다.
local frameRule = coreSheet.Frame
-- 몇 가지 전환을 설정합니다.
frameRule:SetPropertyTransition("BackgroundColor3", TweenInfo.new(1, Enum.EasingStyle.Linear))
frameRule:SetPropertyTransition("BackgroundTransparency", "$DefaultTransition")
local transitions = frameRule:GetPropertyTransitions()
print(transitions)SetDefaultPropertyTransition
StyleRule:SetDefaultPropertyTransition(transitionParams:Variant):()
매개 변수
transitionParams:Variant |
반환
()
SetProperties
SetPropertyTransition
매개 변수
transitionParams:Variant |
반환
()
코드 샘플
SetPropertyTransition()
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local coreSheet = ReplicatedStorage:FindFirstChild("CoreSheet")
-- 스타일 규칙에 대한 참조 가져오기
local frameRule = coreSheet.Frame
-- BackgroundColor3에 1초 선형 전환 설정
frameRule:SetPropertyTransition("BackgroundColor3", TweenInfo.new(
1, -- 시간
Enum.EasingStyle.Linear -- EasingStyle
))
-- 전환 제거
frameRule:SetPropertyTransition("BackgroundColor3", nil)SetPropertyTransition() 토큰 사용하기
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local coreSheet = ReplicatedStorage:FindFirstChild("CoreSheet")
local tokensSheet = ReplicatedStorage:FindFirstChild("Tokens")
-- 토큰 시트에 토큰(속성) 설정
tokensSheet:SetAttribute("LinearTransition", TweenInfo.new(1, Enum.EasingStyle.Linear))
-- 스타일 규칙에 대한 참조 가져오기
local frameRule = coreSheet.Frame
frameRule:SetPropertyTransition("BackgroundColor3", "$LinearTransition")SetPropertyTransitions
매개 변수
반환
()
코드 샘플
SetPropertyTransitions()
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local coreSheet = ReplicatedStorage:FindFirstChild("CoreSheet")
-- 스타일 규칙에 대한 참조 가져오기
local frameRule = coreSheet.Frame
-- 두 개의 속성에 대한 전환을 한 번에 설정
frameRule:SetPropertyTransitions({
["BackgroundColor3"] = TweenInfo.new(1, Enum.EasingStyle.Linear),
["BackgroundTransparency"] = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
})
-- 모든 전환 제거
frameRule:SetPropertyTransitions({})SetPropertyTransitions() 토큰 사용하기
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local coreSheet = ReplicatedStorage:FindFirstChild("CoreSheet")
local tokenSheet = ReplicatedStorage:FindFirstChild("Tokens")
-- 토큰(속성)을 토큰 시트에 설정합니다
tokenSheet:SetAttribute("LinearTransition", TweenInfo.new(1, Enum.EasingStyle.Linear))
tokenSheet:SetAttribute("QuadTransition", TweenInfo.new(0.25, Enum.EasingStyle.Quad))
-- 스타일 규칙에 대한 참조를 가져옵니다
local frameRule = coreSheet.Frame
-- 여러 속성에 대한 전환을 한 번에 설정합니다
frameRule:SetPropertyTransitions({
["BackgroundColor3"] = "$LinearTransition",
["BackgroundTransparency"] = "$QuadTransition",
})