Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposed frames object. #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Of note to the developer, libjs.gif contains a class SuperGif, which can be used

#### getters
* **get_canvas** - The canvas element that the gif is playing in. Handy for assigning event handlers to.
* **get_frames** - The list of frames objects, containing an `ImageData` instance and a `delay` amount.
* **get_playing** - Whether or not the gif is currently playing
* **get_loading** - Whether or not the gif has finished loading/parsing
* **get\_auto_play** - Whether or not the gif is set to play automatically
Expand Down
2 changes: 2 additions & 0 deletions libgif.js
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@
playing: playing,
move_relative: stepFrame,
current_frame: function() { return i; },
frames: function() { return frames },
length: function() { return frames.length },
move_to: function ( frame_idx ) {
i = frame_idx;
Expand Down Expand Up @@ -917,6 +918,7 @@
move_to: player.move_to,

// getters for instance vars
get_frames : function() { return player.frames() },
get_playing : function() { return playing },
get_canvas : function() { return canvas },
get_canvas_scale : function() { return get_canvas_scale() },
Expand Down