Sequence doesn't play normally.

Hello. I have an imageSheet with common sequenceData:

ice3_1xSheet = {

    {

        name = “normalRun”,

        start = 1,

        count = 18,

      time = 300,

        loopCount = 1,

        loopDirection = “forward”

    }

}

It works for one ImageSheet but doesn’t work normally for another. It’s weird because both have same numbers of frames. It plays good after restarting level. SequenceData goes from a module… may be problem is here?

PS Very strange - tried to play it in separate scene - same result, tried to crop - same. Corona just don’t like this sheet =)

Solved by increasing time of playing to 600. But interesting why does it work for one normal and bad for another?

Weird. Was there any thing odd about the sprite sheet? I don’t see why time would matter.

Rob

Odd? Didn’t find. Sheet was made by Texture Packer… may be something because of size?? It’s 1866x1006 but it’s alright as I know. Maximum 4096 for iPhone4s and optimal 2048 for other devices(not Apple). Mystics =)

Hmm, in module which it execute playing from I have

for i = 1, 20 do

  if event.other == durTable[i] then

   if event.other.alpha == 0.8 then

     durAnim[i]:setFrame(2)

   end

  if event.other.alpha == 0.6 then

    durAnim[i]:setFrame(4)

  end

  if event.other.alpha < 0.5 then

   durAnim[i]:setFrame(1) – here, if i omit this string animation will play bad

   durAnim[i]:play()

   event.other:removeSelf()

  end

 end

end

What do you mean by play bad?

There is an expectation to set a sequence before you run the play method. The docs for play hints that you must call :setFrame() or :setSequence before :play()

https://docs.coronalabs.com/api/type/SpriteObject/play.html

Rob

Play bad - i mean it’s not playing, it’s just a jump from first to last frame skipping all other frames. Do you mean setting of frame got to be every time right above :play() string?

Yes, you have to either :setFrame() or :setSequence() before you can call :play()

Rob

Solved by increasing time of playing to 600. But interesting why does it work for one normal and bad for another?

Weird. Was there any thing odd about the sprite sheet? I don’t see why time would matter.

Rob

Odd? Didn’t find. Sheet was made by Texture Packer… may be something because of size?? It’s 1866x1006 but it’s alright as I know. Maximum 4096 for iPhone4s and optimal 2048 for other devices(not Apple). Mystics =)

Hmm, in module which it execute playing from I have

for i = 1, 20 do

  if event.other == durTable[i] then

   if event.other.alpha == 0.8 then

     durAnim[i]:setFrame(2)

   end

  if event.other.alpha == 0.6 then

    durAnim[i]:setFrame(4)

  end

  if event.other.alpha < 0.5 then

   durAnim[i]:setFrame(1) – here, if i omit this string animation will play bad

   durAnim[i]:play()

   event.other:removeSelf()

  end

 end

end

What do you mean by play bad?

There is an expectation to set a sequence before you run the play method. The docs for play hints that you must call :setFrame() or :setSequence before :play()

https://docs.coronalabs.com/api/type/SpriteObject/play.html

Rob

Play bad - i mean it’s not playing, it’s just a jump from first to last frame skipping all other frames. Do you mean setting of frame got to be every time right above :play() string?

Yes, you have to either :setFrame() or :setSequence() before you can call :play()

Rob