I am just analyzing loading animations from a spritesheet(that i have taken from google after a search). But the sprite is having different size. It is having total 100 images. I am using easeljs
to load these sprites.Can I load sprites with diff size in easeljs
or do I need to use any tool to make sprites of same size?. I just tried one of the example link in stackoverflow
, but does not address my issue there. Thanks in advance
0
votes
1 Answers
-1
votes
If the frames of a spritesheet are of different sizes, use an array of frame definitions. Each definition is itself an array with 4 required and 3 optional entries, in the order: x, y, width, height, imageIndex, regX, regY. The first four entries are required and define the frame rectangle. The fifth specifies the index of the source image (defaults to 0). The last two specify the registration point of the frame.
frames: [
// x, y, width, height, imageIndex*, regX*, regY*
[64, 0, 96, 64],
[0, 0, 64, 64, 1, 32, 32]
// etc.
]