Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Texture Atlas and Transparency Issue
Started by MagnetiCat Jul 07 2012 08:14 AM

1 reply to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

MagnetiCat

[GLOBAL: userInfoPane.html]
MagnetiCat
  • Enthusiast

  • 35 posts
  • Enterprise

Hello,

we are test driving Corona SDK and the features of the new build.

Anyhow, I have a problem with the new Texture Atlas. I use Texture Packer to generate the texture atlases, and everything seems to work fine. I have a texture atlas for normal resolution, one for 2x, one for 4x. I verified that the correct files are loaded for each device (I added a small 2x, 4x in the spritesheet images).

Now, the problem I have is with transparency. I have some tiles with rounded borders over transparent background. Without the Texture Atlas api, these round borders work just fine. With the Texture Atlas, the rounded borders disappear on 2x and 4x resolutions.

If there some known gotcha about transparency and texture atlases?

Thanks.
uid: 13836 topic_id: 28392 reply_id: 328392


[TOPIC: post.html]
#2

MagnetiCat

[GLOBAL: userInfoPane.html]
MagnetiCat
  • Enthusiast

  • 35 posts
  • Enterprise

It looks like the issue is not with transparency - but with the way CoronaSDK uses the coordinates for multiple resolutions.

It seems that if you have 2X and 1X version of the same sheet, CoronaSDK will use always the 1X data sheet and use it as a base to calculate the 2X coordinates, instead of using a separate lua file for the 2x resolution. The problem with this is that the border is always the same in the 2X and the 1X resolution, so the result is that the outer areas of a sprite can be cut off.
uid: 13836 topic_id: 28392 reply_id: 114617



[topic_controls]
[/topic_controls]