Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Hide / Show Image
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
MasterCard




PostPosted: 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)
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: 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.
TokenHerbz




PostPosted: Sat Aug 29, 2015 8:47 pm   Post subject: RE:Hide / Show Image

i believe it gives better framerates also.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: