Gamepad Service
概要
方法
DisableGamepadCursor():() |
EnableGamepadCursor(guiObject: GuiObject?):() |
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)