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 stillen

Is there an equivalent to drawImage() for native canvas for impact? I thought that this would work, but it doesn't work as I would expect:
// Load an image
var img = new ig.Image( 'player.png' );

// Draw the whole image
img.draw( x, y );

I'm looking to add a video entity, but I can't seem to access drawImage() to work within the update of my entity and it look like ig.Image needs a direct path to an image, and won't let me place a video image.

1 decade ago by dominic

You can always access the Canvas context directly at ig.system.context. E.g.:

ig.system.context.drawImage( imageElement, x, y );

1 decade ago by stillen

Thanks Dominic,

I figured it out and actually wrote up a video entity in the code section of the site.
Page 1 of 1
« first « previous next › last »