playMaker

Author Topic: ArrayMaker (Question)  (Read 2134 times)

gamedivision

  • Full Member
  • ***
  • Posts: 227
    • View Profile
ArrayMaker (Question)
« on: December 27, 2012, 12:23:31 PM »
i created an NGUI Label and added an FSM to it i also added a play maker array list proxy,i created 31 string counts and in each column i added 1st 2nd 3rd 4th ect.. for the date of a month,how would i grab that info from the proxy and display it on the NGUI Label

thanks

kiriri

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: ArrayMaker (Question)
« Reply #1 on: December 27, 2012, 12:36:57 PM »
I don't quite understand. If you created a list proxy with just strings in it, you can get a specific string with the "arraymaker list get" action. Put in the index (the first item in the list has the index 0, the second has the index 1 etc...) and save the result to a normal playmaker string variable. then continue with the normal ngui actions or use set property.
« Last Edit: December 27, 2012, 12:40:04 PM by kiriri »
Best,
Sven

gamedivision

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Re: ArrayMaker (Question)
« Reply #2 on: December 27, 2012, 12:42:26 PM »
thanks for the speedy reply
what im trying to do is diplay data from a list,say we have 30 days in the month and someone wants to forward to the 15th when they press that button it will display the date 1st 2nd 3rd ect

I don't quite understand. If you created a list proxy with just strings in it, you can get a specific string with the "arraymaker list get" action. Put in the index (the first item in the list has the index 0, the second has the index 1 etc...) and save the result to a normal playmaker string variable. then continue with the normal ngui actions or use set property.

gamedivision

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Re: ArrayMaker (Question)
« Reply #3 on: December 27, 2012, 12:47:34 PM »
sorted Kiriri thank you,that nudge in the right direction
Array list get stored the string in a string var,then used set property on the NGUI label thank you

gamedivision

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Re: ArrayMaker (Question)
« Reply #4 on: December 27, 2012, 02:27:43 PM »
just when i thought i was home dry another issue pops up.
on my NGui Label i created 2 var,(Get Index int)(SetGui String)
on the FSM i have Array List Get,on the At Index i attach the (Get Index var) and the Get String Data i attach the (SetGui String)
then at the bottom i have a Set Property text then the (SetGui String var)
now when i put a number in the (Get Index int) and press play the display text changes to whatever is in the Play Maker List Proxy item no problem there.
i then created a button, attached an FSM with an OnClick transition to the second state which had a FINISHED Event back to the start state,in the second state i added a Set Fsm Int ,i then set the fsm name and var name from the label,i then created and added a (Btn_Index Int) to the set value.
i then created an Int Add with the (Btn_Index Int) set as the var,so every time i press the button it adds 1 to the var
now here is the problem it doesnt change the display text,but if i stop unity manually change the number and press play it changes it fine,even if i display the variable and press the button the variable goes up just wont change,does anyone have any idea please
thank you

gamedivision

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Re: ArrayMaker (Question)
« Reply #5 on: December 27, 2012, 03:11:29 PM »
i suppose the easiest question to ask would be how do i display text from  Play Maker List Proxy and be able to change the index displayed with a button

gamedivision

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Re: ArrayMaker (Question)
« Reply #6 on: December 27, 2012, 05:03:22 PM »
i worked it out in the end
in the array list get i have a global int in the at index attached to a count up button and count down button each has a int operator adding 1 to or subtracting 1  with then displays the item of the proxy list