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

Pages: 1 [2]
16
NGUI 3 Support / How do I have a key press cause a button click?
« on: July 25, 2012, 04:52:12 PM »
I've got a toolbar of buttons that are clickable, and I'd like to have them also respond to shortcut keys.  Currently I added a script onto each button that checks for their corresponding key press, and if so, calls SendMessage("OnClick").  This mostly works, in that the button's click sound goes off and any custom OnClick methods get called, but it doesn't call OnPress true and OnPress false the way it would with an actual mouse click, so the button doesn't animate.  Is there a way to automatically simulate a full click on a button, or should I manually call OnPress(true) and OnClick and then start a CoRoutine to call OnPress(false) a second later?

17
NGUI 3 Support / Re: Why is NGUI backwards in the editor?
« on: July 18, 2012, 03:33:40 PM »
Thanks JRoch, that's the explanation I was looking for.  I knew it looked correct when you changed the scene orientation to "Back" instead of "Front", but that's why I assumed it was backwards.  I get it now... you're right, it's because Unity's default perspective view is looking at the scene backwards.

18
NGUI 3 Support / Re: Why is NGUI backwards in the editor?
« on: July 16, 2012, 07:05:10 PM »
Yes, UIRoot's default rotation is 0,0,0, I was just saying that if I changed it to rotate around the Y-axis 180 degrees, it fixed the problem.  When I create a new UI, everything in the editor is flipped backwards when looking down the Z-axis (in other words, it appears to be rotated 180 degrees about the Y-axis, even though all of the objects have zero rotations in the inspector).  In order to see the UI properly in the editor, I have to look at it down the -Z axis instead of the +Z axis.  I assumed it was like this for everyone; maybe it's just something weird in my setup?  All the example projects loaded like that as well though.  I was saying I could get it to look correct by rotating the UIRoot around the Y-axis since the rest of the UI is a child underneath it.  Am I the only one who sees it backwards?

19
NGUI 3 Support / Re: Why is NGUI backwards in the editor?
« on: July 12, 2012, 03:40:00 PM »
Just as an experiment I tried rotating the UI Root 180 degrees on the Y axis so that everything is facing correctly, and everything seems to work fine still, so why does the default UI Root have a flipped Z-axis?

20
NGUI 3 Support / Why is NGUI backwards in the editor?
« on: July 12, 2012, 03:30:03 PM »
Something I've always found strange - why is NGUI flipped in the editor?  You need to look at it down the negative Z axis for it to be facing the right way, and yet when you're actually setting values it still treats it as if you're looking at it normally; with positive Z being further away from the camera and positive X being to the right, rather than the way it is in the editor, with positive Z being closer and positive X pointing to the left.  I never could figure this out exactly; what's the deal?

21
NGUI 3 Support / Re: Issues with transparency and tooltip
« on: July 12, 2012, 03:03:48 PM »
Ah, that fixed it.  Thank you!  It's been bugging me for a while. :)

What are the guidelines on what should be in its own panel?  I was trying to put as much as possible into a single panel to minimize draw calls but now I'm thinking that it would be better to have any windows/widgets that dynamically appear on top of others each in their own separate panel to avoid glitches like this when they overlap?

22
NGUI 3 Support / Issues with transparency and tooltip
« on: July 11, 2012, 02:25:26 PM »
I'm having some weird issues trying to use a semi-transparent window with a tooltip.  The window has a semi-transparent background, but the labels in it are opaque.  You can see how it normally looks in image one.  The tooltip is opaque, no transparency.  When the tooltip pops up though, it messes with the window in the background, and seems to cause it to render in the wrong depth order.  When I had the window's background and labels on the same Z-axis value, but different Depths, it rendered fine normally but then when the tooltip came up, it would render the labels behind the window instead of on top of them, as if it had reversed the depth order.  When I put the labels one unit closer on the Z-axis than the background, it again looks fine normally, but when the tooltip comes up it renders a corrupt looking version, as if it's partially behind the window and partially above it (see image 2).  If I move the labels to a higher Z-axis than the tooltip they stay normal but then the tooltip renders behind the labels, which is not what I want.  I believe NGUI isn't supposed to care about the Z-axis most of the time and just rely on the depth order (which is set correctly), but it seems to get a little weird with transparent pieces.  Any idea on how I can fix this?

http://imgur.com/wxtL7,0XoLS#0


http://imgur.com/wxtL7,0XoLS#1

23
NGUI 3 Support / Small request
« on: May 15, 2012, 02:11:50 AM »
Any chance you could move UITooltip and UICursor out of the Inventory Example and put them into the main UI folder?  And then remove UITooltip.ShowItem(item) and instead put a method in Item like GetTooltipText() to remove the dependency there?  I think the tooltip and cursor are useful to people who aren't using the inventory system.

I have an ulterior motive in that I use a heavily modified inventory system that causes name collision when I update NGUI so I have to avoid importing the Inventory Example, but I also think UITooltip and UICursor have grown up enough that they should be full-fledged parts of the UI now and not stuck in an example. ;)

24
NGUI 3 Support / Scaling a sliced sprite's parent
« on: May 15, 2012, 01:41:08 AM »
When you scale a sliced sprite window, it maintains the corners at their normal size and scales the edges only in their necessary direction, which is awesome.  But if you have a sliced sprite window that is the child of a different object, and you scale the parent, it scales the sliced sprite as if it was a normal sprite and you get ugly borders.  Is there a way to avoid this?  Do I have to scale the sliced sprite and the other child objects each individually, or is there some trick to get it to work when I scale the parent?

25
NGUI 3 Support / Add a premade icon sheet to a texture atlas?
« on: April 30, 2012, 12:20:07 AM »
I have an existing png image that's a bunch of 120x120 icons stitched together.  Is there an easy way to turn this into a texture atlas?  I know I could probably use some photoshop trickery to split it back up into a hundred different icon files and then drag them all into the atlas tool to re-stitch them, but if there's some way to just tell NGUI that the atlas is 10 x 10 120p icons that would make my life much easier. ;)

Pages: 1 [2]