Computer Science Canada

Hide / Show Image

Author:  MasterCard [ Wed Jul 01, 2015 12:24 am ]
Post subject:  Hide / Show Image

So I have images, and i want to add a play button before the game stars (game requires images).

How do i 'hide' the play image once it has been clicked.

Is there a sepcial thing called hide or something?

(Also for show)

Author:  Insectoid [ Wed Jul 01, 2015 5:06 am ]
Post subject:  RE:Hide / Show Image

If you're using sprites, there is a Sprite.Hide command. However, this will cause you more problems than it solves, and implementing a proper animation loop is much better in the long-term.

cls clears the entire screen. After you clear the screen, you redraw everything that needs to be drawn. Instead of hiding or erasing the picture, you just don't draw it again. This is an animation loop. In code, it looks like this:
code:

loop
    cls
    %draw all the images and text you want to show
    delay (10)
end loop


It might sound like more work to redraw everything every frame, but it really isn't. You do have to think about your program structure a little differently though.

Author:  TokenHerbz [ Sat Aug 29, 2015 8:47 pm ]
Post subject:  RE:Hide / Show Image

i believe it gives better framerates also.


: