playMaker

Author Topic: Does a uGui "on selected/on highlighted" type event action exist?[SOLVED]  (Read 4712 times)

erniesbot

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
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!

« Last Edit: August 29, 2017, 12:00:41 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
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

mdotstrange

  • Hero Member
  • *****
  • Posts: 551
    • View Profile
    • Can't code? Who cares! Make games anyway!
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-
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

erniesbot

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
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)


Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
^ 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.

mdotstrange

  • Hero Member
  • *****
  • Posts: 551
    • View Profile
    • Can't code? Who cares! Make games anyway!
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  :)
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

Tachyonix

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Re: Does a uGui "on selected/on highlighted" type event action exist?
« Reply #6 on: August 20, 2015, 04:42:03 AM »
You can also use PlayMakerUGuiPointerEventsProxy script.

Gua

  • Full Member
  • ***
  • Posts: 162
    • View Profile
    • Andrii Vintsevych
Re: Does a uGui "on selected/on highlighted" type event action exist?
« Reply #7 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.
« Last Edit: April 27, 2017, 09:45:04 AM by Gua »

serkanos

  • Playmaker Newbie
  • *
  • Posts: 30
    • View Profile
Re: Does a uGui "on selected/on highlighted" type event action exist?
« Reply #8 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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Re: Does a uGui "on selected/on highlighted" type event action exist?
« Reply #9 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

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 199
    • View Profile
    • Haven Made
Re: Does a uGui "on selected/on highlighted" type event action exist?
« Reply #10 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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Re: Does a uGui "on selected/on highlighted" type event action exist?
« Reply #11 on: August 23, 2017, 11:37:29 PM »
Hi,

 they are all accessible via the Ecosystem 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


craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 199
    • View Profile
    • Haven Made
Re: Does a uGui "on selected/on highlighted" type event action exist?
« Reply #12 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

Gua

  • Full Member
  • ***
  • Posts: 162
    • View Profile
    • Andrii Vintsevych
Re: Does a uGui "on selected/on highlighted" type event action exist?
« Reply #13 on: September 08, 2017, 04:33:15 AM »
Hi,

 they are all accessible via the Ecosystem 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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Re: Does a uGui "on selected/on highlighted" type event action exist?[SOLVED]
« Reply #14 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