Keyboard/Gamepad UI Navigation Module [Open Sourced]

Couldn’t have been possible without a bit of help from my main man wes_ban
Open sourced for your ensoyment
Feel free to make improvements of your own. Comment here pls.

DEMO PLACE


you can drag the buttons around if you wanna (but remember I only set the DirectionThreshold to 0.5 for the place)

MODEL

<BoundMenu> BoundMenu.new(Array)
		@param Array
			-- list of objects the BoundMenu can interact with
			
		--==Functions==--
		<nil> :LoadObjects(Array)
		-- Refreshes the list of objects the BoundMenu can interact with
			@param Array
				-- list of objects the BoundMenu can interact with
		<nil> :SetSelection(GuiObject)
			@param GuiObject
				-- Desired object for selection
			-- Forces the menu to select the GuiObject passed
		<nil> :Destroy()
			-- Disconnects input events connected from the BoundMenu
			
		--==Properties==--	
		.Enabled = true
			-- Determines if input events are enabled for the BoundMenu
		.KeyboardEnabled = true
			-- Determines if input events listen to Keyboard input
		.GamepadEnabled = true
			-- Determines if input events listen to Gamepad input
		.DirectionThreshold = 0.5
			-- Determines how sensitive the menu is when it comes to direction
		.Selection = <GuiObject>
			-- References the curerent selection from the BoundMenu

		--==Events==--
		.SelectionChanged(<GuiObject> OldObject, <GuiObject> NewObject)
			@param OldObject
				-- the previous selection
			@param NewObject
				-- the new selection
			-- Fires when the selection changes through the BoundMenu
2 Likes