Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Chaosgod_Espér on October 24, 2012, 08:30:43 AM

Title: Get the count of signs in a label? And 3D models over the GUI?
Post by: Chaosgod_Espér 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:
(http://www.imagesload.net/img/Preview_GUI_21.png)

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?
Title: Re: Get the count of signs in a label? And 3D models over the GUI?
Post by: ArenMook 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.
Title: Re: Get the count of signs in a label? And 3D models over the GUI?
Post by: Chaosgod_Espér 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?
Title: Re: Get the count of signs in a label? And 3D models over the GUI?
Post by: ArenMook 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.
Title: Re: Get the count of signs in a label? And 3D models over the GUI?
Post by: Chaosgod_Espér 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

^^