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

Pages: 1 2 3 [4] 5 6 ... 11
NGUI 3 Support / Re: UI vs World eventtype issue
« on: November 10, 2013, 01:23:39 AM »
You are a life saver! - Thanks a lot.

Since I thought this is a useful question for others, I asked in a separate thread.

Please take a look

Hey guys,

so I watched the "how to make a modular UI" video, and I quite like it.

My attempts have been successful, at creating even more complex UIs than the one presented in the video.
But one thing I failed to "modularize", is the clipped panel.

So let's say I have an inventory with an inner window for my contents (see attachment), what I'd like to be able to do, is resize the inner window, and have the clipped panel resize itself accordingly and correctly.

I tried doing the same thing, attaching a UIAnchor and UIStretch scripts to it, but it didn't work, it didn't resize properly.

And it is really annoying to having to resize it every time I resize my windows, especially since it's a clipped panel.

Thanks for your time and any help or suggestions.

Hey guys,

so this is like, the 3rd NGUI bizarre thing happening to me today.

I have two inventories/itemBoxes with their Z position set to 0 - and my UICamera eventType is "UI" - Which means that what you see in the attachment, is not a strange thing - Since UI eventType handles things via depths, and not Z.

Here's the thing: If I change the Z of the grey item box to be in front of the black one, it will go actually and be in front of it blocking it, so there's no intersecting between them, the grey one just sits on top of the black one, shouldn't this NOT happen? (see attch2) - Not just that, if I do the opposite and try to put the black one in front, I can't! (see attch3)

Not just that, here's one more :D - If I change the eventType to "World", it doesn't change anything! - The issues will remain, and changing the Z will have the same effects as in the last 2 situations!

I'm really lost here, I'm pretty sure that I'm not using any transparent material in the black inventory, and the alpha is full.


Any help, advice or explanation would be appreciated.

Thanks a lot.

EDIT: I know you'd tell me, that since I'm using UI as an eventType, I should be adjusting the depths. Yes, correct that works, but:

1- I was just wondering why this is all happening to me, since it shouldn't.
2- The two inventories (the black and the grey) are of a different panel (if that matters) - if I keep adjusting depths, this means that I have to keep track of all the depths! So like for the first inventory say I had background on 0, slots on 1 and labels on 2. In the 2nd inventory I'll have background on 3, slots on 4 and labels on 5! - This is annoying!

Please provide us proper ways to deal with this, as there is very little information about this. - The comments on the code doesn't clear all that much, and the online documentation was always known to be developer-oriented much more than user-oriented.

NGUI 3 Support / Re: UI vs World eventtype issue
« on: November 09, 2013, 10:55:32 AM »
Well, that would be worse case scenario.

However, setting the alpha to 0 seems to be working - to a certain extent - But sometimes, some of the slots maintain their alpha, not going to 0, although code-wise they should, but must!

Please take a look at my 1:45 video about the problem

If you have any idea why this happens, or what's causing it, any direction and guide anything at all, please do suggest.

Thanks for your help and valuable time.

One more thing if you please, if you notice in my setup, I also have UIAnchor and UIStretch on my clipping panel, so whenever I reposition I want the clipping to resize correctly, but it's not working right. It's not resizing correctly.

Is this a proper way of doing it? or is there another way? or could this be yet another thing to consider in your next release?

Thanks for your reply. I didn't have to do anything with the code, I just selected the whole UI hierarchy (starting from "(Panel) - ItemBox") and set their Z position to 0, it appears to have worked. I don't know why that fixes it, but it seems it does. I was also surprised as much as you are by the fact that the bar disappears when it gets behind the window... I don't know.

I hope this gave you some bugs/ideas/things to consider in your next release.

I guess you could easily re-produce what I have, and see for yourself.

Thanks for your help.

Hello guys,

I saw the NGUI modular UI video and I decided to make my UIs modular as well.

The positioning and resizing/stretching worked very well. But there's something not right when I resize the original main background, the childrens' Z depth increases! I have no idea why.

I have made a video for it, please have a look

I'm using 3.0.4

Here's my setup:

  1. (Panel) - ItemBox
  2. - Main Window (Empty game object)
  3. --- Background - Outer (this is the background that I resize, and with it everything resizes)
  4. --- Glow - Outer (Has a UIAnchor and UIStretch (both) with "Background - Outer" as a container)
  5. --- Content Window
  6. ----- ItemBox (has an ItemBox script)
  7. ------- Items Window (Empty GO)
  8. ---------- Background - Inner (Has a UIAnchor and UIStretch (both) with "Background - Outer" as a container)
  9. ---------- Glow - Inner (Has a UIAnchor and UIStretch (both) with "Background - Inner" as a container)
  10. ------- (Panel) - Clipping (Has a UIAnchor and UIStretch (both) with "Background - Inner" as a container)
  11. ---------- Items (Empty GO)
  12. --- Title Bar
  13. ----- Background (Has a UIAnchor and UIStretch (horizontal) with "Background - Outer" as a container)
  14. ----- Buttons (Empty GO)
  15. ------- Close (Has a UIButton UIAnchor with "Background" (the previous one) as a container)
  16. ------- Sort  (Same)

NGUI 3.0 is really awesome, but still there are some things I'm failing to do well, maybe it's just me.

Thanks a lot for your help.

NGUI 3 Support / Re: UI vs World eventtype issue
« on: November 09, 2013, 08:28:13 AM »
Thanks for your reply. But as I said early, I can't use one collider. It is very important for me to determine the index of the slot in the item I click on - previously in Unity GUI, I used to do this by calculating the distance between the point where the mouse clicks, and the top left corner of the item, divide that by the size of the slot to get how many rows and cols I am away from the topleft (for example I click on the top right corner of the gun, this means I'm 2 cols and 0 rows away from the top left corner, so the index of the top right, is 0,2 relative to the item's slots in total). In NGUI it's a lot easier using separate colliders, slots have indices, when I click on the slot, I just take its index directly because I have a way to detect which slot I'm clicking on.

The point is, it is very important for me to keep separate colliders.

Can you please make another suggestion?

NGUI 3 Support / [SOLVED] UI vs World eventtype issue
« on: November 08, 2013, 09:03:43 PM »
Hey guys,

from what I know about those two eventtypes, UI is for the 2d UI, and world is for the other game camera.

Now, the problem is, is in my in my inventory UI, when an item takes more than one slot to fit, (like 2x3: 2rows, 3cols) I leave the topleft widget active, adjust its UISprite dimensions, and for the rest of the slots, I just disable their UISprite (not the whole slot) - in other words they still have their colliders active on them. (see attachment) - but for some reason, when I do that and I'm on UI eventtype, it doesn't seem to detect events anymore. If I switch to world, it works!

How can I fix that? I still want the UI mode, but I also want my inventory to work (please don't suggest to use one collider, it doesn't work for my purposes)

One thing i could do, is leave everything as is, but just set the alpha to 0 for the slots I want to hide. But I believe there's something better.

Any ideas?


EDIT: It seems that setting the alpha to 0, isn't a great solution.

Hi, when I upgraded to NGUI 3.0.2 from 2.6.4 - I had some extra stuff, in some NGUI files. For example a 'saturation' property in UIWidget, 'GetMouseClick' in NGUITools, etc. When I upgraded, of course, I have to copy paste the functionality and move it again to the new files. Not very efficient.

What's the best way to tackle this problem?

I guess, maybe for the saturation, I could have some extension methods, like a static class UIWidgetExtensions, and put the stuff there in a separate file so that it won't get harmed?

But what about, static functions, like the one I had NGUITools.GetMouseClick - Extension methods won't work here, so I guess, I have to create my NGUIUtility and put my stuff there?


Thanks for any tips :)

NGUI 3 Support / [SOLVED] Very annoying: can't move when focus on widget
« on: October 27, 2013, 10:14:30 AM »
I was really hopping this would come to an end when I upgraded to 3.0.2 but obviously it's not.

If I click on a widget (say sprite) and press F to focus on it, I can't move, I can't do anything, no Right click navigating with the mouse, no WASD editor movement, etc. The only way to free myself is to unselect the widget - Select something otherwise, something that's not a widget.

Am I missing something? or this is just the way it is... ? :(

That was ambiguous, see attachment.

The way the titles, their durations and albums are organized, much like a list view in a winform app.
If you click a title, all the line will get highlighted no matter where you click, on the title's name, duration or album.

I'm trying to create a media player, that's why I'm asking.

How to create a list view similar to VLC? what should I use? how should I create that type of button, where if you click on any of its parts, all get highlighted?

Thanks a lot.

Yes, thanks but how? :D

Is NGUI resizing-in-the-editor code available to us somewhere? like in the interals folder, or...?

Hi, I wonder how I could resize a window in NGUI. Like, in Windows for example, if you place the mouse on the borders of a window, you could mess with its dimensions, resize it, etc. NGUI allows you do this easily in the editor while you're creating your widgets, but I want to do this in-game.

Any ideas?


Pages: 1 2 3 [4] 5 6 ... 11