So I am using Corona’s image sheet library. I found that if I create a sprite with animation and then change its width by setting its width property, when I start playing animations the width is reset. Am I missing something here?
--------------------CODE
local sequenceData = {}
sequenceData[1] = {name=“default”, frames={ 10}, time=100, loopCount=1}
sequenceData[2] = {name=“toggled”, frames={ 34}, time=1000, loopCount=1}
local l = display.newSprite(Sprites.sheet, sequenceData)
l.x = 100
l.y = 100
l.width == 100 – assign width here
—whenever this event listener is called and triggers setSequence and play
– it resizes the control back to its original width
l:addEventListener(“touch”, function(event)
print(event.phase)
if(event.phase==“began”)then
event.target:setSequence(“toggled”)
event.target:play()
end
end )
</code>