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 - Yukichu

Pages: 1 2 [3] 4 5 ... 7
31
NGUI 3 Support / UIPopup List Offcenter and Always First Selection
« on: May 31, 2014, 10:47:25 PM »
Made a UIPopupList, and I populate it dynamically depending on what's happening.  Figured it out.

However, two things I ended up modifying and thought would be nice...

The default drop-down list for selecting which item, options for first, or last, would be great, as my list is empty when it's created. My hacky fix was to just make the first one highlighted always.  It works, but an option for first/last would be great.

Second thing was the popup list is always to right of the mouse when clicked.  I didn't really want to use an anchor and not even sure it'd work since the popup list is appearing all over the screen at different times; however, perhaps a value for 'offset' of the mouse click?  Stuff on the far right of the screen gets cut off if my text is too long, so I just offset the bounds by -20X early on.

t.localPosition = new Vector3(bounds.min.x - 20, bounds.min.y, bounds.min.z);

An actual offset value would be awesome, because you could change it via code depending on the max length of a string in the popup, etc. 

Nothing major, but these would be helpful.  Thanks.

32
NGUI 3 Support / Re: 2D vs. 3D Colliders
« on: May 28, 2014, 01:34:28 PM »
Stacking colliders...  well, I guess I'll find out now I know I can switch back and forth as needed.

Example:  button within a button.  2D colliders are 'flat' and use the same Z, regardless of what you try to set them to.  I presume it can figure this out.  I'll just go test and find out, thanks.

33
NGUI 3 Support / 2D vs. 3D Colliders
« on: May 27, 2014, 09:54:22 AM »
What are the benefits / drawbacks of using 2D vs. 3D Colliders?

2D Colliders
- Faster I presume
- ???

Are you able to 'stack' colliders... probably not efficiently at least, as in have one collider 'on top' of another collider.  I know the 3D colliders you could adjust the z position, or so I thought at one point, to order which one would be 'on top'.  I presume 2D colliders won't do that.

If I change my project to 2D colliders, and I find out everything is a fail, can I easily just switch back to 3D colliders?

34
NGUI 3 Support / Re: Benefits of Unity Sprites vs. NGUI Sprites
« on: May 21, 2014, 09:56:32 AM »
Makes perfect sense, it's what I thought but just wanted to confirm this.

Thanks!

35
NGUI 3 Support / Benefits of Unity Sprites vs. NGUI Sprites
« on: May 20, 2014, 10:12:35 AM »
I started watching the videos on NGUI 3.6 on youtube (excellent so far) and there was a large bit about using Unity Sprites instead of NGUI Sprites, and how you could almost get the same draw calls and how to use the automatic atlas builder, etc.

So, I am wondering... what are the benefits of using Unity Sprites with NGUI Widgets?
Are they faster?
They don't seem to be less complex as you stated in the vid the draw calls would be harder to get down to the same with NGUI.
Do they use less triangles or something?
Handles in memory better or some such thing?
Is the atlas builder better, more efficient, handles larger sprite sheets more reliably... or something?
Do they consume less memory?
Anything else?
Will this 'ease' the transition over to Unity GUI?

I like the idea of options.  Is there a good reason why I shouldn't change all my NGUI Sprites over to Unity Sprites, besides that it'd take a bunch of time?

36
NGUI 3 Support / Re: UIInput Caret Manipulation
« on: May 14, 2014, 03:02:55 PM »
ArenMook, you are awesome.  You are like a support genius. 

I am convinced you've cloned yourself so one of your clones can just reply to forum posts.

Anyhow, it's fixed.  I was checking Input.OnKeyUp instead of Input.OnKeyDown ...  so the uiInput must've been capturing the key inputs on key down and not up, so you are very correct... I do not have to actually set the character explicitly in the code.  It just shows up on its own.

Very simple.  I was completely overdoing it.

Thank you again.

37
NGUI 3 Support / Re: UIInput Caret Manipulation
« on: May 14, 2014, 07:10:26 AM »
I'll mess with it some more, I think I understand (or at least have some new ideas.)

38
NGUI 3 Support / Re: UIInput Caret Manipulation
« on: May 14, 2014, 07:08:29 AM »
Posted an edit above, man you're quick.

39
NGUI 3 Support / Re: UIInput Caret Manipulation
« on: May 14, 2014, 07:02:29 AM »
The letter shows up fine, but it's highlighted is the issue... so if you type anything else immediately after, it will overwrite the letter/character provided.

The idea / goal is:

version 1 - works fine
You're playing the game.  The chat input is completely hidden.
You hit enter.
Chat input appears, cursor blinking, ready for input.

version 2
You're playing game.  The chat input is completely hidden.
You hit slash, as all commands are IRC-esque and begin with a slash.
Chat input appears, slash is first character, cursor is at position after slash, slash obviously is not highlighted.  Ready for additional input.

So, the uiInput doesn't have focus yet when the slash is processed, it's being used outside of the uiInput to:
activate disabled uiInput
add slash to uiInput
move caret to position 1, past slash character
put focus on uiInput

The character is highlighted is the problem (sorry if I'm redundant a lot).

I'll mess around with it some more.

40
NGUI 3 Support / UIInput Caret Manipulation
« on: May 13, 2014, 02:21:10 PM »
I've spent way too much time on this, so I finally am resorting to the forums.   I did try to resolve this myself first :p

I have a UIInput that is disabled.  When a user pressed the enter key, it enabled the UIInput and associated widget for adding text.  Works fine.

I would like to be able to press a different key, have the UIInput be enabled, and that key already be in the input field.  Sounds simple.  I would like this character to not be highlighted, because that's what happens every time at the moment.  If it's highlighted, the next character you type just deletes it, and well, it's like it was never there.

Here's what I've been trying, in various forms.  I looked at what pressing the right/left arrow keys do, and I fail to see the magic of what I'm missing.  Assistance would be appreciated.

  1. else if (!inputChat.gameObject.activeSelf && Input.GetKeyUp(KeyCode.Slash))
  2.             {
  3.                 inputChat.gameObject.SetActive(true);
  4.                 inputChat.isSelected = true;
  5.                 inputChat.value = "/";
  6.                 inputChat.cursorPosition = 1;
  7.                 inputChat.selectionStart = 1;
  8.                 inputChat.selectionEnd = 1;
  9.                 inputChat.UpdateLabel();
  10.             }

So I've tried different order of what's above, messing around with it... and well, enough trial and error, here I am at the forums.  Like I said, it works fine except the character is highlighted when it's added.

Thanks,
Alex

41
NGUI 3 Support / UIInput.cs ProcessEvent
« on: May 13, 2014, 12:59:37 PM »
Please make UIInput.cs method ProcessEvent protected virtual

I love having my own ProcessEvent to use.

Thanks!

42
NGUI 3 Support / Re: NGUI in 3D coordinates
« on: May 01, 2014, 09:42:16 AM »
Adjust the Y coordinate relative to the player (or Z, or X, or whatever depending on your setup), either before or after you transform the position from world to camera or whatever.

43
NGUI 3 Support / Re: Will NGUI support Save & Load in GUI area?
« on: April 30, 2014, 10:16:45 AM »
Uh, the GUI is just the front end.  It isn't tied into the UnitySerializer other than issuing a command when you push a button.

You'll have to build your own.  Just look at what functionality pushing a unity gui button does, and have that same functionality happen when you push a NGUI button.

Maybe once you do build it, offer it on the asset store for free so others can use it. 

44
I do it with a poolmanager.

I made a generic 'displayObject' nGUI prefab that has a name and a health bar.

Create pool of them.  Assign as needed for specific character, create a reference for it, update as needed.

Works wonderfully.

When player leaves, put displayObject back into pool.

45
NGUI 3 Support / Re: ToString max 6 number :(
« on: March 22, 2014, 01:23:26 PM »
A float has 6-7 significant digits.

http://msdn.microsoft.com/en-us/library/hd7199ke.aspx

Pages: 1 2 [3] 4 5 ... 7