Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - indiefreaks

Pages: [1] 2
NGUI 3 Support / [Feature Request] Anchor absolute field computation
« on: July 11, 2014, 08:00:03 AM »

I've found myself looking for a small yet very useful feature to the current Anchor system.
When working precisely with the way one would want to position its widgets in the screen, I thought it would be really cool if we could, within the custom Anchor inspector, type a small computation and see its result applied at the end.
What I'd like to be able to achieve would be placing the focus on, say, the left anchor absolute field and type something like "32 + 256" and when hitting "Return" have the result of the maths applied to the field (in this case "288").

That's not something that I see as a priority but when dealing with absolute widget placement, it can become handy to do so... ;)

Obviously, being able to support additions, soustractions, products and divisions would be just perfect ;)

Thanks for considering this feature request.

NGUI 3 Support / Modify caret size
« on: February 08, 2014, 08:51:26 PM »
I'm already pleased with the improvements made to the UIInput class yet I could see one simple addition:
Being able to choose the size of the caret.

Right now, I see that you're using a quick geometry made of verts to render caret and highlights:
  1. caret.Add(new Vector3(x - 1f, -y - fs));
  2. caret.Add(new Vector3(x - 1f, -y));
  3. caret.Add(new Vector3(x + 1f, -y));
  4. caret.Add(new Vector3(x + 1f, -y - fs));

I saw these lines multiple times in the NGUIText class PrintCaretAndSelection method.

I'd like to tweek that a little bit so that I could render a "squarer" or larger caret than the pipe you're currently mimicing.

Any idea how I should do it?

I tried modifying the -1f and +1f to slightly bigger numbers but I just don't want to break it all and my trials fail aligning miserably the caret with the rest of the text.... ;)


NGUI 3 Support / Re: (!!!) Improving NGUI: Voice your opinion
« on: January 08, 2014, 07:12:32 PM »
Your anchor system works like a charm yet most of the time, you organize controls filling the space of the container being a window, a panel or whatever you might think of.
Thus, I feel easier to have at the container level an inspector that lets me tweak child UIWidgets' anchors seeing all of them.

I for instance am making a tile based UI using some sort of custom page system which gives you this current result (yet to be improved):

In order to organize my tiles for each page, I made a custom inspector that mimics (not totally) your UIRectEditor code looking for all the page tiles children and rendering in the Inspector the anchors. I can then adjust in the same place all the anchors for all these sub widgets in one single place without having to move my mouse from the Hierarchy window to the Inspector window then back to the Hierarchy window to select another one, and so on...

You made some great misknown tools in the NGUIEditorTools which I even use on my custom Monobehaviours. I even believe a video dedicated to developers willing to extend NGUI for their own purpose would be great ;)

If you're not up to fulfill this request, I'll be fine, I made my way through my custom anchor inspector and even if it doesn't has all the features you provide with, it serves my current purpose ;)

NGUI 3 Support / Re: (!!!) Improving NGUI: Voice your opinion
« on: January 08, 2014, 10:06:29 AM »
I'm a real fan of your NGUIEditorTools helper methods as they help me a lot making my own custom widget and UI component inspectors. (NGUIEditorTools.DrawEvents() ftw ;) ).

Unless I missed it in your code, I didn't find any helper method to draw Anchors as you do in the UIRectEditor class.
It would be great if you could put that into an helper method so we could use them.

NGUI 3 Support / Gradient outline on UILabels
« on: December 28, 2013, 04:28:58 PM »
I have a common design request for my game where the text should get a gradient outline to give it some glowing effect.

I'm looking for options here... Anyone? ;)

I know I could go for custom bitmap font and a custom script to change the UIFont used at runtime but I'd like to see all the options available including custom shaders.

Thanks by advance for any tip.

NGUI 3 Documentation / Re: UIInput
« on: December 15, 2013, 07:14:24 PM »
Would love to see some Pro tips about custom validation on a per UIInput field basis ;)


Thanks Aren,

I had the Dx11 renderer set on Unity3D.

However, while I was pretty sure my game window dimensions were even, I double checked it and they weren't so this ain't a bug but a misusage on my side.

Thanks for the support.

Hi again,

I noticed I was still getting the half pixel issue even if I'm running on a DirectX 11 video card.
I saw in the UIDrawCall class that you make a check on the SystemInfo.graphicsShaderLevel < 40 and if so, removes the half pixel fix on panels.

When I comment out this line in my own NGUI installation, I get back crisp results.
Is it a bug specific to my machine or else?

Here is my current setup:
Intel I7-3615QM
4 Gb RAM
nVidia GeForce GT 650M (DirectX 11)
Windows 8.1 64bits

Best regards,


NGUI 3 Support / Re: UIPanel and Resizing windows
« on: December 11, 2013, 04:10:30 AM »
I wanted the Window to be a UIPanel so that I would directly get the scroll view feature as a root feature of the gameobject.

Yet your recommendation on inheriting from UIWidget seems to be the way to go and just add a UIPanel to its children.

I believe a good tutorial video for you to make and thus spare some time would be your recommendation on how to create a custom control from scratch such as a window or a tabs panel or whatever else. How would you structure your gameobjects and related scripts would help a lot of devs trying to get the most out of your already great add-on to Unity.

Thanks Aren. It makes total sense.

The "not" centered pivot just made the trick.

NGUI 3 Support / UIPanel and Resizing windows
« on: December 10, 2013, 09:20:07 PM »

I'm moving from NGUI 2.x to 3.x and I want to make use of the library on the way it is supposed to be used.

With the recent changes, especially the anchoring system, I revamped my previous Window class design so that I could use its greatness to manage user resize by dragging the window corner as you would do with any window system.

Yet I'm unsure how to do so.

Basically, my current attempt is the following:

I created a hierarchy like so:

--- Camera
--- Window (uses UIPanel with clipping set to Alpha clipping)
------- Background (uses simple UISprite 32*32 white texture set to a black color in the inspector with half alpha)
------- Border (uses the same UISprite using Sliced version without the fill center and using a white color)
------- Title (uses UILabel)
------- Handle (uses a simple UISprite, a BoxCollider and a custom script reacting to OnPressed for now: I'll implement the OnDrag later on)

The Background and Border uses a Unified anchor using the Window as the anchored target and a fills the UIPanel clipping (verified to use the same size which is great).
The Handle uses the same target for the anchor but is anchored on the bottom right.

Now, what would you recommend me to change so that when I drag the handle, the whole window gets resized?

I tried to find a way to change the clipping region but all the public properties state that we shouldn't use the "set" property to change the clipping and use the clipOffset instead but this doesn't allow me to change the size of the actual clipped region.

I also tried to change the scale value of the transform but it breaks the uniform rule required for the clipping to work properly (by the way, it's great to see the warning in the inspector directly).

I would like to be sure that I'm taking the right direction as I mentionned earlier and I would be pretty disappointed if I would have to step back and simply make a reference to the Background and Border UISprites and update their width and height how I used to do with NGUI 2.x.

Thanks for all the help and advices you could come up with ;)
Best regards,



I migrated to 3.0.7 and thus removed all my "legacy" anchors to the new system which is great by the way.

However, I noticed that some of my previous pixel perfect borders (using sliced sprites without filling the center) are now a bit blurred. I believe (this is only by memory) that this was fixed by ticking the Anchor class "half pixel" checkbox.
Yet this is not available anymore and I therefore wondered if this was automatically detected and corrected by NGUI or if there would be something for me to do to get that working nicely.

If it is automatically managed by NGUI now, I'd suspect a bug in my case which I would be glad to report with some more details if required.



NGUI 3 Support / Re: (!!!) Improving NGUI: Voice your opinion
« on: November 21, 2013, 12:43:47 PM »
Sprite base collider/trigger : Sometimes, you want to be creative with your UI and you want to create some funky buttons. I'd love to be able to create an optimized polygon shape based on the background sprite to test for the great NGUI event system.
Oh... and it could be generated on the fly :p

Most useful for dynamic radial menus for instance instead of making a custom raycast on the whole menu, you could just have a single pie section generated depending on the number of items presented in the menu.

NGUI 3 Support / Re: (!!!) Improving NGUI: Voice your opinion
« on: November 18, 2013, 05:51:34 PM »
Hi Aren,

I read all the threads and I really appreciate most of the feature and improvement requests posted by other devs here.

Something that I'd love to see as part of NGUI is a dedicated tool where my UI hierarchy would have its own Unity Editor Window that wouldn't mix up with my game scene.
I'd like to be able to tweak my UI without having to navigate through the entire UIRoot, UICameras, Panels and so forth...
A simple NGUI Hierarchy Window with all my UI stuff there that I can click and operate directly.

As a nice to have and I can hardly see that being made for this major release, I would also love to see a design decision made on the way that you recommend using NGUI: Weither it's a simple Model-View, a MVC or MVVM recommended structure, I believe this could help developers understanding how they can get the most of NGUI.

Just my 2 cents as I'm already sold on NGUI for my current needs ;)


NGUI 3 Support / Best approach for scrollable popup list
« on: February 13, 2013, 09:57:22 AM »

I'm looking for advices on the approach I should take to create a popup list that would display its items using a scrollable panel.

I'm trying to create a date control composed of 3 Popup lists that would ease setting the date (one for days, months and years) but as you'd probably guess, the 31 days popup list is way too big to be displayed in the screen (unless I scale down the items text but that's not a desirable solution).

Seems like my only option would be to tweak UIPopupList code to create a panel as a child in which all items would reside and implement it so that it clips its boundaries and display a scollbar if the total items height gets bigger than its own height.

Am I right or is there an easier approach that I wouldn't have thought of?



Pages: [1] 2