boxbox icon indicating copy to clipboard operation
boxbox copied to clipboard

Cannot get sprite sheet to render any sprites

Open qbm5 opened this issue 9 years ago • 0 comments

I cant seem to figure out how to render a sprite using a sprite sheet when creating entities

What I have tried

 var x = world.createEntity({
                            name: 'player' + getRandomInt(100, 100000),
                            x: baseX + pos.x,
                            y: baseY + pos.y,
                            height: 18,
                            width: 10,
                            friction: .3,
                            image: "assets/sprites.png",
                            spriteSheet: true,
                            spriteWidth: 10,
                            spriteHeight: 18,
                            spriteX: 425,
                            spriteY: 5,
                            fixedRotation: true,

                            restitution: 50
                       });

have also tried, for fun

 var x = world.createEntity({
                            name: 'player' + getRandomInt(100, 100000),
                            x: baseX + pos.x,
                            y: baseY + pos.y,
                            height: 18,
                            width: 10,
                            friction: .3,
                            spriteSheet: sheetImgObj,
                            spriteWidth: 10,
                            spriteHeight: 18,
                            spriteX: 425,
                            spriteY: 5,
                            fixedRotation: true,

                            restitution: 50
                       });

but all I get is empty sprites. Any help on this would be greatly appreciated

qbm5 avatar Mar 25 '16 02:03 qbm5