Clase de motor
GamepadService
*Este contenido se traduce usando la IA (Beta) y puede contener errores. Para ver esta página en inglés, haz clic en aquí.
Referencia API
Propiedades
GamepadCursorEnabled
Muestras de código
Propiedad GamepadCursorEnabled - GamepadService
local gamepadService = game.GamepadService
gamepadService:GetPropertyChangedSignal("GamepadCursorEnabled"):Connect(function()
local enabled = gamepadService.GamepadCursorEnabled
if enabled then
-- Código personalizado cuando el cursor virtual está habilitado
else
-- Código personalizado cuando el cursor virtual está deshabilitado
end
end)Métodos
DisableGamepadCursor
GamepadService:DisableGamepadCursor():()
Devuelve
()
Muestras de código
ServicioGamepad - Deshabilitar Cursor de Gamepad
local gamepadService = game.GamepadService
local userInputService = game.UserInputService
userInputService.InputBegan:Connect(function(inputObject, gameProcessed)
if inputObject.KeyCode == Enum.KeyCode.ButtonB then
gamepadService:DisableGamepadCursor()
end
end)EnableGamepadCursor
Parámetros
Devuelve
()
Muestras de código
ServicioGamepad - Activar Cursor de Gamepad
local gamepadService = game.GamepadService
local userInputService = game.UserInputService
local startObject = script.Parent
userInputService.InputBegan:Connect(function(inputObject, gameProcessed)
if inputObject.KeyCode == Enum.KeyCode.ButtonA then
gamepadService:EnableGamepadCursor(startObject)
end
end)