Using Lottie files with LibGDX - libgdx

I am trying to use Lottie files with my libGDX game.
I downloaded the files from https://www.lottiefiles.com/
which are downloaded in JSON format but I am unable to figure out or find any tutorial on how to use them.
Is it not possible to use Lottie with libGDX. if not, is there a good animation library like Lottie which can be used with libGDX?
Edits:
It's not just about Lottie, it appears to me that the only was to add animation to libGdx is to use the TexturePacker to pack a set of images into a sprite sheet. Is it not possible to use a pre-made json format textureAtlas for animation?
Currently I am trying to export an animation from Adobe Animate CC as a texture atlas but I can't find anything on how to use it in LibGdx.

Related

libgdx 2D animation with TexturePacker/Atlas

I'm trying to animate a 2D image, I have each of my images cut out into appropriate sizes. However I am not sure how to use the TexturePacker and TextureAtlas to animate them. I looked at the libgdx github tutorial but it does not show how it works. I have each of my seven images in appropriate format such as (image_1,image_2,image_3...etc) as suggested on the tutorial, how do I pack these images and use them with the Atlas? Any code sample would be appreciated
Hey I figured it out guys I'm actually just suppose to pack it with the TexturePacker tool which I had to download its a separate .jar file from here and then execute this lines of code
TextureAtlas atlas;
public Animation<TextureRegion> runningAnimation;
atlas = new TextureAtlas(Gdx.files.internal("directory/pack.atlas"));
runningAnimation = new Animation<TextureRegion>(0.033f,atlas.findRegions("running"), PlayMode.LOOP);
There is an official wiki about animation, TexturePacker+TextureAtlas.
Also, a good tutorial on animation for Libgdx
And tutorial of TexturePacker + Libgdx

Using vector shapes from FLASH PRO in FLASH BUILDER (Shapes/Graphic Symbol -> SWC?)

How to use simple vector shapes from FLASH PRO in FLASH BUILDER?
I'm already using SWC method to export buttons and movieclips, but i cant find a way to export simple shape assets. I've converted them to Symbol-Graphic, but it does not work. I've tried to convert them to button/movieclip changing base class to shape, but it generates compilation errors :(.
I don't want to use hundrets of movieclips just to export simple icons for FLASH Builder (memory usage would be huge), is there any solution for exporting simple shapes to SWC and use them in FLEX?
Edit: I'm using CC versions.
If thosse desired shapes are simple, the best method would be to generate them with actionscript code. Just create custom classes whitch extends Shape class and then you can import them from compiled swc file or straight from included folder.
Maybe this can hel you too: link

Create SWF video of images through Adobe Flex

I don't know whether it's the right place to put this up. But I've been trying from past 12 hours and haven't found anything related.
I'm creating a Adobe AIR project (which'll run on desktop), it'll ask for image locations on the local pc.
After the user is done selecting images. I want to output a SWF video (slideshow) of the selected images.
How to do the second step. Please guide. I want to create an output file (SWF) from my AIR Flex Desktop Application.
Check out https://github.com/claus/as3swf to compile SWFs at runtime...
This individual seems to have had a similar issue AS3 to Generate Dynamic SWF?
You can try following options from SWFtools
JPEG2SWF Takes one or more JPEG pictures and generates a SWF slideshow from them. Supports motion estimation compression (h.263) for better compression of video sequences.
PNG2SWF Like JPEG2SWF, only for PNGs.
GIF2SWF Converts GIFs to SWF. Also able to handle animated gifs.
Here is what I did :
Install the as3 compiler (mxmlc)
Run the command mxmlc.exe sample.as3 using NativeProcess

How to extract the shape of MovieClip?

We have a flash application that we are planning on converting to javascript. It's a pretty simple map application with an image as the background and a bunch of simple polygon movie clips that represent destinations on the map.
I would like to iterate through each movie clip and extract the shape into an array of x,y points to redraw the polygon using an external javascript function.
Is this possible with actionscript?
If you want to export the shape coordinates at author time, you can do try the JSFL script recommented by #strille or this one or export transparent images (if that's not too limiting for your application).
If you need to export the shapes at runtime, you can use the awesome as3swf library to decompile the swf and export the shapes. Have a look at the ShapeExport wiki as there are couple of handy exporters for js like JSCanvasShapeExporter and the more generic JSONShapeExporter
There are ways you can read the coordinates from an SWF. For instance, I've written a parser in PHP (link). Getting the data doesn't help though, as it turns out. The Flash painting model is different enough from the HTML5 one enough to make transfer exceeding difficult. The main obstacle I discovered is that in Flash, a path can be filled with two fill styles: one for area enclosed by the path, the other for enclosed area considered to be "outside" by the even-odd rule (e.g. the pentagon in the middle of a star). Since the HTML5 canvas let you specify only one fill style, you can't redraw shapes from Flash accurately. I was trying to create a tool that extract shapes as SVG and was getting a lot of gap and holes in the result.
Flash Player 11.6 introduced readGraphicsData() which does exactly what you ask for.
If you need to target an earlier version, then there's no simple way to read shape coordinates from a display object with ActionScript at runtime unfortunately.
If you just want to extract the shape coordinates once someone has written a jsfl script for Flash CS3 which looks like it might be able to help you out.

AS3 Hittest with Illustrator path

I export a path from Illustrator to an .swf file. I import this file using the Loader class in actionscript 3.
Now I want to perform a collision test on this path in Flash. Is this possible? Now as3 performs this test on the whole bounds of the swf file. I only need the path. Is this possible?
It works good as long you not use any transparacy effects in Illustrator which you want to export, which not are compatible with swf.
There are two settings in ai exporting non compatible effects to swf file.
Appearance: which will make a bitmap under the swf, which make the hittestarea to a square.
Editability: will remake the effects so good as the can to swf, which should possible still keep the polygon hittestarea, but it didnt work for me.
Yes that's possible. BitmapData.hitTest will help you (take a look at e.g. this)