Guest User

Untitled

a guest
Feb 24th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1.  
  2. //shows fixed up frames synced with frametime
  3. JSONArray frames = json.get("frames");
  4. if(frames == null)
  5. frames = new JSONArray();
  6. if(frames.size() == 0)
  7. frames = getDefaultFrames(img);//method you create to generate json frames from 0-end index of your buffered image array
  8. for(int i=0;i<frames.size();i++)
  9. {
  10. Object obj = frames.get(i);
  11. if(obj instanceof Integer)
  12. displayFrame((Integer)obj,getDefaultFrameTime(json),isInterPolate(json) );//vanilla method to display frame,frametime and default frame time returns json.get("frametime") if is null returns 0 is interpolate if null returns false if not null returns json.get("interpolate")
  13. else{
  14. JSONObect frame = (JSONObject)obj;
  15. displayFrame((Integer)frame.get("index"),(Integer) frame.get("time"),isInterPolate(json) );
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment