Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

This will be a quick blog but two things I wanted to share that I haven't really seen after searching on google for awhile is that if you have a Texture or Label or something else added into the stage and you want to temporarily remove it, you can just call stage.getActors().removeValue("name of variable you want to remove", true); and it is set to true meaning you want to remove it. I'm sure that there is a better method to remove an item from the stage or to just not render it but this was the best solution I could find. And one other thing that I did not know until yesterday is that when you create a ClickListener for a button, where an event occurs when you press on the button, it is best to put the method that this event is created in into the constructor so that it is created once and then it runs each time the button is clicked. The reason why I wanted to mention this was that I was having trouble clicking on a button and it would fire an event a few times instead of just once because I had the method in the update method of my code where it would be called each frame instead of just once.

Hope this helps others.