Sorry if this is the wrong place to post, but like many others have pointed out there is no spot in pre-release for xcode 7 questions (please move message if I'm wrong).
I am building a single image by overlapping two or more images.
I'm using a texture atlas containing layer 1, 2, 3, etc
I set the anchor point to 0,0
I draw the first image
I load the next image
set the anchor to 0,0
and draw it on top of the first.
the first image is 14 pixels wide and 14 pixels tall (no transparent pixels)
the second image is also 14 pixels wide and 14 pixels tall, but it has a fully transparent pixel around it (so the actual image is 12x12)
In xcode 6 I would see the second image centered on top of the first.
in xcode 7 I see the second image position in the bottom left corner of the first image. It appears to be cropping out the blank pixels.
I know in the past people have suggested using a 1% alpha pixel rather than fully transparent to work around this issue. However, I did not have this issue in xcode 6.
So why is xcode 7 cropping out the fully transparent pixels? It's positioning the second image like it is a 12x12 image (removing the top, right, left and bottom rows and columns of transparent pixels)
What's more puzzling is that when I look a the image sizes it properly reports them both at 14x14 pixels. Texture size also reports 14x14
Here is the code I'm using (rough):
texgen = img_atlas.textureNamed("img1")
texgen.filteringMode = SKTextureFilteringMode.Nearest
let bm1: SKSpriteNode = SKSpriteNode(texture: texgen)
texgen = img_atlas.textureNamed("img2")
texgen.filteringMode = SKTextureFilteringMode.Nearest
let bm2: SKSpriteNode = SKSpriteNode(texture: texgen)
bm1.anchorPoint = CGPoint(x: 0.0, y: 0.0)
bm2.anchorPoint = CGPoint(x: 0.0, y: 0.0)
bm1.position = CGPoint(x: 0, y: 0)
bm2.position = CGPoint(x: 0, y: 0)
canvasNode.addChild(bm1)
canvasNode.addChild(bm2)
the two images should be right on top of each other with the edges/border of the first around the second image.
======>
On a seperate note, does anyone know if you can now mix and match nearest and linear when using texture atlases in xcode 7? In 6 if I set nearest, everything was nearest, if I set linear, everything was linear (I know you can get around this with tricks, but I'm not a fan of hacks)