The Wayback Machine - https://web.archive.org/web/20201025153705/https://github.com/suchipi/hex-engine/issues/43
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

Comments

@suchipi
Copy link
Owner

@suchipi 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 });
  });
}
@EmilienLeroy EmilienLeroy mentioned this issue Apr 26, 2020
10 of 10 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.