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

Pages: [1] 2
1
Great, that'll save me lots of frustration :)

2
Thanks for the quick reply. None of these are killer items obviously, just posting 'em up as items I think would improve the workflow.

1) Locking the inspector is an option, yep, but gets tedious to do all the time.

2) Hmm, maybe "counts as left click" was incorrect, that was an assumption. It does perform a "select" action, or something similar though. An important factor is this only happens when multiple NGUI objects are selected. Were you able to test with that in mind?

3) Odd- if the click is intercepted by the proper object (which it is), it seems to me the "CTRL" or "SHIFT" modifier is somehow being lost. The issue isn't that the wrong item is being selected, or failing to select, it is that the clicked object becomes the only selected object, instead of being added to the selection.

4) Cool, thanks.

Hopefully those clear things up a bit?

3
Jumping back into some GUI work and running across several issues, figured might as well drop them all in one, if that is alright. Attached GIFs for a few of them, to make it better explained.

>Clicking eyedropper on area to get color, also performs actual click, losing selection


>Using middle-click to pan, if a GUI item is selected, when the middle-click is released it counts as a left click and selection is lost


>Holding "CTRL" or "SHIFT" to select multiple items often does not work, unless zoomed in fairly close, the click only selects the object and does not add to selection


>With multiple objects selected (simple sprites, in my case), "Right-Click > Attach" menu is relative only to last-selected object


>With multiple objects selected, keyboard shortcuts only affect last selected object (ie, Alt-Shift-C to add box collider)

>With multiple objects selected, clicking on the Unity frame loses selection

4
NGUI 3 Documentation / Re: UIButton
« on: April 06, 2014, 07:51:33 PM »
So, the click can still call a function, and (I don't precisely remember how this was done), pass the button object as a parameter, right? If I use the "UIEvent..." option, that is. Could I be reminded of how to get that object?

Any way to also pass through some value, which would be set (theoretically) on the button via inspector?

For example, a I have a big scrolly list of "map" thumbnails. I click on a map, that click needs to tell a "manager" script to swap the game to that map, base on what was clicked. I'd love to just pass an int, use it as an index in my maps array, etc.

Just being able to pass the Button Object itself will be workable, though :)

Thanks!

5
Currently working through the tutorial here: http://www.youtube.com/watch?v=cTjy-L8C6WM

I have been extremely careful to do everything exactly as the tutorial does. However, when I run the server I get:
  1. "UPnP: unable to open UDP port"

Here is the full screenshot:



Any thoughts on what might be going wrong? Thanks!
gw

6
Maybe just to make that more clear:

My UI tree goes like this
-UI Root (2D)
   -Camera
      -StartScreen
         -Anchor_Bottom
             -visuals/btns/etc
         -Anchor_Top
             -visuals/btns/etc
         -Anchor_Right
             -visuals/btns/etc
       -SettingsScreen
          -More anchors, etc
      -And so forth...

I have a feeling this is fairly standard, what I'm trying to do, but am not seeing the method...I'd just like to move around the top level panels (ie, "StartScreen" or "Settings")

7
This is changing topics somewhat, but I'll just continue here-

I went your way, and just made one big GUI, with the panels swapping when switching to a different "screen". So I'm turning the panels on/off, however the buttons/etc in each panel naturally still remain active.

I figured I could simply move the non-active panels away, but they all have at least a couple anchors inside them, then all the elements, so I am unable to move them at all. What is the best way around this? Turning the anchor scripts on/off when moving? That seems likely to cause trouble, and would be a lot of anchors as well. Seems like there must be a better way :)

8
So, just disable each UIPanel, then enable upon start? Just making sure I understand properly. Thanks much!

9
The issue is, the very fast scaling/sliding effect that happens just as the scene swaps, and the new ui appears. The effect isn't intentional :P

The root of the cause is that the UIRoot manual height is set to "640" (for iOS handheld), in every scene. Then, in the "Awake" function of a script in the scene, I check the screen height of the device, and set to 1024 if needed (iPad).

So, it works just fine for iPhone/etc, but on the iPad it does a that funky/unwanted quick-scale right on load. Maybe I'm just using the system wrong, but it seems there ought to be a way around this?

10
Thanks, I tried this, but still having the issue- here's a quick video:
https://www.dropbox.com/s/7ywd0o6sj83be3h/uiScaling_01.mov

Any other thoughts? Much appreciated!

11
I was just about to ask the exact same thing!

Currently, I assume this must be called on every panel that is showing? I suppose "Refresh()" could be added to the "Awake" function of UIPanel, but I assume there is a good reason that isn't already there...?

Thanks!

12
Looking for a workaround to this-

Currently, our game uses "manual" height and a screen-size based switch, so that on scene load, the "height" is set to either 768 or 640 (iPad or iPhone).  This works great with our current setup, except for one problem: when the scene loads, you can see the GUI quickly scale to the newly set height.

Is there a way to get around this? I was thinking, but not sure how, perhaps I could "reach into each scene" from a start/loading screen, and set the manual height before the scene is loaded?

However, that's a non-NGUI method, is there a way any one could recommend to get around this? Thanks much!

13
Still doesn't work unfortunately- dot doesn't follow unless screen is exactly 1024x768. I changed code to this:

  1. var melvinScreenPos = camera.main.WorldToScreenPoint(transform.position);
  2. var nguiPos = Vector3(melvinScreenPos.x-512, melvinScreenPos.y-384, 1);
  3. testWidget.transform.localPosition = nguiPos * (uiRoot.manualHeight / Screen.height);

The test widget just doesn't follow...could it be something to do with melvinScreenPos coming from the main camera, which is non-orthographic (vs NGUI cam is ortho)?

14
NGUI 3 Support / Special case- floating widget over character's head
« on: July 23, 2012, 05:25:18 PM »
I'm sure something like this has been asked many times, but at least for my case, I can't find how to do this- thanks for bearing with me! :(

I have a 3D, top-down game, with 2D UI.
The game is for iPad, and we don't have time to set up multi-res atlases, so the top UIRoot component is set to manual and 768 for height. This makes it look just fine (if scaled up) on both SD and Retina screens.

So like I said, just trying to get a floating widget above the characters head like so:
  1. var melvinScreenPos = camera.main.WorldToScreenPoint(transform.position);
  2. var nguiPos = Vector3(melvinScreenPos.x-512, melvinScreenPos.y-384, 1);
  3. testWidget.transform.localPosition = nguiPos;

This will work when the screen is exactly 1024x768, but otherwise it gets off quickly.
I've tried various things with multiplying by screen width/height, and so forth, but just can't get this to work.

Thanks very, very much for any help...frustrating for something that's probably very standard! :(


15
Rockin, thanks much!

FYI, I've been rebuilding the entire GUI for "Eat Sheep" (www.eatsheep.com) using NGUI, and even as a first-time user, it's been incredibly fast, powerful, and therefore fun to do. The art folks love that they can help out now, and the tech folks enjoy that they can customize/extend so nicely. Me, I'm in the middle and very very happy, especially with this new, super speedy update. Just a note :)

Pages: [1] 2