Uncaught TypeError (Sprite Sheet)

8 views
Skip to first unread message

Andrew Gribble

unread,
Aug 9, 2013, 5:18:14 PM8/9/13
to caa...@googlegroups.com
I keep getting an error after switching to a scene which contains several sprite sheets. LogCat reports it as:

"Uncaught TypeError: Cannot read property 'x' of undefined"

The line of code it references (" el.x, el.y,") is inside a function in SpriteImage.js:

 paintN:function (director, time, x, y) {

                var el = this.mapInfo[this.spriteIndex];

                director.ctx.drawImage(
                    this.image,
                    el.x, el.y,
                    el.width, el.height,
                    (this.offsetX + x) >> 0, (this.offsetY + y) >> 0,
                    el.width, el.height);

                return this;
            }

Any ideas why the variable el is being reported as undefined?
Has anyone else run into this issue?
Reply all
Reply to author
Forward
0 new messages