Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: AmpliMath on March 29, 2013, 10:39:54 AM

Title: Newbie questions
Post by: AmpliMath on March 29, 2013, 10:39:54 AM
Title: Re: Newbie questions
Post by: Nicki on March 30, 2013, 07:32:13 PM
Ooh endless space, I have that!. :)

I'll try to ask your questions the best I can.

* If all the widgets/panels are on at the same time, it will run slowly. Especially if many of them are moving around.
* UITexture can set its mainTexture property at run time, so you can load and unload that as much as you want.
* I can't say much about this, because I don't know all the details. We had some troubles in one game with excessive garbage collections, but if you don't move around stuff inside the panels (move the panel instead) you don't re-create the meshes.
* Dynamic creation is relatively easy. I tend to use prefabs that I instantiate and add to the hierarchy, but you can add widgets dynamically too - you just have some more stuff to setup in code.
* What do you mean by controls?
* I wouldn't say the learning curve is all that high - you have to understand how widgets are drawn and then it's relatively easy to do advanced stuff.

Unity has freetype directly in it for its dynamic fonts, but NGUI does not support that officially.. yet. I don't know the time table for supporting it, but as far as I know it will be in the next release.
Title: Re: Newbie questions
Post by: ArenMook on March 30, 2013, 10:12:55 PM
Endless Space is one of my most favorite games of all time. :D
Title: Re: Newbie questions
Post by: AmpliMath on April 01, 2013, 05:00:37 AM
Thanks for the nice comments! Do you know that many people asked me if the game UI was created using NGUI? :D I suppose that is a compliment for both me and you!

Getting back to controls, I meant creating new widgets. For instance, we created a "Sector" widget in Endless Space, with angleMin, angleMax, radiusMin, radiusMax. This allowed us to draw circles, disks, angular sectors, and even hourglasses with rectangular clip (but I guess you can do that with your FilledSprite). We used this for example in our research view (background ovoid shape in the attached image).

As this is not a rectangular widget, and vertices have to be generated using cos/sin, I was wondering how easy this would be to do myself using NGUI.

Cheers,
AmpliMath

Title: Re: Newbie questions
Post by: ArenMook on April 01, 2013, 06:04:56 AM
You can create a custom widget if you want -- just derive from UISprite or UIWidget, and override the OnFill function.

That said, filled sprite is able to do cooldown style timers quite nicely with a 360 degree fill. It also generates vertices using sin/cos.