I have a button that has a function for writing text but i was wondering what do i have to write so it takes the current sprite off the screen and replace it with a different sprite.
Here is the code
now i have a sprite called Egg and a sprite called EggC if i Egg is on the screen already what do i need to write to remove Egg and place EggC onto the screen.
goalrex: normally you have to keep drawing stuff if you want it to keep showing up on the screen. If at any point you stop drawing, then it will stop showing. This is accomplished by codea by having the draw() function be called 60 times per second. If in any of those times you don’t draw the sprite, then for that 1/60 second period, the image will not show. Anyway, the wiki has more detailed explanations.
It’s sort of hard to tell without seeing the rest of the code.
I guess you made a button class.
Possibly you could make a self.active that defaults to true for button:init() and have an “if self.active then” in you button:draw() and button:touched() functions. button1.action would have to set button1.active to false to stop drawing.