rojo/.cursor/rules/roblox/reference/engine/classes/GamepadService.yaml
2026-02-02 12:08:47 -06:00

150 lines
4.8 KiB
YAML

# This file is automatically generated. Please don't edit it manually.
# To submit a bug report on the content, see
# https://devforum.roblox.com/c/bug-reports/documentation-issues/72
name: GamepadService
type: class
memory_category: Instances
summary: |
The GamepadService is internally responsible for handling inputs from various
controllers, such as Xbox One or PlayStation DualShock controllers.
description: |
The GamepadService is internally responsible for handling inputs from various
controllers, such as Xbox One or PlayStation DualShock controllers. It also
handles APIs used with the gamepad virtual cursor. You can enable the gamepad
cursor for your experience by setting `Enum.VirtualCursorMode` under
`Class.StarterGui|StarterGui` to `Enabled`.
code_samples: []
inherits:
- Instance
descendants: []
tags:
- NotCreatable
- Service
- NotReplicated
deprecation_message: ''
properties:
- name: GamepadService.GamepadCursorEnabled
summary: |
The state of the gamepad virtual cursor.
description: |
This boolean is a read only variable that maintains the state of the
gamepad virtual cursor. You can read this property but not write to it.
code_samples:
- GamepadService-GamepadCursorEnabled
type: boolean
tags: []
deprecation_message: ''
security:
read: None
write: RobloxScriptSecurity
thread_safety: ReadSafe
category: Data
serialization:
can_load: true
can_save: true
capabilities:
- Input
methods:
- name: GamepadService:DisableGamepadCursor
summary: |
Disables the gamepad cursor, if currently enabled.
description: |
This function disables the gamepad cursor, if it's currently enabled.
code_samples:
- GamepadService-DisableGamepadCursor
parameters: []
returns:
- type: ()
summary: ''
tags: []
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Input
- name: GamepadService:EnableGamepadCursor
summary: |
Enables the gamepad cursor or updates its position.
description: |
This function enables the gamepad cursor if it's currently disabled. If
the cursor is already enabled, calling the API updates the cursor's
position. The function accepts a `Class.GuiObject|GuiObject` parameter,
but there are some invalid cases. Please note that in order to set the
cursor to the default position, `nil` must be passed in as a parameter.
Providing no argument will result in an error.
<table>
<thread>
<tr>
<th>Input GuiObject</th>
<th>Cursor Starting Position</th>
</tr>
</thread>
<tbody>
<tr>
<td><code>Nil</code></td>
<td>Default position</td>
</tr>
<tr>
<td>Not a GuiObject</td>
<td>Cursor does not appear, errors<td>
</tr>
<tr>
<td>Not a child of BasePlayerGui</td>
<td>Cursor does not appear, errors</td>
</tr>
<tr>
<td>GuiObject has Visible 2 set to false or any parent visible set
to false</td>
<td>Default position with warning</td>
</tr>
<tr>
<td>Child of ScreenGui 1 with Enabled 1 set to false</td>
<td>Default position with warning</td>
</tr>
<tr>
<td>Child of BillboardGui 4 or SurfaceGui</td>
<td>Default position with warning</td>
</tr>
<tr>
<td>GuiObject outside the viewport (Or, any part of the gui object
that is off screen)</td>
<td>Default position with warning</td>
</tr>
<tr>
<td>Child of ScrollingFrame with clipping set to false: GuiObject
outside of scrolling frame (Object child of scrolling frame and
not visible on screen)</td>
<td>Default position with warning</td>
</tr>
<tr>
<td>Child of ScrollingFrame with clipping set to true: GuiObject
outside scrolling frame window but inside viewport</td>
<td>GuiObject moves into the scrolling frame and starts the cursor
centered over the object</td>
</tr>
<tr>
<td>GuiObject inside the frame and visible</td>
<td>Cursor starts centered on the GuiObject</td>
</tr>
</tbody>
</table>
code_samples:
- GamepadService-EnableGamepadCursor
parameters:
- name: guiObject
type: Instance
default:
summary: ''
returns:
- type: ()
summary: ''
tags: []
deprecation_message: ''
security: None
thread_safety: Unsafe
capabilities:
- Input
events: []
callbacks: []