jdiego82 Posted December 1, 2013 Share Posted December 1, 2013 My code is showing: Phaser.AnimationParser.spriteSheet: width/height zero or width/height < given frameWidth/frameHeightUncaught TypeError: Cannot read property 'sourceSizeW' of null on the JS console My Code:var game = new Phaser.Game(1000, 600, Phaser.AUTO, "gameFrame", {preload: preload, create: create, update: update});var pirate;function preload(){ game.stage.backgroundColor = '#007236'; game.load.spritesheet('pirate', 'assets/spritesheet1.png', 92, 105, 9);}function create(){ pirate = game.add.sprite(300, 200, 'pirate'); pirate.animations.add('walk'); pirate.animations.play('walk', 20, true);}The spritesheet:http://imgur.com/YyFqUPv Link to comment Share on other sites More sharing options...
rich Posted December 1, 2013 Share Posted December 1, 2013 Attach your sprite sheet to the forum, because the one on imgur definitely wasn't 105px high (which is what your code is saying it should be). Link to comment Share on other sites More sharing options...
jdiego82 Posted December 1, 2013 Author Share Posted December 1, 2013 Nevermind, guys. I managed to solve this by changing the width and height parameters on the game.load.spritesheet function a bit. It seems like I managed to switch my width and height values. Anyway, thanks for the help, rich. I'm making my first Phaser game for my final school project, so this probably won't be my last post here. Link to comment Share on other sites More sharing options...
rich Posted December 1, 2013 Share Posted December 1, 2013 No worries, good luck! shawnbless 1 Link to comment Share on other sites More sharing options...
Ashish Posted May 22, 2018 Share Posted May 22, 2018 Same warning I am getting in my code What is the solution for this? And should I ask the new question on the forum?d Link to comment Share on other sites More sharing options...
samme Posted May 22, 2018 Share Posted May 22, 2018 @Ashish double-check your arguments in load.spritesheet. Link to comment Share on other sites More sharing options...
Ashish Posted May 22, 2018 Share Posted May 22, 2018 Hey, @samme thank you for your quick reply. Actually, I am loading two spritesheet game.load.spritesheet('button1', '../tileMap/location1.png', 50, 35); game.load.spritesheet('player','../tileMap/bot2.png',50,35); If I am loading only bot2.png(if locaton1.png is commented) It is working fine but after loading location1.png its giving warning.What can be the possible problem here? Link to comment Share on other sites More sharing options...
Recommended Posts