Author Topic: Get the count of signs in a label? And 3D models over the GUI?  (Read 4646 times)

Chaosgod_Espér

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 28
    • View Profile
Get the count of signs in a label? And 3D models over the GUI?
« on: October 24, 2012, 08:30:43 AM »
Hi there

i´m completely new to unity and NGUI, but managed to make a Login and Account creation system.
Only thing left is the need of a correct Account Setup.

Means:
username should be between 5 and 20 characters, same for password, and the reentered password needs to match the password.

I searched through the reference, but couldn´t find something to ask, how many signs a label contains.
Like:
  1. UILabe.text.size
  2.  
  3. ex.:
  4. if(UILabe.text.size < 5){
  5. print("your username needs at least 5 or more signs");}
  6. }


And as second Question..
We want to create a Character Editor.
It actually looks like this:


Question now:
How to bring a 3D Model into the UIs center (Between the buttons), so it´s not covered by it?


is there a method for that?
« Last Edit: October 24, 2012, 08:32:59 AM by Chaosgod_Espér »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Get the count of signs in a label? And 3D models over the GUI?
« Reply #1 on: October 24, 2012, 04:53:29 PM »
Render to texture and display the texture using UITexture, or set up a secondary camera to draw to that part of the screen.

Chaosgod_Espér

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 28
    • View Profile
Re: Get the count of signs in a label? And 3D models over the GUI?
« Reply #2 on: October 24, 2012, 04:58:18 PM »
ah..
i don´t own Unity pro right now.. so.. render textures are not available..
How is the camera way working?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Get the count of signs in a label? And 3D models over the GUI?
« Reply #3 on: October 24, 2012, 05:01:29 PM »
That's a question for the Unity forums. Check Unity's documentation on how to use the Normalized View Port Rect property.

Chaosgod_Espér

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 28
    • View Profile
Re: Get the count of signs in a label? And 3D models over the GUI?
« Reply #4 on: October 24, 2012, 05:18:17 PM »
allright, will make a topic there..

Found out how the character counter is working

UILabel.text.Length

^^