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

Animated GIF component #43

Open
suchipi opened this issue Apr 12, 2020 · 0 comments
Open

Animated GIF component #43

suchipi opened this issue Apr 12, 2020 · 0 comments
Labels
2d Related to @hex-engine/2d good first issue Good for newcomers help wanted Extra attention is needed

Comments

@suchipi
Copy link
Owner

suchipi commented Apr 12, 2020

It would be nice to have a component that can expose the frames of an animated GIF image using the Animation interface; I'm picturing something like this:

import { useType, useNewComponent, GIF, useDraw } from "@hex-engine/2d";
import someGifFile from "./whatever.gif";

function MyComponent() {
  useType(MyComponent);

  const gif = useNewComponent(() => GIF(someGifFile));
  gif.play(); // `gif` has the same interface as AnimationAPI

  useDraw((context) => {
    gif.drawCurrentFrame(context, { x: 0, y: 0 });
  });
}
@suchipi suchipi added 2d Related to @hex-engine/2d good first issue Good for newcomers help wanted Extra attention is needed labels Apr 12, 2020
@EmilienLeroy EmilienLeroy mentioned this issue Apr 26, 2020
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2d Related to @hex-engine/2d good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant