Author Topic: My NGUI suggestions.  (Read 57742 times)

Mattivc

  • Guest
My NGUI suggestions.
« on: June 27, 2012, 09:50:45 AM »
I have been using NGUI on a project for a couple of weeks now, and i am very happy with it. I do however have a few suggestions for it. That i hope could be implemented in the future.

  • BUG - Clipping sprites when building atlases over 2K
This is the only bug i have found so far. When building a atlas that should end up being over 2K in size, NGUI will clip the sprites down and put them in a 2K atlas.

  • Better label control
I would like to see some more control in the UILabel component. Especially the ability to set character spacing. I know i can set this on the font prefab. But i see no reason why you shouldn't be able to set this individually on each UILabel.
Some other controls like individual character rotation and stuff like that would also be nice. But perhaps this functionality should be put in a separate UILabelPluss component to not clutter things.

  • Tilable sliced sprite
By this i mean that in addition to stretching the middle quads of a sliced sprite, you should also be able to use a tileable texture similar to the Tiled Sprite, and have it repeat when increasing the size of the tiled sprite. This way you could use patters on the entire sliced sprite.

  • Progress bar when building atlas
Sometime it can take a while, some progress feedback would be nice.

  • UIAnchors camera selection
Pleas make the UIAnchors search upwards in the hierarchy and set the first camera they find as its anchor camera upon creation. I have a 3D camera and a UI camera in my scene i have have to switch it on every single anchor i create.

  • Better pixel perfect support when using 3D camera
This one might be a bit tricky to achieve. But with my current project i have to use a 3D camera for the panel transitions im using. But i can be a bit tricky to get all the elements pixel perfect when they are not animated.
Perhaps you could scale anchors based on their distance from the camera. So child objects of the anchor will be pixel perfect when in the same Z plane as the anchor.

  • Mesh based font rendering
By this i mean that you could use meshes rather than bitmaps to draw text. A bit like what something like RageSpline does.
This would be rather massive thing to implement so i guess this is more like a "sometime down the line" request.
« Last Edit: June 27, 2012, 10:11:08 AM by Mattivc »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: My NGUI suggestions.
« Reply #1 on: June 27, 2012, 10:32:57 AM »
In regards to the "bug": if you have a mobile platform targeted (iOS/Android), then your atlas size is limited by Unity's texture size limit -- which is 2k by 2k. Nothing I can do about that.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: My NGUI suggestions.
« Reply #2 on: June 27, 2012, 10:43:40 AM »
Tilable sliced sprite -- this was asked a while ago, and I tried implementing it, but stopped when I couldn't figure out a good way of actually using the thing. I put it on hold "to be revisited later". Generally if I can't figure out a way of doing something elegantly, I put it off until I do.

Progress bar... might be doable.

Anchor chooses its camera based on layers... the fact that it chooses the wrong one suggests that your game camera is able to see your UI layer -- which is a problem you should fix.

Pixel-perfect using a 3D camera simply isn't possible (or at least my math-fu skills aren't uber enough). By definition of perspective projection, things that get moved closer to the camera become bigger on the screen. Things that are farther away become smaller. Pixel perfection only works when 1 pixel of the window is 1 pixel on the screen, and that's only achievable via an orthographic projection camera.

Mesh based rendering? That just screams "insane triangle count" to me. Plus where would this mesh data come from? This is unlikely to happen.

JRoch

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 140
    • View Profile
Re: My NGUI suggestions.
« Reply #3 on: June 27, 2012, 11:24:34 AM »
By this comment "I tried implementing it, but stopped when I couldn't figure out a good way of actually using the thing" do you mean that you couldn't think of a way to use it in a UI, or that you couldn't think of a way to implement it in NGUI?  Because I have several UI elements that I'd like to use it for right now... specifically themed tabs that have a texture to the center fill that gets stretched out of wonk if I don't create reasonably close-sized versions for a given width.

However, if it's just that you can't figure out how to implement it in NGUI, then I'm sure it's a harder problem than it seems.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: My NGUI suggestions.
« Reply #4 on: June 27, 2012, 11:30:43 AM »
Couldn't think of a way to use it in the UI without making it too complicated. You can achieve the same effect by using several tiled sprites, with regular sprites for the corners.

JRoch

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 140
    • View Profile
Re: My NGUI suggestions.
« Reply #5 on: June 27, 2012, 02:11:28 PM »
Ah, yes... it would simply be some extra hand-holding in the compositing of elements that can be accomplished fairly easily by hand.  Granted, it does take some extra bookkeeping, as replicating the behavior of a slicedsprite with borders on all four edges means four corner sprites and five tiled sprites for the edges and center.

After thinking about it for a few minutes, I still think it would be helpful.  Ease of use of the NGUI framework is a major selling point, and a tiled center/edge sliced sprite would make some types of UI elements less of a time-sink to construct.

So still a +1 request from me!  :)

n8

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 23
    • View Profile
Re: My NGUI suggestions.
« Reply #6 on: June 28, 2012, 06:57:15 PM »
+1 for the sliced tiled sprite.  I was trying to figure out how to build my sprites to do this, but never thought to use more than one. I would like the ease of ngui applied here.

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: My NGUI suggestions.
« Reply #7 on: July 19, 2012, 10:43:28 AM »
+1 for Better Label Control !

"Especially the ability to set character spacing. I know i can set this on the font prefab. But i see no reason why you shouldn't be able to set this individually on each UILabel"

YourUncleBob

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: My NGUI suggestions.
« Reply #8 on: August 22, 2012, 10:41:36 PM »
I put together a sliced/tiled sprite using the slicedsprite code as a starting point. It works really well, though you need to be sure that the center portion of your art tiles correctly. It hasn't been extensively tested, but it works in all the cases I've tried so far.
  • Corners are unstretched
  • Top and bottom tile horizontally
  • Left and right tile vertically
  • Center tiles both ways
  • Tiles to the nearest full tile, so you'll get some pixel stretching if your height or width aren't exact tile multiples

There's no sanity checking in this. If the center of your texture is small, the routine is going to end up creating a lot of polys.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: My NGUI suggestions.
« Reply #9 on: August 22, 2012, 11:19:11 PM »
Thanks for sharing!

Ardor

  • Guest
Re: My NGUI suggestions.
« Reply #10 on: October 10, 2012, 08:55:58 PM »
@YourUncleBob very nice and useful script. Saved me a couple of hrs for sure. Just needed some little fixes for current version 2.2.2 ... Added the "Fill Check" functionality as well. I really wish to see it in next release so I don't need to adjust Widget Wizard and Inspectors again ;)   

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: My NGUI suggestions.
« Reply #11 on: October 11, 2012, 04:32:18 AM »
How many triangles is that window? Looking at it, I'm estimating... a ton.

Ardor

  • Guest
Re: My NGUI suggestions.
« Reply #12 on: October 11, 2012, 03:17:25 PM »
For sure it has some more Tris than SlicedSprite but as it works same like TiledSprite it has almost same amount like that... and without FillCenter and a normal Sprite as background you can save all those in center if u want.

I put together a lill screenshot all with same Sprite Texture

N3uRo

  • Guest
Re: My NGUI suggestions.
« Reply #13 on: October 12, 2012, 11:52:04 AM »
I have one more suggestion.

Components extensibility please!! You have so many scripts and they mostly are private so we can't extend from that classes and override methods (or use a member variable) to add functionality.

We have some new components developed for our projects and they are a simply duplicate code of your components adding more functionality. This is not easily to mantain because in each NGUI update we have to check if you have changed something in that components to update them.

We also released on the asset store a W7 multitouch solution (sorry for the spam) and we had to make a patch to replace the accessibility on some of your UICamera methods.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: My NGUI suggestions.
« Reply #14 on: October 13, 2012, 08:38:53 AM »
Just tell me what you need exposed and how (protected/public). Protected is simple. Public... I am generally hesitant about.