Gamua / Starling-Framework

The Cross Platform Game Engine
http://www.starling-framework.org
Other
2.84k stars 819 forks source link

scale9Grid transparent edges depending on contentScaleFactor #922

Closed harry248 closed 7 years ago

harry248 commented 7 years ago

I am observing semi-transparent edges on images, that have a scale9Grid, when the contentScaleFactor is something like 1.5. That even happens when the image only contains a solid color and the "caps" are sized amply. Any idea what could be wrong?

oddwhocanfly commented 7 years ago

Try setting texture wrap mode to "repeat" (you may need a power of 2 texture for this).

b005t3r commented 7 years ago

It's definitely not the repeat mode that's needed here (does Starling even need this for any display object since 2.0 came out?).

You probably need to add a couple of pixels (just 1 pixel might do) around your sprites of the same color as the sprite's edge pixel color - Texture Packer has an option for that called extrude.

harry248 commented 7 years ago

Thanks b005t3r! Using the Extrude option in TexturePacker worked. Strange, that I never had the problem with Feathers old Scale9Image, so I thought it must be something with Starling.

b005t3r commented 7 years ago

It's probably because of 1.5 scale you use. Previously scale9images and scale3images were handled a bit differently, I think, maybe that's why you didn't have this problem before.