Meer informatie
Engine-klasse
PluginGui
Niet maakbaar
Niet gerepliceerd

*Deze inhoud is vertaald met behulp van AI (bèta) en kan fouten bevatten. Klik hier om deze pagina in het Engels te bekijken.


Samenvatting

Eigenschappen
Overgenomen leden
Overgenomen door

API-referentie
Eigenschappen
Title
Parallel lezen
Mogelijkheden: UI
PluginGui.Title:string

Methoden
BindToClose
Mogelijkheden: UI
PluginGui:BindToClose(function:function):()
Parameters
function:function
Standaardwaarde: nil
Teruggaves
()

GetRelativeMousePosition
Plugin-beveiliging
Mogelijkheden: UI
PluginGui:GetRelativeMousePosition():Vector2
Teruggaves
Codevoorbeelden
PluginGui:GetRelativeMousePosition
local RunService = game:GetService("RunService")
local widgetInfo = DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Float,
true,
false, -- Ingeschakelde staat, overschrijven
200,
300, -- Grootte
150,
150 -- Minimale grootte
)
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()

Evenementen
PluginDragDropped
Plugin-beveiliging
Mogelijkheden: UI
PluginGui.PluginDragDropped(dragData:Dictionary):RBXScriptSignal
Parameters
dragData:Dictionary
Codevoorbeelden
Plugin Slepen en Neerzetten
assert(plugin, "Dit script moet worden uitgevoerd als een Studio-plugin")
local widgetInfo = DockWidgetPluginGuiInfo.new(Enum.InitialDockState.Float, true, true, 300, 200)
local dragSourceWidget = plugin:CreateDockWidgetPluginGuiAsync("Slepen Bron", widgetInfo)
dragSourceWidget.Title = "Slepen Bron"
local textBox = Instance.new("TextBox")
textBox.Parent = dragSourceWidget
textBox.Size = UDim2.new(1, 0, 0, 32)
textBox.Text = "Hallo, plugin slepen"
local dragButton = Instance.new("TextButton")
dragButton.Size = UDim2.new(1, 0, 1, -32)
dragButton.Position = UDim2.new(0, 0, 0, 32)
dragButton.Text = "Bewerk de tekst hierboven, en begin hier te slepen"
dragButton.Parent = dragSourceWidget
function onMouseButton1Down()
local dragData = {
Sender = "SomeDragSource",
MimeType = "text/plain",
Data = textBox.Text,
MouseIcon = "",
DragIcon = "",
HotSpot = Vector2.new(0, 0),
}
plugin:StartDrag(dragData)
end
dragButton.MouseButton1Down:Connect(onMouseButton1Down)
-- Dit widget zal drops ontvangen
local dragTargetWidget = plugin:CreateDockWidgetPluginGuiAsync("Neerzetten Doel", widgetInfo)
dragTargetWidget.Title = "Neerzetten Doel"
-- Deze TextLabel zal tonen wat er is neergezet
local textLabel = Instance.new("TextLabel")
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.Text = "Drop hier..."
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
Plugin-beveiliging
Mogelijkheden: UI
PluginGui.PluginDragEntered(dragData:Dictionary):RBXScriptSignal
Parameters
dragData:Dictionary
Codevoorbeelden
Plugin Slepen en Neerzetten
assert(plugin, "Dit script moet worden uitgevoerd als een Studio-plugin")
local widgetInfo = DockWidgetPluginGuiInfo.new(Enum.InitialDockState.Float, true, true, 300, 200)
local dragSourceWidget = plugin:CreateDockWidgetPluginGuiAsync("Slepen Bron", widgetInfo)
dragSourceWidget.Title = "Slepen Bron"
local textBox = Instance.new("TextBox")
textBox.Parent = dragSourceWidget
textBox.Size = UDim2.new(1, 0, 0, 32)
textBox.Text = "Hallo, plugin slepen"
local dragButton = Instance.new("TextButton")
dragButton.Size = UDim2.new(1, 0, 1, -32)
dragButton.Position = UDim2.new(0, 0, 0, 32)
dragButton.Text = "Bewerk de tekst hierboven, en begin hier te slepen"
dragButton.Parent = dragSourceWidget
function onMouseButton1Down()
local dragData = {
Sender = "SomeDragSource",
MimeType = "text/plain",
Data = textBox.Text,
MouseIcon = "",
DragIcon = "",
HotSpot = Vector2.new(0, 0),
}
plugin:StartDrag(dragData)
end
dragButton.MouseButton1Down:Connect(onMouseButton1Down)
-- Dit widget zal drops ontvangen
local dragTargetWidget = plugin:CreateDockWidgetPluginGuiAsync("Neerzetten Doel", widgetInfo)
dragTargetWidget.Title = "Neerzetten Doel"
-- Deze TextLabel zal tonen wat er is neergezet
local textLabel = Instance.new("TextLabel")
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.Text = "Drop hier..."
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
Plugin-beveiliging
Mogelijkheden: UI
PluginGui.PluginDragLeft(dragData:Dictionary):RBXScriptSignal
Parameters
dragData:Dictionary
Codevoorbeelden
Plugin Slepen en Neerzetten
assert(plugin, "Dit script moet worden uitgevoerd als een Studio-plugin")
local widgetInfo = DockWidgetPluginGuiInfo.new(Enum.InitialDockState.Float, true, true, 300, 200)
local dragSourceWidget = plugin:CreateDockWidgetPluginGuiAsync("Slepen Bron", widgetInfo)
dragSourceWidget.Title = "Slepen Bron"
local textBox = Instance.new("TextBox")
textBox.Parent = dragSourceWidget
textBox.Size = UDim2.new(1, 0, 0, 32)
textBox.Text = "Hallo, plugin slepen"
local dragButton = Instance.new("TextButton")
dragButton.Size = UDim2.new(1, 0, 1, -32)
dragButton.Position = UDim2.new(0, 0, 0, 32)
dragButton.Text = "Bewerk de tekst hierboven, en begin hier te slepen"
dragButton.Parent = dragSourceWidget
function onMouseButton1Down()
local dragData = {
Sender = "SomeDragSource",
MimeType = "text/plain",
Data = textBox.Text,
MouseIcon = "",
DragIcon = "",
HotSpot = Vector2.new(0, 0),
}
plugin:StartDrag(dragData)
end
dragButton.MouseButton1Down:Connect(onMouseButton1Down)
-- Dit widget zal drops ontvangen
local dragTargetWidget = plugin:CreateDockWidgetPluginGuiAsync("Neerzetten Doel", widgetInfo)
dragTargetWidget.Title = "Neerzetten Doel"
-- Deze TextLabel zal tonen wat er is neergezet
local textLabel = Instance.new("TextLabel")
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.Text = "Drop hier..."
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
Plugin-beveiliging
Mogelijkheden: UI
PluginGui.PluginDragMoved(dragData:Dictionary):RBXScriptSignal
Parameters
dragData:Dictionary

WindowFocused
Plugin-beveiliging
Mogelijkheden: UI
PluginGui.WindowFocused():RBXScriptSignal
Codevoorbeelden
Detecteren van PluginGui Focusstatus
local info = DockWidgetPluginGuiInfo.new(Enum.InitialDockState.Float, true, true, 200, 50, 1, 1)
local widget = plugin:CreateDockWidgetPluginGuiAsync("TestWidget", info)
local function onFocusReleased()
widget.Title = "Ik ben niet in focus :("
end
local function onFocused()
widget.Title = "Ik ben in focus :D"
end
widget.WindowFocusReleased:Connect(onFocusReleased)
widget.WindowFocused:Connect(onFocused)

WindowFocusReleased
Plugin-beveiliging
Mogelijkheden: UI
PluginGui.WindowFocusReleased():RBXScriptSignal
Codevoorbeelden
Detecteren van PluginGui Focusstatus
local info = DockWidgetPluginGuiInfo.new(Enum.InitialDockState.Float, true, true, 200, 50, 1, 1)
local widget = plugin:CreateDockWidgetPluginGuiAsync("TestWidget", info)
local function onFocusReleased()
widget.Title = "Ik ben niet in focus :("
end
local function onFocused()
widget.Title = "Ik ben in focus :D"
end
widget.WindowFocusReleased:Connect(onFocusReleased)
widget.WindowFocused:Connect(onFocused)

©2026 Roblox Corporation. Roblox, het Roblox-logo en Powering Imagination behoren tot onze geregistreerde en niet-geregistreerde handelsmerken in de VS en andere landen.