show/ hide an image ( panel)

Posted By: CItrok

show/ hide an image ( panel) - 01/13/10 22:03

Hi guys. I am newbie in lite-c and 3GS. I want to build an application in which a image to appear if pressing , let's say "S" and hide if pressing, "H".

I imagine is a function which handles this. Which is the function that show/hide a panel?

Thanks a lot!

---------------------------------

Bellow you may find the code from lite-c tutorials.



#include <acknex.h>
#include <default.c>

////////////////////////////////////////////////////////////////////

BMAP* first_pcx = "first.pcx"; // my first bmap

PANEL* first_pan = // my first panel
{
pos_x = 0;
pos_y = 0;
layer = 1;
bmap = first_pcx;
flags = OVERLAY | VISIBLE;
}

/////////////////////////////////////////////////////////////////////

function main()
{
video_mode = 7;
screen_color.blue = 150;
}
Posted By: Saturnus

Re: show/ hide an image ( panel) - 01/13/10 22:21

first_pan->flags |= SHOW; // show the panel
first_pan->flags &= ~SHOW; // hide the panel

You can also use the macros set and reset.
They do the very same thing but are probably easier to memorize:
set(first_pan, SHOW);
reset(first_pan, SHOW);

Search the manual for "Input events". There you will see how to assign functions to keys and so on (basically it's just 'on_key = function').
Posted By: CItrok

Re: show/ hide an image ( panel) - 01/13/10 22:26

Saturnus, Thank you very much. It works!

Danke schon!
© 2024 lite-C Forums