Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: JonathanBurroughs on September 04, 2014, 08:56:49 AM

Title: Joypad input for controlling GUI
Post by: JonathanBurroughs on September 04, 2014, 08:56:49 AM
Hello!

I've managed to pull together a really nice mouse-controlled user interface by making use of Unity's GUISkin object and PlayMaker's GUI actions.

However I'm having some trouble figuring out how to control the GUI using a joypad. Specifically I don't know how to swap between which button has focus based on joypad inputs.

I've been having a search of old threads without much success. Does anybody have any advice for how to achieve this?
Title: Re: Joypad input for controlling GUI
Post by: JonathanBurroughs on September 04, 2014, 08:57:29 AM
Heh. And no you're not allowed to just tell me to download NGUI. Although I sure am tempted.
Title: Re: Joypad input for controlling GUI
Post by: blackant on September 04, 2014, 11:01:06 AM
it's pretty simple

following this plan you can easily setup your inputs
(http://gameswallpaperhd.com/wp-content/uploads/2013/12/xbox-controller-buttons-namesxbox360controller---unify-community-wiki-akhov2d3.png)

also you can have both controls by keyboard and joypad by using same names
for exemple:
Horizontal
Type 1: Key or Mouse button
Type 2 (in a new input): Joystick Axis

same for Jump:
positive Button: space
Positive Button: joystick button 0

take care to not set any majuscule
Title: Re: Joypad input for controlling GUI
Post by: JonathanBurroughs on September 04, 2014, 11:17:16 AM
Heh. Thanks, blackant. Sorry, I think I should have been more specific in my original message.

I've got my inputs all set up just fine. It's the appropriate actions for changing my button states using controller input that I'm having trouble with.

By default GUI Buttons behave as expected when mouse'd over. However there's no equivalent default for joypad input. So I'm having to set up my own joypad GUI controller. I'm just not quite sure what the best approach is.

I can't find any PlayMaker actions for changing the Property of a GUI Element based on the Styles defined in the GUISkin.
Title: Re: Joypad input for controlling GUI
Post by: blackant on September 04, 2014, 01:28:54 PM
ho , i see

personnaly i make my menu using cross pad or left stick with a wait behind each action because each input is to fast to swich menus

see the actions below
first i start out of the menu with a move detection so if the player is using the jostick, the script can begin.
on each Button:
Axis Event : Up/Down
Set (Active Label) NGUI Property Button: UIButton >State Hover
Set ( Unactive Labels) NGUI Property Button: normal
Get Button Down: Joystick A > validate this state

after that comes additional effects free to you ... (sounds, Itween and others moves)

hope this help !


Title: Re: Joypad input for controlling GUI
Post by: JonathanBurroughs on September 05, 2014, 05:18:31 AM
Ah, you're using NGUI. I really need to get this.
Title: Re: Joypad input for controlling GUI
Post by: blackant on September 07, 2014, 03:42:26 AM
NGUI is a Really fast and great Help to make your GUI dynamics

You'll find a lot of possibilities using it

2D toolkit is also a good Package