StyleRule

Artık kullanılmayanları göster

*Bu içerik, yapay zekâ (beta) kullanılarak çevrildi ve hatalar içerebilir. Sayfayı İngilizce görüntülemek için buraya tıkla.

Selector özelliğinin etkilendiği örneklerdeki özellikleri geçersiz kılan stil özelliklerini tanımlar.

Özet

Özellikler

  • Paralel oku

    StyleRule özelliklerinin diğer StyleRules özelliklerine göre nasıl uygulanacağını belirleyen bir sayı.Daha yüksek öncelik değerleri daha düşüklerden önceliklidir.

  • Paralel oku

    Hangi örneklerin StyleRule etkilenmesi gerektiğini belirten bir dize.

  • Salt Okunur
    Çoğaltılmamış
    Paralel oku

    Selector özellikten hata gösteren sadece okunur bir dize.

Yöntemler

Şuradan alınan Yöntemler: StyleBase

Yöntemler

Olaylar

Şuradan alınan Olaylar: StyleBase

Olaylar

Özellikler

Priority

Paralel oku

Selector

Paralel oku

Kod Örnekleri

UI Class Selector

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
-- Class selector
rule.Selector = "TextButton"
-- Set rule properties
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 = "Main Menu"
button.Parent = screenGui
UI Tag Selector

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
-- Tag selector
rule.Selector = ".ButtonPrimary"
-- Set rule properties
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 = "Main Menu"
button.Parent = screenGui
-- Apply tag to button
CollectionService:AddTag(button, "ButtonPrimary")
UI Modifier Selector

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 component selector
rule.Selector = "Frame.RoundedCorner20::UICorner"
-- Set rule property
rule:SetProperty("CornerRadius", UDim.new(0, 20))
-- Create frame
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0.4, 0, 0.2, 0)
frame.Parent = screenGui
-- Apply tag to frame
CollectionService:AddTag(frame, "RoundedCorner20")

SelectorError

Salt Okunur
Çoğaltılmamış
Paralel oku

Yöntemler

GetProperties


Dönüşler

GetProperty

Variant

Parametreler

name: string
Varsayılan değer: ""

Dönüşler

Variant

SetProperties

()

Parametreler

styleProperties: Dictionary
Varsayılan değer: ""

Dönüşler

()

SetProperty

()

Parametreler

name: string
Varsayılan değer: ""
value: Variant
Varsayılan değer: ""

Dönüşler

()

Olaylar