hugo
hugo

Reputation: 3241

CreateJS : Handle Bitmaps

Using EaselJS (HTML Canvas framework, from CreateJS)

I have a tileset, and I need to draw a tilemap. So I assigned my tileset bitmap to each tile. But of course, each tile has to draw only a part of the tileset.

I figured out how to draw a part of a Bitmap (Bitmap.sourceRect), but it means I have to clone the tileset for each tile !

Coming from a Flash AS3 background, I chose this library because it is supposed to be similar, however it seems to be different for image handling (where this problem is adressed by using many Bitmap with one BitmapData).

Thanks.

Upvotes: 0

Views: 1358

Answers (1)

Lanny
Lanny

Reputation: 11294

Look into using a SpriteSheet and BitmapAnimation instead. There are examples in GitHub that can help.

https://github.com/CreateJS/EaselJS/blob/master/examples/SpriteSheet.html http://www.createjs.com/#!/EaselJS/demos/spritesheet

Upvotes: 1

Related Questions