Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Mattivc on June 27, 2012, 09:50:45 AM

Title: My NGUI suggestions.
Post by: Mattivc 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.

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.

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.

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.

Sometime it can take a while, some progress feedback would be nice.

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.

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.

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.
Title: Re: My NGUI suggestions.
Post by: ArenMook 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.
Title: Re: My NGUI suggestions.
Post by: ArenMook 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.
Title: Re: My NGUI suggestions.
Post by: JRoch 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.
Title: Re: My NGUI suggestions.
Post by: ArenMook 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.
Title: Re: My NGUI suggestions.
Post by: JRoch 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!  :)
Title: Re: My NGUI suggestions.
Post by: n8 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.
Title: Re: My NGUI suggestions.
Post by: nah0y 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"
Title: Re: My NGUI suggestions.
Post by: YourUncleBob 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.

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.
Title: Re: My NGUI suggestions.
Post by: ArenMook on August 22, 2012, 11:19:11 PM
Thanks for sharing!
Title: Re: My NGUI suggestions.
Post by: Ardor 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 ;)   
Title: Re: My NGUI suggestions.
Post by: ArenMook on October 11, 2012, 04:32:18 AM
How many triangles is that window? Looking at it, I'm estimating... a ton.
Title: Re: My NGUI suggestions.
Post by: Ardor 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
(http://public.unim.de/ngui/Bildschirmfoto%202012-10-11.png)
Title: Re: My NGUI suggestions.
Post by: N3uRo 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 (http://u3d.as/content/virtualware/w7multitouch-with-ngui-integration-/3p7) (sorry for the spam) and we had to make a patch to replace the accessibility on some of your UICamera methods.
Title: Re: My NGUI suggestions.
Post by: ArenMook 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.
Title: Re: My NGUI suggestions.
Post by: Grhyll on October 26, 2012, 09:19:46 AM
Quote
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.
This would interest me as well! Especially the part about controlling each character individually, even if I guess it's not the easiest one...

One thing that could also be useful on those UILabel would be to be able to get their size (the size of the total label, instead of the scale of the font).
Title: Re: My NGUI suggestions.
Post by: ShinyMark on March 28, 2013, 11:47:31 AM
Attached is a quick and dirty port of SlicedTiledSprite to NGUI 2.5.0c / Unity 4.1. I moved the functionality into UISprite.cs to match the recent Sprite refactor.

I had to change how spritePixels and texPixels were calculated in SlicedTiledFill() to function correctly with our setup. To be honest, I don't know why I had to make the change to that code and I don't have time to research why.

I hope this is helpful for someone.

-Mark / shinyshoe.com
Title: Re: My NGUI suggestions.
Post by: PabloAM on March 28, 2013, 11:52:16 AM
Attached is a quick and dirty port of SlicedTiledSprite to NGUI 2.5.0c / Unity 4.1. I moved the functionality into UISprite.cs to match the recent Sprite refactor.

I had to change how spritePixels and texPixels were calculated in SlicedTiledFill() to function correctly with our setup. To be honest, I don't know why I had to make the change to that code and I don't have time to research why.

I hope this is helpful for someone.

-Mark / shinyshoe.com


Just added to my proyect and works perfect!
I hope this going to be added to the next version :)
Title: Re: My NGUI suggestions.
Post by: Nicki on March 30, 2013, 08:21:26 AM
Cool! I've been faking these by having two sprites (one sliced and one tiled, where the sliced doesn't fill center and the tiled doesn't draw the edges).

Attached is a quick and dirty port of SlicedTiledSprite to NGUI 2.5.0c / Unity 4.1. I moved the functionality into UISprite.cs to match the recent Sprite refactor.

I had to change how spritePixels and texPixels were calculated in SlicedTiledFill() to function correctly with our setup. To be honest, I don't know why I had to make the change to that code and I don't have time to research why.

I hope this is helpful for someone.

-Mark / shinyshoe.com
Title: Re: My NGUI suggestions.
Post by: apparition on June 27, 2013, 03:49:24 PM
Thank you YourUncleBob and ShinyMark for sharing this script!  This is exactly what I was looking for.
Title: Re: My NGUI suggestions.
Post by: knifesk on July 18, 2013, 12:16:51 PM
this is not working with NGUI 2.6.3 :(
Title: Re: My NGUI suggestions.
Post by: Malzbier on July 19, 2013, 02:34:15 AM
Thanks for sharing ShinyMark, but did you read the head of the file you posted?

  1. //----------------------------------------------
  2. //            NGUI: Next-Gen UI kit
  3. // Copyright © 2011-2012 Tasharen Entertainment
  4. //----------------------------------------------

You are not allowed to distribute NGUI code.

You could send it to the NGUI Author or publish a diff file.
Title: Re: My NGUI suggestions.
Post by: ArenMook on July 19, 2013, 04:41:20 AM
In this case it's just one file, so I don't mind.
Title: Re: My NGUI suggestions.
Post by: jamespaxi on August 03, 2013, 09:51:10 AM
Thanks immensely for sharing the Tiled Sprite workaround! :)

But is this still the way to go for Sliced-Tiled sprites? Replacing the UISprite class?
Title: Re: My NGUI suggestions.
Post by: broken on October 24, 2013, 11:01:58 AM
How many triangles is that window? Looking at it, I'm estimating... a ton.

Aren, what is the normal amount of Triangles in order to make a tiled background is (for UI)?
Title: Re: My NGUI suggestions.
Post by: ArenMook on October 24, 2013, 11:48:22 PM
There is no "normal". The less the better, but also big textures waste a lot of space. 100x100 would be my suggestion.
Title: Re: My NGUI suggestions.
Post by: broken on October 25, 2013, 01:28:10 AM
There is no "normal". The less the better, but also big textures waste a lot of space. 100x100 would be my suggestion.

Ok, thank you.
In the near future you plan to add SlicedTiledSprite to the core NGUI?
Title: Re: My NGUI suggestions.
Post by: broken on October 27, 2013, 12:42:32 PM
Release notes NGUI 3.0.3:
Quote
- NEW: UIInput has been redone, and now supports moving the caret as well as copy/paste keys in the editor.

Movement of the caret is only available for the editor? I thought it would be and in the component and happy, and it appears not. Not seeing the caret is not very convenient to write the text, for example if I wanted to go back to some part of the line but I can not see exactly where the caret :( I think this functionality must be in a box NGUI (not additional asset from store) :(
Title: Re: My NGUI suggestions.
Post by: ArenMook on October 27, 2013, 10:48:12 PM
Everywhere, not just the editor. Previously copy/paste didn't work in the editor, now it does. Caret wasn't movable before, now it is.
Title: Re: My NGUI suggestions.
Post by: broken on October 28, 2013, 12:08:38 AM
Everywhere, not just the editor. Previously copy/paste didn't work in the editor, now it does. Caret wasn't movable before, now it is.

Repeatedly updated and now I see, yeah, I'm sorry.
But without caret blinking and mouse click caret positioning?
Title: Re: My NGUI suggestions.
Post by: skullthug on November 05, 2013, 09:18:50 PM
Oh man, can this please get added to NGUI officially already?
Title: Re: My NGUI suggestions.
Post by: ArenMook on November 06, 2013, 08:21:51 AM
It was added weeks ago. Caret blinking and click positioning as well as text selection is coming in a future update, likely 3.0.5.
Title: Re: My NGUI suggestions.
Post by: skullthug on November 07, 2013, 12:36:47 AM
Great, thank you!
Title: Re: My NGUI suggestions.
Post by: Romano on December 03, 2013, 02:27:19 AM
this is not working with NGUI 3.0.5
Title: Re: My NGUI suggestions.
Post by: Yukichu on December 03, 2013, 05:52:43 AM
It's not working because it was _not_ included in 3.0.5.  It wasn't in the release notes.

edit:  I forgot the word 'not', sorry, it was 5am.

Title: Re: My NGUI suggestions.
Post by: Romano on December 03, 2013, 06:11:36 AM
And how to use it there? Tiled and slice does not work as well
Title: Re: My NGUI suggestions.
Post by: armitage1982 on December 07, 2013, 04:18:05 PM
Do you have any status for the Text Selection feature or if it's still planned ?

Thanks (and sorry if it's redundant  ;) )
Title: Re: My NGUI suggestions.
Post by: ArenMook on December 07, 2013, 04:21:31 PM
ETA -- Unless something super critical comes along, Pro repository within 2 weeks.