Author Topic: Updating NGUI label using Playmaker  (Read 3185 times)

mikejkelley

  • Guest
Updating NGUI label using Playmaker
« on: November 19, 2013, 08:03:39 PM »
I've specified ammo as a global int var using Playmaker, is there a good way to get NGUI to display that value?

I had been using NGUI Update Label Text which is actually from a paid-for Playmaker action pack, was wondering if it's just something that by it's very nature is processor intensive.

I'm subtracting 30 ammo each frame while the player is firing, converting that as a string and sending it thru a NGUI Update Label Text action. NGUI Update Label Text is grinding gameplay to a halt.

Again, I realize that this involves 2 other packages for which you're not responsible, was hoping you could offer a solution.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Updating NGUI label using Playmaker
« Reply #1 on: November 19, 2013, 08:35:38 PM »
You really should ask this on the Playmaker forums. From NGUI's side, to update a label's text all that needs to happen is:
  1. UILabel lbl = GetComponent<UILabel>();
  2. lbl.text = "Hello world";

mikejkelley

  • Guest
Re: Updating NGUI label using Playmaker
« Reply #2 on: November 25, 2013, 02:41:58 PM »
Hi, the Playmaker actions I'm using are from a third-third party developer from rocket games mobile, not affiliated w/ the Playmaker developers themselves. He insists that it's an NGUI bug and I thought I'd oblige him by posting the errors here.

Quote
Hi,

When I use Ngui Update Label Text, if I've not selected "maximize on play"
in Unity, the game fails to play and elicits "Font size and style
overrides are only supported for dynamic fonts (which I'm using)." If
the window is
"maximiz(ed) on play" the error doesn't occur.

Obviously it was awhile before I isolated these variables and there
are times I'd like to test my game w/out maximizing on play.

Quote
I have another issue now. NGUI Update Label Text is grinding gameplay to a halt. I'm subtracting 30 ammo each frame while the player is firing, converting that as a string and sending it thru NGUI Update Label Text.

(no response)

Quote
The issue seems to only happen in the editor, as do the other errors. But, I still need them resolved as I can't build to test ea. time.

(no response)