Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by jul

Hello,

Is there an easy way to get the canvas ImageData object from the currentAnim property of an entity?

Cheers

1 decade ago by Joncom

Take a look at the draw method of the ig.Animation class (which currentAnim is an instance of). Look how the current frame is drawn to the canvas.

Use the same logic to draw the frame instead to an off-screen canvas. Then, call canvas.getImageData(...).
Page 1 of 1
« first « previous next › last »