Android Open Source - Flumpgdx Movie Maker






From Project

Back to project page Flumpgdx.

License

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.

Java Source Code

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;
  }
  

}




Java Source Code List

com.flumpgdx.FlumpGDX.java
com.flumpgdx.IOSLauncher.java
com.flumpgdx.android.AndroidLauncher.java
com.flumpgdx.client.GwtLauncher.java
com.flumpgdx.desktop.DesktopLauncher.java
com.flumpgdx.display.FlumpAnimation.java
com.flumpgdx.display.FlumpDisplayBundle.java
com.flumpgdx.display.FlumpDisplayTexture.java
com.flumpgdx.display.FlumpDisplay.java
com.flumpgdx.display.TextureCache.java
com.flumpgdx.library.FlumpAtlas.java
com.flumpgdx.library.FlumpKeyFrame.java
com.flumpgdx.library.FlumpLayer.java
com.flumpgdx.library.FlumpLibraryFile.java
com.flumpgdx.library.FlumpMovie.java
com.flumpgdx.library.FlumpTextureGroup.java
com.flumpgdx.library.FlumpTextureRegion.java
com.flumpgdx.library.MovieMaker.java