Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: erniesbot on May 15, 2015, 06:40:13 AM

Title: Does a uGui "on selected/on highlighted" type event action exist?[SOLVED]
Post by: erniesbot on May 15, 2015, 06:40:13 AM
Hi guys,

Apologies if i've overlooked something very basic here but I have the following issue.

I'm creating a UI system that needs to be navigated via a gamepad. I can navigate between the buttons fine, but I can not find an action which is triggered when a button is highlighted (not pressed).

There is a similar function for mouse use "UGUI / ON POINTER ENTER" but this does not work when the button is selected via a gamepad (or keyboard arrow keys).

To summarise, what I want to happen is: When ButtonX "is selected" --> Do somthing

Is this possible or am I overlooking something simple here?  :o

Cheers!

Title: Re: Does a uGui "on selected/on highlighted" type event action exist?
Post by: jeanfabre on May 15, 2015, 11:14:22 AM
Hi,

 interesting question. I don't know, I have never tested this. Let me run some tests and research on this. Please bump me mid next week if you haven't heard back.

 Bye,

 Jean
Title: Re: Does a uGui "on selected/on highlighted" type event action exist?
Post by: mdotstrange on May 15, 2015, 01:38:08 PM
I was trying to do this to get an inventory system working so when you selected an item in the inventory it would display an image + string and I couldn't get it working- would be great to have an "on Selection" action or something similar-
Title: Re: Does a uGui "on selected/on highlighted" type event action exist?
Post by: erniesbot on May 18, 2015, 01:08:34 AM
Hey guys!

Think I found a solution to this...

First I set up my button, with a playmaker fsm and a global event called "select" and whatever actions you want in it.

Then on my GUI button I go Add Component -> Event -> "Event Trigger". Then click "add new event type" choose "select"

Then click the "+", then I drag the button from the hirachy into where it says "None (Object)". Then click "no funtion" choose SendEvent (string) - then simply type the name of your event you want triggered in my case "select".

Boom! 8)

Title: Re: Does a uGui "on selected/on highlighted" type event action exist?
Post by: Lane on May 18, 2015, 04:39:48 AM
^ Thats how you can do it.

The UI event system is pretty robust, you really should look into all of the features that the UI system offers and take advantage of them.

One problem I found was that you can't target which FSM it sends the event to, so just make sure you have one FSM and it won't get confused. I think if you have more than one then it just sends it to the first FSM script in the inspector stack.
Title: Re: Does a uGui "on selected/on highlighted" type event action exist?
Post by: mdotstrange on May 18, 2015, 02:43:03 PM
Hey guys!

Think I found a solution to this...

First I set up my button, with a playmaker fsm and a global event called "select" and whatever actions you want in it.

Then on my GUI button I go Add Component -> Event -> "Event Trigger". Then click "add new event type" choose "select"

Then click the "+", then I drag the button from the hirachy into where it says "None (Object)". Then click "no funtion" choose SendEvent (string) - then simply type the name of your event you want triggered in my case "select".

Boom! 8)

Awesome! Thank you  :)
Title: Re: Does a uGui "on selected/on highlighted" type event action exist?
Post by: Tachyonix on August 20, 2015, 04:42:03 AM
You can also use PlayMakerUGuiPointerEventsProxy script.
Title: Re: Does a uGui "on selected/on highlighted" type event action exist?
Post by: Gua on April 27, 2017, 09:40:34 AM
Hey guys!

Think I found a solution to this...

First I set up my button, with a playmaker fsm and a global event called "select" and whatever actions you want in it.

Then on my GUI button I go Add Component -> Event -> "Event Trigger". Then click "add new event type" choose "select"

Then click the "+", then I drag the button from the hirachy into where it says "None (Object)". Then click "no funtion" choose SendEvent (string) - then simply type the name of your event you want triggered in my case "select".

Boom! 8)

For some reason it doesn't work for me :(


PlayMakerUGuiPointerEventsProxy however worked.
Title: Re: Does a uGui "on selected/on highlighted" type event action exist?
Post by: serkanos on August 15, 2017, 11:01:23 PM
I did it.
create a global event like "Sound"
add event trigger to the button
drag to button to event trigger
and select playmakerFSM.sendremoteFsmevent
Title: Re: Does a uGui "on selected/on highlighted" type event action exist?
Post by: jeanfabre on August 15, 2017, 11:36:12 PM
Hi,

 Yes, that's one way, also, ugui now feature new actions to listen to all possible Unity UI events, like uGuiOnSelectEvent action

Bye,

 Jean
Title: Re: Does a uGui "on selected/on highlighted" type event action exist?
Post by: craigz on August 23, 2017, 09:51:58 PM
Hi Jean! :D

Just wanted to ask where to to access those actions?

Thanks for following up on this!

-craigz
Title: Re: Does a uGui "on selected/on highlighted" type event action exist?
Post by: jeanfabre on August 23, 2017, 11:37:29 PM
Hi,

 they are all accessible via the Ecosystem (https://hutonggames.fogbugz.com/f/page?W1181) which sources itself from various public github reps like this one: https://github.com/jeanfabre/PlayMaker--Unity--UI

 the easiest way is to get the Ecosystem browser and you can access many custom actions, samples and packages like the uGui Package.

 Get the Full package for ugui and it will contains all the related custom actions to work with ugui.

follow me on twitter to get instant updates :)

https://twitter.com/JeanAtPlayMaker/status/871638950997372928


Bye,

 Jean

Title: Re: Does a uGui "on selected/on highlighted" type event action exist?
Post by: craigz on August 28, 2017, 09:53:01 PM
Hey Jean!

Sorry should clarify, was looking specifically for the "uGuiOnSelectEvent" action! I forgot to update to the latest :D

Thanks again! :D

-craigz
Title: Re: Does a uGui "on selected/on highlighted" type event action exist?
Post by: Gua on September 08, 2017, 04:33:15 AM
Hi,

 they are all accessible via the Ecosystem (https://hutonggames.fogbugz.com/f/page?W1181) which sources itself from various public github reps like this one: https://github.com/jeanfabre/PlayMaker--Unity--UI

 the easiest way is to get the Ecosystem browser and you can access many custom actions, samples and packages like the uGui Package.

 Get the Full package for ugui and it will contains all the related custom actions to work with ugui.

follow me on twitter to get instant updates :)

https://twitter.com/JeanAtPlayMaker/status/871638950997372928


Bye,

 Jean
I have problems with new actions, what is minimum Playmaker version requirement?


You can also use PlayMakerUGuiPointerEventsProxy script.
If you don't support navigation with gamepad or keyboard, then you can. But if you do, PlayMakerUGuiPointerEventsProxy will not help.
Title: Re: Does a uGui "on selected/on highlighted" type event action exist?[SOLVED]
Post by: jeanfabre on September 10, 2017, 11:20:25 PM
Hi,

 1.8.1 is the minimum I think,

- what version of PlayMaker do you have
- what version of uGui do you have ( in the changeling.md inside the ugui folder)
- what version of Unity?
- what problem exactly do you have?


Thanks,

 Jean
Title: Re: Does a uGui "on selected/on highlighted" type event action exist?[SOLVED]
Post by: miguelfanclub on January 26, 2019, 09:00:48 AM
Bumping this to say that the Trigger Event worked, but the action "uGuiOnSelectEvent" didnt for me.
Title: Re: Does a uGui "on selected/on highlighted" type event action exist?[SOLVED]
Post by: jeanfabre on January 27, 2019, 10:48:32 PM
Hi,

 Can you try with UiOnSelectEvent, PlayMaker has now UI support built in.

Bye,

 Jean