kgibson Posted March 27, 2016 Share Posted March 27, 2016 I'm currently using version 2.4.4 Amador. I'm trying to debug a sprite but can't seem to get render or debug to work. I understand that phaser needs to be rendering using Phaser.CANVAS that I need to include the "render: render" function. My code looks like: render: function() { game.debug.spriteInfo(sprite, 32, 32); } but I've also tried: function render() { game.debug.spriteInfo(sprite, 32, 32); } Console log seems to suggest I'm creating the function the wrong way? Thanks in advance! Side note: my other main functions, preload, create, and update, all look like my first snippet and seem to work fine. Link to comment Share on other sites More sharing options...
megmut Posted March 28, 2016 Share Posted March 28, 2016 Can you share the whole file using pastebin or something? Depending on how you've setup your game state, i.e: with prototype, objects etc.. then you'd make your method or function different accordingly. I write my functions like this: render() { // -- // } Link to comment Share on other sites More sharing options...
kgibson Posted March 28, 2016 Author Share Posted March 28, 2016 Ah, yeah I guess that would be way more helpful if I just showed the the whole thing lol http://pastebin.com/Husi6rBY Link to comment Share on other sites More sharing options...
fillmoreb Posted March 28, 2016 Share Posted March 28, 2016 Well, you have a line in your code that says: game.debug.spriteInfo(sprite, 32, 32); However, you never define a variable called sprite. You probably meant to debug steve, right? Try replacing the sprite with steve: game.debug.spriteInfo(steve, 32, 32); Link to comment Share on other sites More sharing options...
Recommended Posts