File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
packages/2d/src/Components Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,29 @@ interface GIFInterface extends AnimationAPI<HTMLImageElement> {
77 drawCurrentFrame ( context : CanvasRenderingContext2D , x ?: number , y ?: number ) : void ;
88}
99
10+ /**
11+ * A component which able you to play and manipulate gifs into hex-engine.
12+ * @example
13+ * import someGifFile from "./your.gif";
14+ *
15+ * export default function MyGif() {
16+ * useType(MyGif);
17+ *
18+ * const gif = useNewComponent(() => GIF({
19+ * url: someGifFile,
20+ * width: 200,
21+ * height: 200,
22+ * fps: 20,
23+ * loop: true
24+ * }));
25+ *
26+ * gif.play()
27+ *
28+ * useDraw((context) => {
29+ * gif.drawCurrentFrame(context);
30+ * });
31+ * }
32+ */
1033export default function GIF ( options : {
1134 url : string ,
1235 width : number ,
You can’t perform that action at this time.
0 commit comments