I am getting some weird results, can someone explain this to me?
I have three sprites - clouds. Here is the .lua table from TexturePacker:
{
name = "cloudbig.png",
spriteColorRect = { x = 0, y = 0, width = 352, height = 96 },
textureRect = { x = 2, y = 2, width = 352, height = 96 },
spriteSourceSize = { width = 352, height = 96 },
spriteTrimmed = false,
textureRotated = false
},
{
name = "cloudmed.png",
spriteColorRect = { x = 2, y = 1, width = 254, height = 68 },
textureRect = { x = 2, y = 780, width = 254, height = 68 },
spriteSourceSize = { width = 256, height = 72 },
spriteTrimmed = true,
textureRotated = false
},
{
name = "cloudsmallpng.png",
spriteColorRect = { x = 0, y = 5, width = 120, height = 58 },
textureRect = { x = 902, y = 606, width = 120, height = 58 },
spriteSourceSize = { width = 120, height = 64 },
spriteTrimmed = true,
textureRotated = false
},
===========================================================
Here is the sample code for display:
local SheetData = require("stuff").getSpriteSheetData()
local Sheet = sprite.newSpriteSheetFromData( "stuff.png", SheetData )
local Set = sprite.newSpriteSet(Sheet, 1,35)
sprite.add( Set, "CloudBig", 1,1, 10000, 0) -- clouds
sprite.add( Set, "CloudMed", 2,1, 10000, 0) -- clouds
sprite.add( Set, "CloudSmall", 3,1, 10000, 0) -- clouds
C1=sprite.newSprite(Set)
C1:prepare("CloudBig")
C1:play()
C1:setReferencePoint(display.TopLeftReferencePoint)
C1.x=0
C1.y=100
C2=sprite.newSprite(Set)
C2:prepare("CloudMed")
C2:play()
C2:setReferencePoint(display.TopLeftReferencePoint)
C2.x=0
C2.y=200
C3=sprite.newSprite(Set)
C3:prepare("CloudSmall")
C3:play()
C3:setReferencePoint(display.TopLeftReferencePoint)
C3.x=0
C3.y=300
And here is the (weird, at least to me) result:
http://i49.photobucket.com/albums/f259/bigbadterr/Image3-1.png
As you can see from the .lua table, the widths are NOT the same. The clouds are saved autosized - so they don’t have empty spaces to the side. WHY in the world are they showing up like this and not aligned to the left as I would have expected them to?
[import]uid: 160496 topic_id: 28469 reply_id: 328469[/import]