Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 571 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
squik, AemStones, LucasJoshua, Baklazhan, Hanky27
19060 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Simple Panel #133136
06/01/07 23:04
06/01/07 23:04
Joined: Oct 2006
Posts: 179
ExtraCortex Offline OP
Member
ExtraCortex  Offline OP
Member

Joined: Oct 2006
Posts: 179
I have 10 or 30 or even 43242432 variables that can be set to 1 or 0

I want, when the player presses some key, to a panel to appear, with some choices, in this case are the things to appear in the radar.

I have to set the variables to 0 or 1, right. But now there's a problem..

How can i create a panel that, detects the choice the player clicks with the cursor and then activates/deactivates the variable according to the choice?

I never used panels..

Re: Simple Panel [Re: ExtraCortex] #133137
06/02/07 00:56
06/02/07 00:56
Joined: Mar 2007
Posts: 677
0x00000USA
M
MrCode Offline
User
MrCode  Offline
User
M

Joined: Mar 2007
Posts: 677
0x00000USA
Example: If you want it to open/close a window:

Define a panel that contains the first window's data.

Code:

bmap window1_bmp= "window1.bmp";

panel window1_pan
{
pos_x= x; // x and y being whatever you want
pos_y= y;
bmap= window1_bmp;
flags= visible, overlay; // use 'overlay' when you want to make all black parts transparent.
}



Then, define a second panel that contains the second window's data (be sure to add another bmap definition, though, ).

Code:

bmap window1_bmp= "window1.bmp";
bmap window2_bmp= "window2.bmp";

panel window1_pan
{
pos_x= x; // x and y being whatever you want
pos_y= y;
bmap= window1_bmp;
flags= visible, overlay; // use 'overlay' when you want to make all black parts transparent.
}

panel window2_pan
{
pos_x= x;
pos_y= y;
bmap= window2_bmp;
flags= visible, overlay;
}



Now you need to make a function that will toggle the visibility of the second window.

Code:

bmap window1_bmp= "window1.bmp";
bmap window2_bmp= "window2.bmp";

panel window1_pan
{
pos_x= x; // x and y being whatever you want
pos_y= y;
bmap= window1_bmp;
flags= visible, overlay; // use 'overlay' when you want to make all black parts transparent.
}

panel window2_pan
{
pos_x= x;
pos_y= y;
bmap= window2_bmp;
flags= visible, overlay;
}

function toggle_windows()
{
window2_pan.visible= (window2_pan.visible== off);
}



Next, define a button in the window1_pan definition that will execute the function.

Code:

bmap window1_bmp= "window1.bmp";
bmap window2_bmp= "window2.bmp";

panel window1_pan
{
pos_x= x; // x and y being whatever you want
pos_y= y;
button(x,y,"button_clicked.bmp","button_inactive.bmp","button_mouse_hover.bmp",toggle_windows,null,null);
bmap= window1_bmp;
flags= visible, overlay; // use 'overlay' when you want to make all black parts transparent.
}

panel window2_pan
{
pos_x= x;
pos_y= y;
bmap= window2_bmp;
flags= visible, overlay;
}

function toggle_windows()
{
window2_pan.visible= (window2_pan.visible== off);
}



And there you have it! A button in a window that toggles another window.


Code:
void main()
{
    cout << "I am MrCode,";
    cout << "hear me roar!";
    system("PAUSE");
}
Re: Simple Panel [Re: MrCode] #133138
06/02/07 04:35
06/02/07 04:35
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
You seem to need many panels, so I would rather take a look at pan_create() than defining all 30 or even more panels in code.

http://manual.conitec.net/pan_create.htm
http://manual.conitec.net/pan_remove.htm


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1