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.


Topics - indiefreaks

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

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.

2
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));
  5.  

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.... ;)

Thanks

3
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.

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

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:

UIRoot
--- 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,

Philippe

5
Hi,

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.

Cheers,

Philippe

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

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?

Thanks

Philippe

7
NGUI 3 Support / UIInput gameobjects do not receive OnKey event
« on: February 12, 2013, 07:45:46 AM »
Hi,

I noticed that UIInput gameobjects don't receive OnKey events when the focus is set on them preventing us from using ButtonKeyBindings to create forms which support keyboard tab and shift-tab navigation.

I wondered if there was a specific reason for this?

Until I get your response, I commented out the inputHasFocus boolean test in UICamera.Update() method which fires or not the ProcessOthers() method in which the OnKey event is raised by your system. ('til now, it doesn't seem to have any side effect).

Thanks

8
NGUI 3 Support / [Feature request] Password Char on UIInput (code included)
« on: February 12, 2013, 06:55:22 AM »
Hi,

Since you provide a "Is Password" property on UIInput to handle password cases, I thought it would finalize the feature to add the ability to specify the character to use instead of forcing the char to '*'.
That's a really small feature request and it's also atomic enought to bring issues implementing it.

I've already made the change on my side yet I'd like to avoid that being removed every time I update my NGUI package to get all the neat additional features and bug fixes.

So here is the code I implemented myself which seems to be compliant with your approach. (Please, consider adding this ;))

In NGUI/Scripts/UI/UIInput.cs:
@line 54 right after caratChar field.

  1. [...]
  2.         /// <summary>
  3.         /// Visual carat character appended to the end of the text when typing.
  4.         /// </summary>
  5.  
  6.         public string caratChar = "|";
  7.  
  8.         /// <summary>
  9.         /// Character used to replace the text when isPassword is set to true.
  10.         /// </summary>
  11.  
  12.         public string passwordChar = "*";
  13.  
  14.         /// <summary>
  15.         /// Delegate used for validation.
  16.         /// </summary>
  17.  
  18.         public Validator validator;
  19. [...]
  20.  

@line 248, replace the existing code with this line:
  1.         if (isPassword) label.password = true; label.passwordChar = passwordChar;
  2.  

Then, we replace @line 448 in the UpdateLabel() method:

  1. [...]
  2.  
  3.         // Start with the text and append the IME composition and carat chars
  4.         string processed;
  5.         if (isPassword && selected)
  6.         {
  7.                 processed = "";
  8.                 for (int i = 0, imax = mText.Length; i < imax; ++i) processed += passwordChar;
  9.                 processed += Input.compositionString + caratChar;
  10.         }
  11.         else processed = selected ? (mText + Input.compositionString + caratChar) : mText;
  12. [...]
  13.  

Now, we need to change a few more lines in NGUI/Scripts/UI/UILabel.cs

@line 26, we add the following new field:

  1.         [HideInInspector][SerializeField] string mPasswordChar = "*";
  2.  

And @line 276, right after the password property, we add this new one:

  1.  
  2.     /// <summary>
  3.     /// The character to use to hide label content when password is set
  4.     /// </summary>
  5.  
  6.         public string passwordChar
  7.         {
  8.                 get { return mPasswordChar; }
  9.                 set
  10.                 {
  11.                         mPasswordChar = value;
  12.                         hasChanged = true;
  13.                 }
  14.         }
  15.  
  16.  

And finally, replace the previously static "*" occurrences by the mPasswordChar field value in ProcessText() method:
@line 472
  1.         for (int i = 0, imax = mProcessedText.Length - 1; i < imax; ++i) hidden += mPasswordChar;
  2.  

And finally @line 477
  1.         for (int i = 0, imax = mProcessedText.Length; i < imax; ++i) hidden += mPasswordChar;
  2.  

9
NGUI 3 Support / Capturing "tabulation" input
« on: January 03, 2013, 12:58:51 PM »
Hi,

I've been looking around and couldn't find a way to achieve this up to the point where I had to ask the question directly.

Could anyone tell me how I can detect if the "tab" key was pressed on a UI component? I'd like to toggle the next control in the a form when hit.

Thanks

Pages: [1]