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 - David Foster

Pages: [1]
1
Cheers Michael, but that isn't solving the problem. Here is a quick breakdown of the issue in case I've been unclear:

  • Editor script edits a transform's position x and y.
  • A sprite parented to said transform moves with it, but is not drawn in the new location in the editor scene view.
  • So, after editing transform, I call EditorUtility.SetDirty(sprite), SceneView.RepaintAll() and NGUIEditorTools.RepaintSprites()
  • Sprite is still not drawn in the new location until I click out of Unity and back in, or if I save the scene.

2
I have a simple editor script that sets a game object's local position x and y based on an enumeration value set in the inspector. It is happening OnSceneGUI when the value changes. The issue is, if there's a sprite parented to the game object, it doesn't redraw the sprite at its new location. The only way I have found to do that is to click out of Unity and back in, or save the scene.

I have tried SceneView.RepaintAll() and NGUIEditorTools.RepaintSprites() to no avail. This doesn't appear to be a Unity issue either, as primitives (e.g., quads) are redrawn, it's just sprites that are not. Any ideas? Cheers.

3
NGUI 3 Support / Two Draw Calls in Draw Call Tool, One Draw Call in Editor
« on: December 19, 2013, 11:03:25 PM »
Firstly, I love the Draw Call Tool. It's extremely useful. My question is, I have a report of two draw calls in the Draw Call Tool consisting of exactly the same widgets. See the attached image.

The strange thing is these two draw calls in the Draw Call Tool are being reported as only one draw call by the Unity editor (under Stats). Do I assume that the editor is correct? How do I ensure the draw calls don't appear twice in the tool, or is there something wrong in my scene I should be resolving?

4
Okay, thanks. Well I just bought a Professional license ten minutes ago specifically to get access to another bug fix you posted today (atlas reference break on slice adjustment).

5
Thanks Michael. Unfortunately there are a couple of reasons right now why I can't have all dimensions divisible by two:
  • I built the whole UI on the understanding that lowest res sprites can be odd, and I think that's a fair expectation. Changing the textures now will take literally tens of hours. My deadline is tomorrow.  :(
  • My source artwork is HD designed at 2048×1536 and is comprised of quite large individual textures, meaning for textures to resolve to even in SD, I need to round to nearest 4, 8, 12, etc. This will result in a lot of wasted texture space.
I am so sorry to be pushy but what are your are immediate thoughts on this? Do you think this could be fixable at the NGUI level?

6
I have noticed that odd-sized sprites have their dimensions evened out when hitting 'Correct' or calling MakePixelPerfect(), so an underlying texture might be 39×39 pixels, but its sprite dimensions become 40×40. I see that this is deliberate, as this does indeed result in the sprite being pixel perfect.

However, these even dimensions do not result in pixel perfect sprites when the reference atlas is replaced with the HD atlas (with 0.5 pixel size). In this instance, an underlying HD texture might be 78×78 (i.e., 39 * 2), and its dimensions are 'corrected' to 40×40, but this is not pixel perfect. In fact, the dimensions which do result in a pixel perfect HD sprite are 39×39 – half of 78×78, as you'd expect.

How can I resolve this issue? It seems my options at present are to either sacrifice pixel perfection in HD or to manually correct dimensions and sacrifice pixel perfection in SD.

I have uploaded a very simple test case project with a README detailing steps to replicate. Please download here: https://www.dropbox.com/s/c1vfwoupcfi2lpq/NGUI%20Pixel%20Perfect%20Playground.zip. It is password protected, so you need not fear for unpaid users getting their hands on NGUI. Michael, I have PMd you the password to extract.

Your assistance on this would be hugely appreciated. I'm on a tight deadline and anything you can do to help might just save my life.

7
NGUI 3 Support / Re: Atlas Reference breaks when adjusting slice
« on: November 14, 2013, 12:38:04 PM »
Sadly this bug has wasted a lot of my time by forcing me to manually go through the hierarchy and repoint UIWidget atlases to the reference atlas whenever slice dimensions are adjusted. It's good to hear it's fixed (and was done so very quickly!) but when can we expect this in a release?

Pages: [1]