Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: zhenghongzhi on October 29, 2015, 04:30:52 AM

Title: Seems to be half pixel problem
Post by: zhenghongzhi on October 29, 2015, 04:30:52 AM
When I place a image on the left-top corner at (0,0), there is a small gap on the top?
Is this the half pixel problem? How can I fix this? Thank you!


Unity5.2.1
NGUI3.9.4b
Title: Re: Seems to be half pixel problem
Post by: ArenMook on October 29, 2015, 07:33:33 AM
Most likely because your window's dimensions are not dividable by two. What is its size?
Title: Re: Seems to be half pixel problem
Post by: zhenghongzhi on October 29, 2015, 09:24:25 PM
Yeah, I checked that and that's the problem. Thank you
Now I have another question. My sprite is 465*123, and it becomes 466*124 in the scene. Anything causes this?
Title: Re: Seems to be half pixel problem
Post by: ArenMook on October 31, 2015, 02:07:12 AM
1 pixel of padding is added automatically in order to make dimensions dividable by two, otherwise you can't center a sprite as it would fall in between of pixels.