Hi everyone!
I need to realize long-term animation (500 PNG files, size: 800x400). Therefore I cannot use sprite sheet - Spriteloq said that 443 frames left (huge size of sprite sheet). I tried to use movieclip, but I caught memory warning and saw only black display every time I used more then 266 PNG files in movieclip file seqence.
[lua]local movieclip = require(“movieclip”)
local foreground = display.newGroup()
local imageTable = {}
for i = 1, 500 do
table.insert(imageTable, “cat_merry_stop” … i … “.png”)
end
local animation = movieclip.newAnim(imageTable)
foreground:insert(animation)
animation.x = display.contentCenterX
animation.y = display.contentCenterY
animation:play()[/lua]
So, I desided to use programmatic animation.
[lua]local i = 0
local image = nil
local function animate(event)
i = i + 1
display.remove(image)
image = display.newImage(“cat_merry_stop” … i … “.png”)
image.x = display.contentCenterX
image.y = display.contentCenterY
if i >= 500 then
i = 0
end
end
Runtime:addEventListener(“enterFrame”, animate)[/lua]
This code works as expected, but animation is blinking at the end of each iteration (of animation). I don’t know why. What should I do? Perhaps I should use another way of realizing of this task. My aim is long-term (‘rich’) animation.
Please help me! I’m a beginner in Lua and Corona SDK. [import]uid: 154990 topic_id: 27464 reply_id: 327464[/import]

