CRMouse - A Cursor for Controller Users


Back in 2018 I was looking for a way to have a cursor for Controller users. The reason I needed the cursor was for parts of a game I was working on (Still working on it btw, solo deving takes time.) I discovered there was no built in option in roblox for this; i’d have to code a new cursor that supports controllers myself.

I introduce to you, CRMouse (Controller Mouse) a Script that gives a Cursor for Controller Users.

Get CRMouse: https://www.roblox.com/library/3735143264/CRMouse
Example Place: https://www.roblox.com/games/3739962516/CRMouse-Test-Place

Functions

A list of Functions built into CRMouse:

ToggleCursor

Call Using: CRMouse.ToggleCursor:Invoke()
Returns: True/False
Return Info: Returns true if CRMouse has been Enabled, returns false if CRMouse has been Disabled.

CRMouseStatus

Call Using: CRMouse.CRMouseStatus:Invoke()
Returns: True/False
Return Info: Returns True if CRMouse is currently Enabled. Returns False if CRMouse is currently Disabled.

CreateEvents

Desc: Creates the following events for a given UI Object: “Button A Down”,“Button A Released”,“CursorEnter”,“CursorLeave”

Call Using: CRMouse.CreateEvents:Invoke(Obj,Name,false)
Parameters: Object - A UI Object | Name - Suffix(Name)EventName | (Optional) Disable Button A Released and Button A Down, by default this is false.

Returns: Nothing.
Notes: This function will put an error to console if the Object given isn’t a GuiObject or if the name given is currently in use.

This Function also needs to be called to allow TextBox input without uinsg the “Select” key.

End function list.

Events

List of events for CRMouse:

CRMove

Desc: Fires when the cursor is moved.
Listen Using: CRMouse.CRMove.Event
Returns: Returns 2 values AbsoluteX and AbsoluteY position of the Cursor.

Cursor Enter Event

Desc: Fires when the cursor enters a subcribed UI
Listen Using: CRMouse.[Name*]Enter.Event
Returns: Nothing
Notes*: In order to get a Cursor enter event you must first create all events for a GUI Object using “CreateEvents”. [Name*] Is the name you gave to CreateEvents.

Cursor Leave Event

Desc: Fires when the cursor leaves a subcribed UI
Listen Using: CRMouse.[Name*]Leave.Event
Returns: Nothing
Notes: In order to get a Cursor leave event you must first create all events for a GUI Object using “CreateEvents”. [Name*] is the name you gave to CreateEvents.

Button A Released

Desc: Fires when the A Button is released on a controller that has it’s cursor within a subscribed UI.
Listen Using: CRMouse.[Name*]AReleased.Event
Returns: Nothing
Notes: In order to get a Cursor leave event you must first create all events for a GUI Object using “CreateEvents”. [Name*] is the name you gave to CreateEvents.

Button A Down

Desc: Fires when the A Button is pushed down on a controller that has it’s cursor within a subscribed UI.
Listen Using: CRMouse.[Name*]ADown.Event
Returns: Nothing
Notes: In order to get a Cursor leave event you must first create all events for a GUI Object using “CreateEvents”. [Name*] is the name you gave to CreateEvents.

end event list

Q & A:

Q: Is the Cursor in CRMouse Customizable?
A: Somewhat, there isn’t a built in function for this; you’ll have to go into the script and look for the cursor settings comment.

Q: Does the Cursor for CRMouse autoscale to the screen?
A: Yes.

Q: Is CRMouse automatically on when the player joins the game?
A: No, it’s your responsibility to determine if the player is using a controller from which you can call ToggleCursor to enable CRMouse.

Q: What if I want/need to disable CRMouse?
A: Simple, Just call up the ToggleCursor Function which will hide the cursor and allow the user to take control of their character.

Q: Does CRMouse Support multiple controllers, such as for splitscreen multiplayer?
A: CRMouse does not support multiple controllers.

Q: Does CRMouse Support scrolling frames?
A: Not at this time.(CRMouse cannot scroll scrolling frames at this time.)

~ Questions? Let me know!
~ Please report any bugs you come across so that I may fix them.
~ Suggestions are always welcome!

9 Likes