Jump to content

How to remove Text.


Rafus
 Share

Recommended Posts

I was going to suggest you just do:

game.world.remove(textThing);

but it threw an error :) So I fixed that in the dev branch and also added a Text.destroy function at the same time. Is now pushed to github.

 

Hi, I tried this, but it's not working.

1) I want to remove a bitmap font from the state, how to do that?

2) I want to change the text, normal text can use text.content = '', but bitmap font cannot, any idea how to change the text?

Link to comment
Share on other sites

kill and destroy do two different things.

 

kill halts rendering and sets the object into dead, but still existing. I.e. it can be recycled for future use without incuring the cost of creating the object again.

 

destroy kills everything to do with the object, references to game, input, etc. Use it when you want the object to be garbage collected.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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