Jump to content

Disappearing debug text


StarBright
 Share

Recommended Posts

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

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

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...