playMaker

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

erniesbot

  • Playmaker Newbie
  • *
  • Posts: 7
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, 03:00:41 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
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: 555
    • 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
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: 2511
  • Mender of the past
    • 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.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • 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
Re: Does a uGui "on selected/on highlighted" type event action exist?
« Reply #6 on: August 20, 2015, 07:42:03 AM »
You can also use PlayMakerUGuiPointerEventsProxy script.

Gua

  • Beta Group
  • Sr. Member
  • *
  • Posts: 309
    • Andrii Vintsevych
Re: Does a uGui "on selected/on highlighted" type event action exist?
« Reply #7 on: April 27, 2017, 12:40:34 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)

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


PlayMakerUGuiPointerEventsProxy however worked.
« Last Edit: April 27, 2017, 12:45:04 PM by Gua »

serkanos

  • Playmaker Newbie
  • *
  • Posts: 38
Re: Does a uGui "on selected/on highlighted" type event action exist?
« Reply #8 on: August 16, 2017, 02:01:23 AM »
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: 15500
  • Official Playmaker Support
Re: Does a uGui "on selected/on highlighted" type event action exist?
« Reply #9 on: August 16, 2017, 02:36:12 AM »
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: 234
    • Haven Made
Re: Does a uGui "on selected/on highlighted" type event action exist?
« Reply #10 on: August 24, 2017, 12:51:58 AM »
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: 15500
  • Official Playmaker Support
Re: Does a uGui "on selected/on highlighted" type event action exist?
« Reply #11 on: August 24, 2017, 02:37:29 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


craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 234
    • Haven Made
Re: Does a uGui "on selected/on highlighted" type event action exist?
« Reply #12 on: August 29, 2017, 12:53:01 AM »
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

  • Beta Group
  • Sr. Member
  • *
  • Posts: 309
    • Andrii Vintsevych
Re: Does a uGui "on selected/on highlighted" type event action exist?
« Reply #13 on: September 08, 2017, 07: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: 15500
  • Official Playmaker Support
Re: Does a uGui "on selected/on highlighted" type event action exist?[SOLVED]
« Reply #14 on: September 11, 2017, 02:20:25 AM »
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