Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: jehk on January 22, 2014, 03:58:07 PM

Title: Custom Sprite Dimensions and Atlas Changes
Post by: jehk on January 22, 2014, 03:58:07 PM
I have a bunch of sprites that all sit next to each other in a scene (ie a character portrait frame). Due to texture filtering there's a little gap between each sprite despite being right next to each other. I fix that by modifying the sprites dimensions so its 1 pixel smaller on all sides (ie x + 1 and y + 1; width - 2, height - 2). However, every time I update that sprite (or any sprite in the atlas) I have to redo the sprite's dimensions.

Is there anything I can do about that? Only thing I can think of is using a custom packer. It's becoming a real chore.

Thanks.
Title: Re: Custom Sprite Dimensions and Atlas Changes
Post by: ArenMook on January 23, 2014, 06:36:05 AM
You're modifying the sprite's dimensions? Why not position your UISprites so that they overlap by a pixel instead?
Title: Re: Custom Sprite Dimensions and Atlas Changes
Post by: jehk on January 23, 2014, 01:28:14 PM
EDIT: Okay! I thought about this a bit more and found a simple solution. I'm using the techniques from your Sliced & Tiled Sprite howto video. My UI is now a bunch of tiled sprites with borders attached to each other using anchors (the new system is pretty cool btw). I'll have to manually slice a few sprites but that's no problem compared to what I was doing before.

...

Mainly because our HUD is semi-transparent.

What's the best way to fix the gaps between adjacent sprites that are supposed to tile (but are not actually tiled sprites)?

While the method I'm using works I feel there has to be a better way. Hopefully I'm not being too obtuse and missing an obvious fix.

Thanks again.