Jeffrey.K.
Jeffrey.K.

Reputation: 127

Create a Sprite from raw RGBa data

I take several snapshots from playing video on canvas and thus getting raw RGB images into memory.

In the documentations its states that Sprite class accepts a Spritesheet instance only.

Upvotes: 0

Views: 167

Answers (1)

gskinner
gskinner

Reputation: 2488

You just need to construct a SpriteSheet using your Image instances. See the docs for details:

http://createjs.com/Docs/EaselJS/classes/SpriteSheet.html

SpriteSheet supports multiple source images, so each frame could be a separate image.

Alternatively, if you want to combine a bunch of frames into a single, more efficient source image and produce a SpriteSheet from it, you should look at using SpriteSheetBuilder. There are some simple examples of this with EaselJS, and of course docs:

http://createjs.com/Docs/EaselJS/classes/SpriteSheetBuilder.html

Upvotes: 0

Related Questions