Author Topic: No labels on buttons with iPad  (Read 3961 times)

zentuit

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
No labels on buttons with iPad
« 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: No labels on buttons with iPad
« Reply #1 on: May 01, 2012, 09:42:22 AM »
Let me guess, the font is using a different atlas?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: No labels on buttons with iPad
« Reply #2 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 somewhere.  :P

zentuit

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: No labels on buttons with iPad
« Reply #3 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

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: No labels on buttons with iPad
« Reply #4 on: May 01, 2012, 10:12:02 AM »
Check the panel tool to make sure you don't have any extra panels about.

zentuit

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: No labels on buttons with iPad
« Reply #5 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?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: No labels on buttons with iPad
« Reply #6 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.

zentuit

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: No labels on buttons with iPad
« Reply #7 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!