Learn
Motor Sınıfı
ImageButton

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


Özet
Devralınan Üyeler

API Referansı
Özellikler
HoverImage
Paralel oku
Capabilities: UI
ImageButton.HoverImage:ContentId

HoverImageContent
Paralel oku
Capabilities: UI
ImageButton.HoverImageContent:Content

Image
Paralel oku
Capabilities: UI
ImageButton.Image:ContentId
Kod Örnekleri
Görüntü Üzerine Kilitle
local imageLabel = script.Parent
-- Bu örnekteki görüntüler 64x64'tür
imageLabel.Size = UDim2.new(0, 64, 0, 64)
local function unlock()
imageLabel.Image = "rbxassetid://284402785" -- Açık kilit (64x64)
imageLabel.ImageColor3 = Color3.new(0, 0.5, 0) -- Koyu yeşil
end
local function lock()
imageLabel.Image = "rbxassetid://284402752" -- Kilitli padlock (64x64)
imageLabel.ImageColor3 = Color3.new(0.5, 0, 0) -- Koyu kırmızı
end
-- Olayları bağlayın; varsayılan durumumuz kilitli
imageLabel.MouseEnter:Connect(unlock)
imageLabel.MouseLeave:Connect(lock)
lock()

ImageColor3
Paralel oku
Capabilities: UI
ImageButton.ImageColor3:Color3
Kod Örnekleri
Görüntü Üzerine Kilitle
local imageLabel = script.Parent
-- Bu örnekteki görüntüler 64x64'tür
imageLabel.Size = UDim2.new(0, 64, 0, 64)
local function unlock()
imageLabel.Image = "rbxassetid://284402785" -- Açık kilit (64x64)
imageLabel.ImageColor3 = Color3.new(0, 0.5, 0) -- Koyu yeşil
end
local function lock()
imageLabel.Image = "rbxassetid://284402752" -- Kilitli padlock (64x64)
imageLabel.ImageColor3 = Color3.new(0.5, 0, 0) -- Koyu kırmızı
end
-- Olayları bağlayın; varsayılan durumumuz kilitli
imageLabel.MouseEnter:Connect(unlock)
imageLabel.MouseLeave:Connect(lock)
lock()

ImageContent
Paralel oku
Capabilities: UI
ImageButton.ImageContent:Content

ImageRectOffset
Paralel oku
Capabilities: UI
ImageButton.ImageRectOffset:Vector2
Kod Örnekleri
Sprite Sayfası Kullanarak Görüntü Animasyonu
-- Bunu boyutu 256x256 olan bir ImageLabel/ImageButton içinde yerleştirin
local imageLabel = script.Parent
-- Aşağıdaki görüntü 12 kareli (256x256) 1024x1024 boyutundadır
-- Kareler, bir adamın yumruk attığı bir animasyonu oynatır
imageLabel.Image = "rbxassetid://848623155"
imageLabel.ImageRectSize = Vector2.new(256, 256)
-- Gösterilecek karelerin sırası (soldan sağa, sonra yukarıdan aşağıya)
local frames = {
Vector2.new(0, 0),
Vector2.new(1, 0),
Vector2.new(2, 0),
Vector2.new(3, 0),
Vector2.new(0, 1),
Vector2.new(1, 1),
Vector2.new(2, 1),
Vector2.new(3, 1),
Vector2.new(0, 2),
Vector2.new(1, 2),
Vector2.new(2, 2),
Vector2.new(3, 2),
}
-- Kareleri sırayla bir döngü içinde animasyon yapın
while true do
for _, frame in ipairs(frames) do
imageLabel.ImageRectOffset = frame * imageLabel.ImageRectSize
task.wait(0.1)
end
end

ImageRectSize
Paralel oku
Capabilities: UI
ImageButton.ImageRectSize:Vector2
Kod Örnekleri
Sprite Sayfası Kullanarak Görüntü Animasyonu
-- Bunu boyutu 256x256 olan bir ImageLabel/ImageButton içinde yerleştirin
local imageLabel = script.Parent
-- Aşağıdaki görüntü 12 kareli (256x256) 1024x1024 boyutundadır
-- Kareler, bir adamın yumruk attığı bir animasyonu oynatır
imageLabel.Image = "rbxassetid://848623155"
imageLabel.ImageRectSize = Vector2.new(256, 256)
-- Gösterilecek karelerin sırası (soldan sağa, sonra yukarıdan aşağıya)
local frames = {
Vector2.new(0, 0),
Vector2.new(1, 0),
Vector2.new(2, 0),
Vector2.new(3, 0),
Vector2.new(0, 1),
Vector2.new(1, 1),
Vector2.new(2, 1),
Vector2.new(3, 1),
Vector2.new(0, 2),
Vector2.new(1, 2),
Vector2.new(2, 2),
Vector2.new(3, 2),
}
-- Kareleri sırayla bir döngü içinde animasyon yapın
while true do
for _, frame in ipairs(frames) do
imageLabel.ImageRectOffset = frame * imageLabel.ImageRectSize
task.wait(0.1)
end
end

ImageTransparency
Paralel oku
Capabilities: UI
ImageButton.ImageTransparency:number

IsLoaded
Salt Okunur
Çoğaltılmamış
Paralel oku
Capabilities: UI
ImageButton.IsLoaded:boolean
Kod Örnekleri
Görüntü Yükleme Süresi
local imageLabel = script.Parent
local startTime = workspace.DistributedGameTime
-- Görüntünün yüklenmesini bekleyin
while not imageLabel.IsLoaded do
task.wait()
end
-- Yüklemek için ne kadar sürdüğünü ölçün ve gösterin
local deltaTime = workspace.DistributedGameTime - startTime
print(("Görüntü %.3f saniyede yüklendi"):format(deltaTime))

PressedImage
Paralel oku
Capabilities: UI
ImageButton.PressedImage:ContentId

PressedImageContent
Paralel oku
Capabilities: UI
ImageButton.PressedImageContent:Content

ResampleMode
Paralel oku
Capabilities: UI
ImageButton.ResampleMode:Enum.ResamplerMode

ScaleType
Paralel oku
Capabilities: UI
ImageButton.ScaleType:Enum.ScaleType

SliceCenter
Paralel oku
Capabilities: UI
ImageButton.SliceCenter:Rect

SliceScale
Paralel oku
Capabilities: UI
ImageButton.SliceScale:number

TileSize
Paralel oku
Capabilities: UI
ImageButton.TileSize:UDim2

©2026 Roblox Corporation. Roblox, the Roblox logo and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.