Classe motore
GamepadService
*Questo contenuto è tradotto usando AI (Beta) e potrebbe contenere errori. Per visualizzare questa pagina in inglese, clicca qui.
Riferimento API
Proprietà
GamepadCursorEnabled
Campioni di codice
GamepadService - Proprietà Abilitata del Cursore del Gamepad
local gamepadService = game.GamepadService
gamepadService:GetPropertyChangedSignal("GamepadCursorEnabled"):Connect(function()
local enabled = gamepadService.GamepadCursorEnabled
if enabled then
-- Codice personalizzato quando il cursore virtuale è abilitato
else
-- Codice personalizzato quando il cursore virtuale è disabilitato
end
end)Metodi
DisableGamepadCursor
GamepadService:DisableGamepadCursor():()
Restituzioni
()
Campioni di codice
GamepadService - Disabilita il cursore del 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
Parametri
Restituzioni
()
Campioni di codice
GamepadService - Abilita il cursore del 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)