Motor Sınıfı
PluginGui
*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
Yöntemler
BindToClose(function: function):() |
Olaylar
PluginDragDropped(dragData: Dictionary):RBXScriptSignal |
PluginDragEntered(dragData: Dictionary):RBXScriptSignal |
PluginDragLeft(dragData: Dictionary):RBXScriptSignal |
PluginDragMoved(dragData: Dictionary):RBXScriptSignal |
Devralınan Üyeler
LayerCollector kaynağından 4 tane devralındı
GuiBase2d kaynağından 12 tane devralındı
Instance kaynağından 57 tane devralındı
Object kaynağından 6 tane devralındı
Devralan
API Referansı
Özellikler
Yöntemler
BindToClose
GetRelativeMousePosition
Dönüşler
Kod Örnekleri
PluginGui:RelativeFarePozisyonunuAl
local RunService = game:GetService("RunService")
local widgetInfo = DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Float,
true,
false, -- Etkin durumu, geçersiz kıl
200,
300, -- Boyut
150,
150 -- Minimum boyut
)
local testWidget = plugin:CreateDockWidgetPluginGuiAsync("TestWidget", widgetInfo)
function update()
local v2 = testWidget:GetRelativeMousePosition()
testWidget.Title = ("(%d, %d)"):format(v2.x, v2.y)
end
RunService.Stepped:Connect(update)
update()Olaylar
PluginDragDropped
Parametreler
Kod Örnekleri
Eklenti Sürükle ve Bırak
assert(plugin, "Bu betik bir Studio eklentisi olarak çalıştırılmalıdır")
local widgetInfo = DockWidgetPluginGuiInfo.new(Enum.InitialDockState.Float, true, true, 300, 200)
local dragSourceWidget = plugin:CreateDockWidgetPluginGuiAsync("Sürükleme Kaynağı", widgetInfo)
dragSourceWidget.Title = "Sürükleme Kaynağı"
local textBox = Instance.new("TextBox")
textBox.Parent = dragSourceWidget
textBox.Size = UDim2.new(1, 0, 0, 32)
textBox.Text = "Merhaba, eklenti sürüklemeleri"
local dragButton = Instance.new("TextButton")
dragButton.Size = UDim2.new(1, 0, 1, -32)
dragButton.Position = UDim2.new(0, 0, 0, 32)
dragButton.Text = "Yukarıdaki metni düzenle, sonra buradan sürüklemeye başla"
dragButton.Parent = dragSourceWidget
function onMouseButton1Down()
local dragData = {
Sender = "BazıSürüklemeKaynağı",
MimeType = "text/plain",
Data = textBox.Text,
MouseIcon = "",
DragIcon = "",
HotSpot = Vector2.new(0, 0),
}
plugin:StartDrag(dragData)
end
dragButton.MouseButton1Down:Connect(onMouseButton1Down)
-- Bu widget bırakmaları alacak
local dragTargetWidget = plugin:CreateDockWidgetPluginGuiAsync("Bırakma Hedefi", widgetInfo)
dragTargetWidget.Title = "Bırakma Hedefi"
-- Bu TextLabel bırakılanı gösterecek
local textLabel = Instance.new("TextLabel")
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.Text = "Buraya bırak..."
textLabel.Parent = dragTargetWidget
local function onDragDrop(dragData)
if dragData.MimeType == "text/plain" then
textLabel.Text = dragData.Data
else
textLabel.Text = dragData.MimeType
end
end
dragTargetWidget.PluginDragDropped:Connect(onDragDrop)
dragTargetWidget.PluginDragEntered:Connect(function(_dragData)
print("PluginDragEntered")
end)
dragTargetWidget.PluginDragLeft:Connect(function(_dragData)
print("PluginDragLeft")
end)
dragTargetWidget.PluginDragMoved:Connect(function(_dragData)
print("PluginDragMoved")
end)PluginDragEntered
Parametreler
Kod Örnekleri
Eklenti Sürükle ve Bırak
assert(plugin, "Bu betik bir Studio eklentisi olarak çalıştırılmalıdır")
local widgetInfo = DockWidgetPluginGuiInfo.new(Enum.InitialDockState.Float, true, true, 300, 200)
local dragSourceWidget = plugin:CreateDockWidgetPluginGuiAsync("Sürükleme Kaynağı", widgetInfo)
dragSourceWidget.Title = "Sürükleme Kaynağı"
local textBox = Instance.new("TextBox")
textBox.Parent = dragSourceWidget
textBox.Size = UDim2.new(1, 0, 0, 32)
textBox.Text = "Merhaba, eklenti sürüklemeleri"
local dragButton = Instance.new("TextButton")
dragButton.Size = UDim2.new(1, 0, 1, -32)
dragButton.Position = UDim2.new(0, 0, 0, 32)
dragButton.Text = "Yukarıdaki metni düzenle, sonra buradan sürüklemeye başla"
dragButton.Parent = dragSourceWidget
function onMouseButton1Down()
local dragData = {
Sender = "BazıSürüklemeKaynağı",
MimeType = "text/plain",
Data = textBox.Text,
MouseIcon = "",
DragIcon = "",
HotSpot = Vector2.new(0, 0),
}
plugin:StartDrag(dragData)
end
dragButton.MouseButton1Down:Connect(onMouseButton1Down)
-- Bu widget bırakmaları alacak
local dragTargetWidget = plugin:CreateDockWidgetPluginGuiAsync("Bırakma Hedefi", widgetInfo)
dragTargetWidget.Title = "Bırakma Hedefi"
-- Bu TextLabel bırakılanı gösterecek
local textLabel = Instance.new("TextLabel")
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.Text = "Buraya bırak..."
textLabel.Parent = dragTargetWidget
local function onDragDrop(dragData)
if dragData.MimeType == "text/plain" then
textLabel.Text = dragData.Data
else
textLabel.Text = dragData.MimeType
end
end
dragTargetWidget.PluginDragDropped:Connect(onDragDrop)
dragTargetWidget.PluginDragEntered:Connect(function(_dragData)
print("PluginDragEntered")
end)
dragTargetWidget.PluginDragLeft:Connect(function(_dragData)
print("PluginDragLeft")
end)
dragTargetWidget.PluginDragMoved:Connect(function(_dragData)
print("PluginDragMoved")
end)PluginDragLeft
Parametreler
Kod Örnekleri
Eklenti Sürükle ve Bırak
assert(plugin, "Bu betik bir Studio eklentisi olarak çalıştırılmalıdır")
local widgetInfo = DockWidgetPluginGuiInfo.new(Enum.InitialDockState.Float, true, true, 300, 200)
local dragSourceWidget = plugin:CreateDockWidgetPluginGuiAsync("Sürükleme Kaynağı", widgetInfo)
dragSourceWidget.Title = "Sürükleme Kaynağı"
local textBox = Instance.new("TextBox")
textBox.Parent = dragSourceWidget
textBox.Size = UDim2.new(1, 0, 0, 32)
textBox.Text = "Merhaba, eklenti sürüklemeleri"
local dragButton = Instance.new("TextButton")
dragButton.Size = UDim2.new(1, 0, 1, -32)
dragButton.Position = UDim2.new(0, 0, 0, 32)
dragButton.Text = "Yukarıdaki metni düzenle, sonra buradan sürüklemeye başla"
dragButton.Parent = dragSourceWidget
function onMouseButton1Down()
local dragData = {
Sender = "BazıSürüklemeKaynağı",
MimeType = "text/plain",
Data = textBox.Text,
MouseIcon = "",
DragIcon = "",
HotSpot = Vector2.new(0, 0),
}
plugin:StartDrag(dragData)
end
dragButton.MouseButton1Down:Connect(onMouseButton1Down)
-- Bu widget bırakmaları alacak
local dragTargetWidget = plugin:CreateDockWidgetPluginGuiAsync("Bırakma Hedefi", widgetInfo)
dragTargetWidget.Title = "Bırakma Hedefi"
-- Bu TextLabel bırakılanı gösterecek
local textLabel = Instance.new("TextLabel")
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.Text = "Buraya bırak..."
textLabel.Parent = dragTargetWidget
local function onDragDrop(dragData)
if dragData.MimeType == "text/plain" then
textLabel.Text = dragData.Data
else
textLabel.Text = dragData.MimeType
end
end
dragTargetWidget.PluginDragDropped:Connect(onDragDrop)
dragTargetWidget.PluginDragEntered:Connect(function(_dragData)
print("PluginDragEntered")
end)
dragTargetWidget.PluginDragLeft:Connect(function(_dragData)
print("PluginDragLeft")
end)
dragTargetWidget.PluginDragMoved:Connect(function(_dragData)
print("PluginDragMoved")
end)PluginDragMoved
WindowFocused
Kod Örnekleri
PluginGui Odak Durumunu İzleme
local info = DockWidgetPluginGuiInfo.new(Enum.InitialDockState.Float, true, true, 200, 50, 1, 1)
local widget = plugin:CreateDockWidgetPluginGuiAsync("TestWidget", info)
local function onFocusReleased()
widget.Title = "Dikkatim da değil :("
end
local function onFocused()
widget.Title = "Dikkatim de :D"
end
widget.WindowFocusReleased:Connect(onFocusReleased)
widget.WindowFocused:Connect(onFocused)WindowFocusReleased
Kod Örnekleri
PluginGui Odak Durumunu İzleme
local info = DockWidgetPluginGuiInfo.new(Enum.InitialDockState.Float, true, true, 200, 50, 1, 1)
local widget = plugin:CreateDockWidgetPluginGuiAsync("TestWidget", info)
local function onFocusReleased()
widget.Title = "Dikkatim da değil :("
end
local function onFocused()
widget.Title = "Dikkatim de :D"
end
widget.WindowFocusReleased:Connect(onFocusReleased)
widget.WindowFocused:Connect(onFocused)