Hi! Today i'm publishing my Flump runtime for LÖVE2D.
For those who don't know it, Flump allows to export animations made in Flash into a texture + json format.
This allows for smooth animation, low memory footprint, and generally makes it possible to follow a Flash-based workflow when working with LÖVE.
You can find the library here: https://github.com/sixFingers/lump
You find Flump tools here: https://github.com/tconkling/flump
I'm available for support and suggestions, just open an issue / PR on Github.
Flash animation in LÖVE
-
- Party member
- Posts: 730
- Joined: Sat Apr 26, 2014 7:46 pm
Re: Flash animation in LÖVE
Your lib is dependent on globals. I did not try it out yet but looking at the code you use globals and the lib depends on globals. Both of which is generally not good design for a library. The library will not work as is in a new project.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Flash animation in LÖVE
Also, not really familiar with what kind of transforms are in flash, but löve does support shearing, and i believe you can "combine" transforms to get what you want, within one lg.push level; granted it needs a bit more math than just manually giving all values of a 4x4 matrix, but should still be possible.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
-
- Prole
- Posts: 11
- Joined: Thu Jun 30, 2016 12:07 pm
Re: Flash animation in LÖVE
Hi bobbyjones, thanks for your comments. The library has been extracted from a game of mine, and still needs some work. Take it as a first, very rough iteration. Some things i'm already fixing are:bobbyjones wrote:Your lib is dependent on globals. I did not try it out yet but looking at the code you use globals and the lib depends on globals. Both of which is generally not good design for a library. The library will not work as is in a new project.
- collapse the library in a single file
- try to fix that "globals" problem. As it is now, the two globals being utilized are JSON and Class. I'm still not sure if it's worth it to incorporate both; i may let the developer take care of decoding JSON, so he/she can choose which JSON library to use; while i don't really know how to remove the dependency on Class. Any suggestion is really welcomed.
-
- Prole
- Posts: 11
- Joined: Thu Jun 30, 2016 12:07 pm
Re: Flash animation in LÖVE
Yep, i know, but after a long while, i couldn't find a way to calculate it. The strangeness begins with Flash, which exports rotation _and_ skew in just two values (instead of three). I really think it's possible, but was unable to come up with a solution. Again, any hints are really appreciatedzorg wrote:Also, not really familiar with what kind of transforms are in flash, but löve does support shearing, and i believe you can "combine" transforms to get what you want, within one lg.push level; granted it needs a bit more math than just manually giving all values of a 4x4 matrix, but should still be possible.
- AntonioModer
- Party member
- Posts: 202
- Joined: Fri Jun 15, 2012 5:31 pm
- Location: Belarus
- Contact:
Re: Flash animation in LÖVE
You could just use Class Commons; it's a set of common features/API supported by a variety of libraries, so the user can just use any one of those and your lib should just work.intAligned wrote:while i don't really know how to remove the dependency on Class. Any suggestion is really welcomed.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Flash animation in LÖVE
Do you have any pointer to the file format where these values are specified?intAligned wrote:Yep, i know, but after a long while, i couldn't find a way to calculate it. The strangeness begins with Flash, which exports rotation _and_ skew in just two values (instead of three). I really think it's possible, but was unable to come up with a solution. Again, any hints are really appreciated
-
- Prole
- Posts: 11
- Joined: Thu Jun 30, 2016 12:07 pm
Re: Flash animation in LÖVE
pgimeno, Flump exports a plain JSON. You can find a non-modified, standard Flump json in the demo directory at the link I provided. That's the very same file read by all other runtimes available for other languages. What Flump does is reading transforms from the SWF you publish from Flash. So the problem is inherent to Flash itself. More info on the issue can be deduced from https://github.com/tconkling/flump/issues/6. If you want to play and see if you get it working, again the demo is enough, as it has some skews, which my runtime can't handle. As an hint, you can detect which frames are skewing by looking at the values for the "rotation" field. When they're different, one of them (always the same, still can't figure it out) is the rotation, the other the skew. If they're equal, there's no skew but just rotation.pgimeno wrote:Do you have any pointer to the file format where these values are specified?intAligned wrote:Yep, i know, but after a long while, i couldn't find a way to calculate it. The strangeness begins with Flash, which exports rotation _and_ skew in just two values (instead of three). I really think it's possible, but was unable to come up with a solution. Again, any hints are really appreciated
Re: Flash animation in LÖVE
I don't have any Flash testcases to experiment with, sorry. I'd like to know what the two values are for:
- a figure without any rotation
- a figure with a 30° rotation
- a figure where the vertical axis remains vertical, but the horizontal axis is rotated by 30°
- 0 and 0 for a figure with a 0° rotation
- 0.523 and 0.523 for a figure with a 30° rotation
- 0.523 and 0 for the rhomboidal figure described above
Who is online
Users browsing this forum: No registered users and 1 guest