playMaker

Author Topic: NGUI Integration (WIP) [NGUI 3.5.9 supported]  (Read 148225 times)

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
NGUI Integration (WIP) [NGUI 3.5.9 supported]
« on: April 08, 2012, 01:06:00 AM »
[EDIT: full package for NGUI support available on the wiki:
https://hutonggames.fogbugz.com/default.asp?W1111]

This actually isn't an action, but a component that forwards NGUI Events to a PlayMakerFSM.

Put this component on the GameObject with the Collider used by NGUI.
Choose an FSM to send events to (leave blank to target an FSM on the same GameObject).
You can rename the events to match descriptive event names in your FSM. E.g., "OK Button Pressed"
NOTE: Use the Get Event Info action in PlayMaker to get event arguments.
See also: http://www.tasharen.com/?page_id=160

This is a first step in NGUI integration. More NGUI actions coming soon!

NOTE: You can already interface with NGUI quite a bit using the Get/Set Property actions...

EDIT: Added a few screenshots to show usage.
« Last Edit: May 14, 2014, 01:16:06 AM by jeanfabre »

JayToronto

  • Playmaker Newbie
  • *
  • Posts: 4
Re: NGUI Integration (WIP)
« Reply #1 on: April 10, 2012, 07:37:44 PM »
Perfect! I just grabbed NGUI 2 days ago. Loving it so far!

jalex19

  • Playmaker Newbie
  • *
  • Posts: 27
Re: NGUI Integration (WIP)
« Reply #2 on: April 13, 2012, 09:03:42 AM »
This is awesome!

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: NGUI Integration (WIP)
« Reply #3 on: April 15, 2012, 06:52:37 PM »
Cool! NGUI users please post requests for actions so we can prioritize the work.. Thanks!

kyy921

  • Junior Playmaker
  • **
  • Posts: 50
    • 上海杉蔓数字科技
Re: NGUI Integration (WIP)
« Reply #4 on: April 15, 2012, 07:37:50 PM »
wann use playmaker to get & set the value of  the slider :)

Lars Steenhoff

  • Beta Group
  • Playmaker Newbie
  • *
  • Posts: 46
Re: NGUI Integration (WIP)
« Reply #5 on: April 17, 2012, 10:40:47 AM »
I would like to use ngui for highscore display, can I use playmaker to output a string to ngui?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: NGUI Integration (WIP)
« Reply #6 on: April 19, 2012, 05:59:23 PM »
wann use playmaker to get & set the value of  the slider :)

I just checked, and you can do this with Get/Set Property actions.

I suspect that you can access a lot of NGUI this way...


Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: NGUI Integration (WIP)
« Reply #7 on: April 19, 2012, 06:03:06 PM »
I would like to use ngui for highscore display, can I use playmaker to output a string to ngui?

Yup. Seems like Set Property works. Set the "text" property.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: NGUI Integration (WIP)
« Reply #8 on: April 20, 2012, 07:44:54 PM »
Please post your experiences using Get/Set Property with NGUI. Are there things that can't be achieved with them, and need custom actions? Or actions that are so common they should be custom actions for convenience?

jalex19

  • Playmaker Newbie
  • *
  • Posts: 27
Re: NGUI Integration (WIP)
« Reply #9 on: April 22, 2012, 09:52:36 AM »
Working on my switching my GUI system from UnityGUI to NGUI now, will delve into this and post what I find/need. Taking me a while though currently, only so many hours in the day :)

jalex19

  • Playmaker Newbie
  • *
  • Posts: 27
Re: NGUI Integration (WIP)
« Reply #10 on: April 22, 2012, 10:19:15 AM »
Ok, maybe I just haven't had my cornflakes this morning, but how do you make the Target Object in your screenshots above actually point to the Object type UILabel instead of UnityEngine.GameObject?

*edit* Cool, got my cornflakes - I need to drag the *component* not the GO itself...durr. It's a bit annoying that I have to lock the FSM I'm using (manager) when I select another GO, but I don't think that can be helped :)
« Last Edit: April 22, 2012, 10:24:44 AM by jalex19 »

Palamas

  • Playmaker Newbie
  • *
  • Posts: 3
Re: NGUI Integration (WIP)
« Reply #11 on: April 22, 2012, 08:21:25 PM »
Don't worry.  I won't tell you how many bowls of corflakes it took for me to figure that out one morning!  :o

Palamas

  • Playmaker Newbie
  • *
  • Posts: 3
Re: NGUI Integration (WIP)
« Reply #12 on: April 23, 2012, 01:12:41 AM »
Is there some way to determine which NGUI component sent the event to a FSM? 

*edit* Figured out a way. I attached a FSM to the component. Then used the script to send an event to the same component. From there I can forward both the event and the Object reference to the Controller FSM.  Convoluted, but works.


BUT.  Now I have found something that is driving me completely nuts.  How do I change the color of an object? Like a SlicedSprite for example?  I can drill down through UISlicedSprite->Inherited->color...  But I cannot set it to anything.
« Last Edit: April 23, 2012, 02:24:28 AM by Palamas »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: NGUI Integration (WIP)
« Reply #13 on: April 23, 2012, 03:11:08 PM »
Sorry there was a bug in 1.3.2 with color properties. This is fixed in 1.3.3. PM me if you want access to the beta...

PixelEnvision

  • Playmaker Newbie
  • *
  • Posts: 7
  • PM 1.3.2
    • Pixel Envision
Re: NGUI Integration (WIP)
« Reply #14 on: April 24, 2012, 02:46:55 PM »
Cool! NGUI users please post requests for actions so we can prioritize the work.. Thanks!

Add +1 to NGUI actions, another user here...
Pixel Envision - Creating fun apps for iOS & Android

Twitter / Facebook / YouTube[/UR