StarBright Posted February 14, 2016 Share Posted February 14, 2016 Can anyone tell me what it means when debug text appears and then immediately vanishes? I can see it for a split second, so I assume the function I'm testing is in fact being called, except then the text disappears. If it helps, the function in question is repeatedly called by an update function. Link to comment Share on other sites More sharing options...
in mono Posted February 14, 2016 Share Posted February 14, 2016 Debug text should go in render(). Is it there in your case? If it isn't for example a boolean in your state or a property of an object that you want continuously displayed, I'd go with console.log() (called from the beginning of the method you're interested in). Link to comment Share on other sites More sharing options...
StarBright Posted February 15, 2016 Author Share Posted February 15, 2016 I should mention that it's only a particular instance of debug text that this is happening with--I'm using debug text in other places and it appears normally. Link to comment Share on other sites More sharing options...
StarBright Posted February 15, 2016 Author Share Posted February 15, 2016 Also console.log isn't working for me for some reason. Link to comment Share on other sites More sharing options...
littlebuddy98 Posted February 15, 2016 Share Posted February 15, 2016 Can you show us your code so we can have a look ? And also your console.log should be in the update function if you haven't already got that. Link to comment Share on other sites More sharing options...
in mono Posted February 15, 2016 Share Posted February 15, 2016 What's different about this particular instance then? How to interpret "console.log isn't working"? What happens if you type in just "console.log" in the console? It may be overridden (i.e. an empty function assigned to it). Link to comment Share on other sites More sharing options...
StarBright Posted February 15, 2016 Author Share Posted February 15, 2016 Some of the instances of debug text that are disappearing are in function dropToMat, in class TableItem which inherits Phaser.Sprite. TableItem's constructor contains the line this.events.onDragStop.add(this.dropToMat,this); and then dropToMat is supposed to be called when the sprite is dragged and dropped. Actually, the other instances that are appearing and then vanishing are also the ones that should appear when the sprite is dragged and dropped. I don't know why they're only appearing for that half-second, though. I think I might be in a catch-22 situation where the bug I'm trying to fix is causing this problem with the debug text, which I'm trying to use to fix the bug... Link to comment Share on other sites More sharing options...
Recommended Posts