Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //shows fixed up frames synced with frametime
- JSONArray frames = json.get("frames");
- if(frames == null)
- frames = new JSONArray();
- if(frames.size() == 0)
- frames = getDefaultFrames(img);//method you create to generate json frames from 0-end index of your buffered image array
- for(int i=0;i<frames.size();i++)
- {
- Object obj = frames.get(i);
- if(obj instanceof Integer)
- 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")
- else{
- JSONObect frame = (JSONObject)obj;
- displayFrame((Integer)frame.get("index"),(Integer) frame.get("time"),isInterPolate(json) );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment