playMaker

Author Topic: NGUI Button Help[SOLVED]  (Read 3112 times)

mweyna

  • Full Member
  • ***
  • Posts: 242
NGUI Button Help[SOLVED]
« on: February 26, 2014, 04:29:50 PM »
So using NGUI, when I try to create an Image Button, I can't find the right playmaker hook to dynamically specify an Atlas Image, or how to via playmaker update the PRESS, HOVER, DISABLED, etc elements of the component. I have a Sprite in my Atlas I want to apply, but need to specific it run-time, rather then as a predetermined button. Any thoughts how to do that?
« Last Edit: March 04, 2014, 06:41:59 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: NGUI Button Help
« Reply #1 on: February 27, 2014, 03:34:59 AM »
Hi,

 you should still try to rely as much as possible on NGUI set of behaviors to do that ( like enabling disabling stuff.

 but to do that, simply set the "SpriteName" property of a UISprite using the action "set property"

bye,

 Jean

mweyna

  • Full Member
  • ***
  • Posts: 242
Re: NGUI Button Help
« Reply #2 on: February 27, 2014, 12:59:39 PM »
I'll give it a shot this afternoon. I'm building an inventory screen, and right now it gets the prefab names from an Array, and then spawns the appropriate Icon Button Objects onto fixed anchor position objects on my Inventory UI element. Since in theory you can have any number of combinations in your inventory, I'm looking for the cleanest way to assign the right Button/Icon.

mweyna

  • Full Member
  • ***
  • Posts: 242
Re: NGUI Button Help
« Reply #3 on: February 27, 2014, 03:20:53 PM »
Looks like that worked perfectly. I have a SETPROPERTY action now that specifies my string variable to those corresponding behavior slots. Consider this SOLVED.