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 - Tom G

Pages: [1]
1
NGUI 3 Support / Re: Laying out & inheritance - Pulling my hair out! X|
« on: September 24, 2012, 07:56:22 PM »
Thanks Aren.

I've had some success now. Here's the outcome...



For the record, here's the rules I followed when implementing:

 - I never attached a UIStretch or a UIAnchor to a UIPanel.
 - After creating each panel, the first thing I did was create a Widget (e.g. UISlicedSprite) that would define the physical bounds of that panel.  I'd name this something like "0.Border.BOUNDS" to keep it at the top of the list and to remind me that this was the 'master' widget.
 - Every time I created a UIAnchor or UIStretch on this panel, I would drag this BOUNDS object into the Widget Container field of that component. This logic cannot be applied to the Panel Container field because the Anchor/Stretch code ignores panels that have 'clipping' turned off.

For anyone that's interested, here's a childlike drawing of the hierarchy I used:



I did in fact stick with the UIOrthoCamera instead of using a UIRoot and it seems to work fine -- keeping the UI pixel perfect even with dynamic screen resizes (which is what I want).

I've now got about a hundred half-pixel and depth issues to fix, but I feel like I've broken the back of it thankfully =)

2
NGUI 3 Support / Re: Laying out & inheritance - Pulling my hair out! X|
« on: September 24, 2012, 06:29:53 PM »
Thanks dlewis,

I don't think it's the lack of a UI Root which is causing the problem (I will confirm shortly) but your advice about panels got me thinking.  I have previously been treating Panels as widgets with dimensions, and I've been attaching UIAnchors and UIStretches to them, assuming that these would transfer to the widgets below.

I'm part way through an attempted implementation where I'm avoiding doing *anything* geometric with Panels -- no anchors, no stretches, no offsets even --  and it seems to be going well so far.  I'll post back shortly...

3
NGUI 3 Support / Laying out & inheritance - Pulling my hair out! X|
« on: September 24, 2012, 05:52:32 PM »
Hey,

So I've been pulling my hair out trying to get a particular layout working in a UI. On the face of it it didn't seem that complicated, and while I can get each of the individual concepts to work (like anchoring, stretching, and offsetting) it seems that whenever I try to bring them together into a single layout it falls over and Widgets start going mental in scale or position.

I have looked through tutorials and Googled the hell out of the forums but I can't get it nailed.  Can anyone give pointers as to what my strategy should be?

Here's what I'm trying to achieve (simplified)...



Inherited sizes are marked in brackets.

Some notes:
 - I don't mind if it uses one UIPanel or five, as long as I can turn the different sections on and off independently (using SetActive I guess)
 - I am not using a UIRoot - I am using a UIOrthoCamera instead as the game is 2D.
 - My border/fill sprites will all stretch and tile and slice as you'd expect, so I don't need advice with that side of things for now.
 - I have tried out using Cameras, Panels (clipped and unclipped) and Widgets as 'containers' in the UIAnchor and UIStretch components, but to no avail.
 - I understand that Widgets can't be nested, but I have tried several other means of getting dimensions passed down a hierarchy with no luck.

Help please!!!! ;)

Thanks,

Tom

4
NGUI 3 Support / Re: Atlas padding not working how it should?
« on: September 22, 2012, 04:01:33 AM »
Okay, thanks as ever for your quick reply, Aren.

5
NGUI 3 Support / Re: Atlas padding not working how it should?
« on: September 21, 2012, 06:36:50 PM »
I have worked around this issue for now, by selecting the Atlas in the Atlas Maker, then selecting the two offending images in the Project folder, un-ticking the 'Trim alpha' option and then hitting the Update button.

Still, I wouldn't mind knowing if I'm understanding things correctly or not!

6
NGUI 3 Support / Atlas padding not working how it should?
« on: September 21, 2012, 06:21:56 PM »
Hi,

So I'm loving the 9-slice sprites feature of NGUI and generally it seems to work great. However, I've run into a problem and I'd like to confirm that I understand things correctly.  Here's the story...

I have two images for use as button states. The hover state has a glow around it, so to account for this in my artwork I have left a transparent border around the one that doesn't have a glow.  The first image shows how they look in Photoshop. They both export at 40x40 pixels.



Now, after bunching them both into an Atlas in Unity (with 'trim alpha' checked, and using the regular Unity packer), I see -- as expected -- some Padding has been added to one of the images to make up for the trimmed pixels.  The second image shows how the sprites look in the Atlas Inspector, after I've set up appropriate 9-slice Borders.



So my first question is: Should the preview not be showing the padding around the image?  Is this a bug in itself?  It seems to correspond with the fact that when I try to use these two sprites to make an Image Button, I see problems with image scaling. The third image shows how the mouse-over state looks.  It looks like the Padding is not doing its job.



Am I misunderstanding something here, or is this an issue?

Thanks,

Tom

7
Amazing.  Thx.  Have fun at Unity!

8
NGUI 3 Support / Re: v2.2 Atlas Editor Problem
« on: September 19, 2012, 06:15:07 AM »
I'm a noob here, but when I'm dealing with several small sprites that are very similar (like button states) I find I have to click the images in the selector in turn, and watch the name field elsewhere, to check that I have clicked the correct one.  Then I have to return to the selector to close it with the red cross.  It's a little bit of a faff :)

Having the sprite names shown in the sprite selector (underneath or alongside each icon), and having the sprite selector auto-dismiss on select or after double-clicking a sprite would be perfect IMO.

Still, I've not worked on any big projects yet, so I don't want to preach as to how it should be done! Just my thoughts...

9
NGUI 3 Support / Re: v2.2 Atlas Editor Problem
« on: September 18, 2012, 06:28:50 PM »
I also had to add "mSprite.outer = outer;" after line 283 of the modified version of UIAtlasInspector.cs, to get the Dimensions fields to work as well as the Border ones.

10
OK - the temporary fix I'm using involved adding "mSprite.outer = outer;" after line 283 of the modified version of UIAtlasInspector.cs.

11
Thanks Phil,

The fix appears to work to some extent, in that it now allows me to change Borders (and so I can create a Sliced Sprite from an image) but I'm still seeing funky behaviour with the Dimension fields (the green ones) which won't budge, meaning I can't create multiple regular Sprites from one Atlas.  I'm completely new to NGUI, but I'm pretty sure that this should be possible!

I appreciate you're probably working hard to fix this, but I thought I'd let you know in case this was in fact a separate issue.

Cheers  ;)

12
Hi,

Today I purchased NGUI v2.2.0 after being impressed with the free trial previously. Unfortunately, as soon as I started using the new version I found myself unable to do something pretty fundamental: change the Dimensions and Borders on a Sprite, in the UIAtlas inspector. In the old version, I just type a number into the green or blue boxes and it's done.  In the new version, the boxes always reset their values, no matter what I do.

I have tried restarting Unity. I have tried creating new Scenes.  I have even re-downloaded the whole of NGUI into a brand new Unity project, and it still won't work.  As soon as I downgrade to 2.0.7 (free), it works again.

I went in the UIAtlasInspector code to trace out some values, and it seems that for every one pass of the OnInspectorGUI which attempts to modify the green and blue values (Rect outer and Rect inner) there are then four or more passes triggered which all reset these Rects to their 'locked' values.  It's like it is always failing validation, and then being repeatedly pummelled back into its old values.

Please help -- I thought long and hard about this purchase and now I am very definitely in negative value for money!!  :-[

Thanks,

Tom

Pages: [1]