Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: zentuit on May 01, 2012, 09:41:31 AM

Title: No labels on buttons with iPad
Post by: zentuit on May 01, 2012, 09:41:31 AM
Well I'm befuddled.  If I add a panel, then add buttons to that panel and run in the editor I see the buttons with their labels.

If I run it on the iPad, I just see the background (UISliced sprite); no labels.

The background has a depth of 0; the label has a depth of 1.

Changing the z settings does not have any effect.

I have another label (not a button, just a UILabel) on a different panel (that shows the frame rate) and it displays fine so I think that would rule out any issue with the font.

I have no idea how to debug this.  Any help would be appreciated.
Title: Re: No labels on buttons with iPad
Post by: ArenMook on May 01, 2012, 09:42:22 AM
Let me guess, the font is using a different atlas?
Title: Re: No labels on buttons with iPad
Post by: Nicki on May 01, 2012, 10:06:26 AM
Try setting the z position on the label to -1.

Some questions are asked so often you'd think we didn't have a FAQ around here (http://www.tasharen.com/forum/index.php?topic=6.msg238#msg238) somewhere.  :P
Title: Re: No labels on buttons with iPad
Post by: zentuit on May 01, 2012, 10:09:06 AM
For convenience, I'm using the Fantasy atlas and Fantasy font included for the examples (at least until final art has progressed).

I created a new project and created a new UI.  Added a button with the Fantasy atlas and font.  The button shows correctly on ipad.

Soooo, I'll start pulling out UI items until I find the culprit.

@Nicki: I did try changing both the depth and z position (separately) after reading the FAQ but before posting :P
Title: Re: No labels on buttons with iPad
Post by: ArenMook on May 01, 2012, 10:12:02 AM
Check the panel tool to make sure you don't have any extra panels about.
Title: Re: No labels on buttons with iPad
Post by: zentuit on May 01, 2012, 10:52:35 AM
It seems its how I'm using TweenScale.

The buttons make up a context sensitive menu.  When you tap the screen, the menu displays items applicable to the game object you tapped.

I use TweenScale to have the menu expand out.  I have the Tween scale from (1,1,1) to (1,0,1) since at startup the tween gets called automatically.  (I don't know how to have the tween not fire on startup). 

If I remove the TweenScale, everything displays fine other than the menu being fully displayed on a tap.

If I add the Tween scale back but change the from/to to (1,0,1) and (1,1,1), then everything displays fine other than, again, the menu being fully displayed on a tap.

Is there any way to not have a Tween fire off on start?
Title: Re: No labels on buttons with iPad
Post by: ArenMook on May 01, 2012, 10:55:36 AM
Just disable the script in inspector and it won't play automatically.

Btw... don't use starting scale of 0. Use a small number instead like 0.01.
Title: Re: No labels on buttons with iPad
Post by: zentuit on May 01, 2012, 11:23:23 AM
It was the scale of 0 that was causing the problem.  When I changed from (1,0,1) to (1, .0001, 1) the menu worked perfectly.

Thanks!