Clase de motor
DragDetector
*Este contenido se traduce usando la IA (Beta) y puede contener errores. Para ver esta página en inglés, haz clic en aquí.
Resumen
Propiedades
ActivatedCursorIcon:ContentId |
Métodos
AddConstraintFunction(priority: number,function: function):RBXScriptConnection |
RestartDrag():() |
SetDragStyleFunction(function: function):() |
SetPermissionPolicyFunction(function: function):() |
Eventos
DragContinue(playerWhoDragged: Player,cursorRay: Ray,viewFrame: CFrame,vrInputFrame: OptionalCoordinateFrame,isModeSwitchKeyDown: boolean):RBXScriptSignal |
DragEnd(playerWhoDragged: Player):RBXScriptSignal |
Referencia API
Propiedades
ActivatedCursorIcon
DragDetector.ActivatedCursorIcon:ContentId
Métodos
AddConstraintFunction
Devuelve
RestartDrag
DragDetector:RestartDrag():()
Devuelve
()
SetDragStyleFunction
SetPermissionPolicyFunction
Parámetros
Devuelve
()
Muestras de código
Función de Política de Permisos
local part = Instance.new("Part")
part.Parent = workspace
local dragDetector = Instance.new("DragDetector")
dragDetector.Parent = part
dragDetector.PermissionPolicy = Enum.DragDetectorPermissionPolicy.Scriptable
dragDetector:SetPermissionPolicyFunction(function(player, part)
if player and player:GetAttribute("IsInTurn") then
return true
elseif part and not part:GetAttribute("IsDraggable") then
return false
else
return true
end
end)Eventos
DragContinue
DragEnd
DragStart