Gamepad Service
API 참조
속성
Gamepad Cursor Enabled
코드 샘플
게임패드 서비스 - 게임패드 커서 활성화 속성
local gamepadService = game:GetService("GamepadService")
gamepadService:GetPropertyChangedSignal("GamepadCursorEnabled"):Connect(function()
local enabled = gamepadService.GamepadCursorEnabled
if enabled then
-- 가상 커서가 활성화되었을 때의 사용자 정의 코드
else
-- 가상 커서가 비활성화되었을 때의 사용자 정의 코드
end
end)메서드
Disable Gamepad Cursor
Gamepad Service: Disable Gamepad Cursor():()
반환
()
코드 샘플
게임패드 서비스 - 게임패드 커서 비활성화
local gamepadService = game:GetService("GamepadService")
local userInputService = game:GetService("UserInputService")
userInputService.InputBegan:Connect(function(inputObject, gameProcessed)
if inputObject.KeyCode == Enum.KeyCode.ButtonB then
gamepadService:DisableGamepadCursor()
end
end)Enable Gamepad Cursor
매개 변수
| 기본값: nil |
반환
()
코드 샘플
게임패드 서비스 - 게임패드 커서 활성화
local gamepadService = game:GetService("GamepadService")
local userInputService = game:GetService("UserInputService")
local startObject = script.Parent
userInputService.InputBegan:Connect(function(inputObject, gameProcessed)
if inputObject.KeyCode == Enum.KeyCode.ButtonA then
gamepadService:EnableGamepadCursor(startObject)
end
end)