Back to project page Flumpgdx.
The source code is released under:
Copyright (c) 2014 Daniyal Khan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Softw...
If you think the Android project Flumpgdx listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.flumpgdx.library; //from w w w. java 2s. co m import com.flumpgdx.display.FlumpAnimation; import com.flumpgdx.display.FlumpDisplay; public class MovieMaker { public static FlumpAnimation make(FlumpLibraryFile file, String name) { return make(file, name, null); } private static FlumpAnimation make(FlumpLibraryFile file, String name, FlumpLayer animLayer) { if (!file.animations.containsKey(name)) //someone goofed throw new IllegalArgumentException("FlumpLibraryFile does not contain the animation: " + name); //newly created animation FlumpAnimation animation = new FlumpAnimation(animLayer); FlumpMovie movieMold = file.animations.get(name); for (FlumpLayer layer: movieMold.layers) { String firstKeyFrameName = layer.keyframes[0].ref; if (firstKeyFrameName != null && file.animations.containsKey(firstKeyFrameName)) { //the layer is a reference to another animation, recursively create it here animation.addDisplay(make(file, firstKeyFrameName, layer)); } else if (firstKeyFrameName != null) { //regular layer, add it to the animation animation.addDisplay(new FlumpDisplay(layer)); } } if (movieMold.frameRate <= 0) animation.setframeRate(file.frameRate); else animation.setframeRate(movieMold.frameRate); return animation; } }