Вопрос

I am sorry that this may be a stupid thing not to understand but believe it or not as clever as some of you programmers are, not all programmers can just rely on a name? Not ranting there btw.

My question is, what is meant by the image index with the spritesheet class's example? I cannot seem to see any documentation for this. So please could someone tell me what it is reffering to? Does it mean the index of the sprite frame in the animations? I am not sure of that because I am thinking that it may add the indexing for you, depending on the order of the rectangles defined in the array of spritesheet frames.

I am reffering to this snippet of code:

 frames: [
            // x, y, width, height, imageIndex, regX, regY
            [0,0,64,64,0,32,64],
            [64,0,96,64,0]
        ]

This was sourced from http://www.createjs.com/Docs/EaselJS/classes/SpriteSheet.html.

Thanks for your time

Это было полезно?

Решение

It says in the comment right above the lines you copied:

// The 5th value is the image index per the list defined in "images" (defaults to 0).

This quite clearly explains that the index refers to the item in the images array, the one that points to one or more image files.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top