We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Can anyone help me figure out how to remove the stuff placed in the window generated by the G4P GUI Tool? I want to create a main menu for a game using this tool and then when a button is clicked (Whether it be the play button or the options button) I will be able to clear the window of all the stuff already there and draw a new set of stuff from the tool, or maybe just draw things straight from processing? Can't seem to figure out how to do this.
Thanks!
Answers
If you want to remove a control permanently then use markForRemoval for example if you have a button called btnDoThis then
alternatively simply make the control invisible e.g.
btnDoThis.setVisible(false);
which has the advantage of being able to reuse it by making it visible again.
BTW I have moved this discussion to Question about Libraries
OMG Thanks! That actually helped ALOT... I was looking for something like that but couldn't find it in the reference page.
Also, Can you help me out with the Sprites? I am trying to figure out how to switch the Sprites to a different drawing mode? Like CORNER/CORNERS/CENTER... I could not figure out how to do that either.
Thanks
Check the GAbstractControl class doces since all G4P controls inherit from this class so it holds most of the basic methods for controls. The other class to check out is G4P, some nifty global methods there e.g. G4P.setGlobalAlpha(...) to change the transparency for all controls.
Sprites library
For various practical reasons ALL sprites are positioned on their centre. There is no provision in the library to set their position based on their corners.
AH Alright, I guess I'll stick to what I'm doing and place them with an offset. Thanks for the help!
Hmmm.... I'm attempting to use markForRemoval() but getting a "The Function markForRemoval() does not exist" message.
Has this been replaced by another function in more recent versions?
I'm attempting to be more mindful of memory usage, so I'm wanting to create specific GUI assets on the fly.... and then removing them on an as needed basis.
Doing a couple like-named searches in the documentation, I found that "markForRemoval" had been renamed "markForDisposal" --- works as expected!