Adding Animation made with Adobe Character Animations to My App

Hello, 

I am working on a series of 2-3 minute long animations that I would like to add in the beginning of each level ad once each level is completed. 

How can I use the animation as a single piece file (.mp4) ?

Or do I have to break the animation down into hundreds of scenes so I can use the SpriteSheet? and Add the Audio to play in the background at the right time?

Thanks,

Ebrahim

I don’t know how many people in our community has used this. I had never heard about it before you posted this. There isn’t a lot of information on what it exports, but one place said it did output a series of PNG Files, I guess for each frame of the recorded animation along with the WAV file for the audio. Depending on the size of the images, those PNG files could be put into an image sheet and display.newSprite() called to play the soundless animation and you could use audio.loadStream() and audio.play to try and sync them up.

If you have a .mp4, you can use native.newVideo() to play it. Being a native.* control it’s won’t be part of the display objects but sit on top of them.

Rob

Thank you Rob. I was guessing the same, that it would export the animation in frames and in png format. 

I tried the native/newVideo()  and received the following error. This is while in the Corona SDK guide, it says that this method works on both iOS and Android. Am I doing something wrong?

error says:  WARNING: Native video objects are not supported in the simulator. Please build for device.

I have used the same code found at  https://docs.coronalabs.com/api/library/native/newVideo.html

local video = native.newVideo( display.contentCenterX, display.contentCenterY, 320, 480 ) local function videoListener( event ) print( "Event phase: " .. event.phase ) if event.errorCode then native.showAlert( "Error!", event.errorMessage, { "OK" } ) end end -- Load a video and jump to 0:30 video:load( "myVideo.m4v", system.DocumentsDirectory ) video:seek( 30 ) -- Add video event listener video:addEventListener( "video", videoListener ) -- Play video video:play() -- Stop the video and remove video:pause() video:removeSelf() video = nil

That warning means that you have to test on a physical device.  MacOS users can also build for the Xcode simulator which should also work.  Somethings just don’t work in the simulator.

Rob

Thank Rob

I don’t know how many people in our community has used this. I had never heard about it before you posted this. There isn’t a lot of information on what it exports, but one place said it did output a series of PNG Files, I guess for each frame of the recorded animation along with the WAV file for the audio. Depending on the size of the images, those PNG files could be put into an image sheet and display.newSprite() called to play the soundless animation and you could use audio.loadStream() and audio.play to try and sync them up.

If you have a .mp4, you can use native.newVideo() to play it. Being a native.* control it’s won’t be part of the display objects but sit on top of them.

Rob

Thank you Rob. I was guessing the same, that it would export the animation in frames and in png format. 

I tried the native/newVideo()  and received the following error. This is while in the Corona SDK guide, it says that this method works on both iOS and Android. Am I doing something wrong?

error says:  WARNING: Native video objects are not supported in the simulator. Please build for device.

I have used the same code found at  https://docs.coronalabs.com/api/library/native/newVideo.html

local video = native.newVideo( display.contentCenterX, display.contentCenterY, 320, 480 ) local function videoListener( event ) print( "Event phase: " .. event.phase ) if event.errorCode then native.showAlert( "Error!", event.errorMessage, { "OK" } ) end end -- Load a video and jump to 0:30 video:load( "myVideo.m4v", system.DocumentsDirectory ) video:seek( 30 ) -- Add video event listener video:addEventListener( "video", videoListener ) -- Play video video:play() -- Stop the video and remove video:pause() video:removeSelf() video = nil

That warning means that you have to test on a physical device.  MacOS users can also build for the Xcode simulator which should also work.  Somethings just don’t work in the simulator.

Rob

Thank Rob