Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (Ayumi, NewbieZorro, TipmyPip), 13,888 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Button in a Panel/ lite c #234411
11/02/08 20:19
11/02/08 20:19
Joined: Nov 2007
Posts: 60
D
darci Offline OP
Junior Member
darci  Offline OP
Junior Member
D

Joined: Nov 2007
Posts: 60
hi all,
i´ve got a problem. i made a button in a panel but this all in
the .wdl format

PANEL name_pan =
{//...........................................

bmap = "startgame.dds";
pos_x = 10;
pos_y = 10;
layer = 11;
button(0,0, "over.dds", "click.dds", "clickoff.dds",function, NULL, NULL);
flags = VISIBLE;

}

but in .c format it does not work, and i dont knwo how to make it right, because the helper show me only the .wdl sample frown

Re: Button in a Panel/ lite c [Re: darci] #234412
11/02/08 20:24
11/02/08 20:24
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
You forgot the star after PANEL. It's supposed to be "PANEL* name_pan = etc.".


Always learn from history, to be sure you make the same mistakes again...
Re: Button in a Panel/ lite c [Re: Uhrwerk] #234457
11/03/08 00:48
11/03/08 00:48
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
Quote:
button(0,0, "over.dds", "click.dds", "clickoff.dds",function, NULL, NULL);
and don't just put function, you need the name of the function that you're using
Code:
...
button(0,0, "over.dds", "click.dds", "clickoff.dds",fnc_thisone, NULL, NULL);
...
}

function fnc_thisone(){
 beep();
}


Re: Button in a Panel/ lite c [Re: MrGuest] #234549
11/03/08 14:51
11/03/08 14:51
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
also, i didnt know you could just say "image.dds"...
I might be wrong here, as i never tried that, but define them as BMAP* first, and then use the pointer there...

- Dennis


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Button in a Panel/ lite c [Re: Helghast] #234567
11/03/08 16:13
11/03/08 16:13
Joined: Nov 2007
Posts: 60
D
darci Offline OP
Junior Member
darci  Offline OP
Junior Member
D

Joined: Nov 2007
Posts: 60
yeah big THANKS ^^ ive found my problem

i hadnt a mouse
without

mouse_mode = 2;
mouse_map = mouse_bmp;

while (1)
{
mouse_pos.x = mouse_cursor.x;
mouse_pos.y = mouse_cursor.y;
wait(0.1);
}

it hadn´t work^^

Re: Button in a Panel/ lite c [Re: darci] #234753
11/04/08 15:40
11/04/08 15:40
Joined: Nov 2007
Posts: 60
D
darci Offline OP
Junior Member
darci  Offline OP
Junior Member
D

Joined: Nov 2007
Posts: 60
now one more question, if i have in one panel 3 buttons and i want to show only one of them how can i make the other invisible

and later i want to show the two invisible buttons and make the one visible again unvisible

have someone a idea how it works

Re: Button in a Panel/ lite c [Re: darci] #234949
11/05/08 11:39
11/05/08 11:39
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
have a look in the manual for button_toggle and button_state

Re: Button in a Panel/ lite c [Re: MrGuest] #235029
11/05/08 17:20
11/05/08 17:20
Joined: Nov 2007
Posts: 60
D
darci Offline OP
Junior Member
darci  Offline OP
Junior Member
D

Joined: Nov 2007
Posts: 60
great ^^

with every question i learn new things,

i make a school projetct now, and there will be more questions lieke that

^^ i hope for your help

Re: Button in a Panel/ lite c [Re: darci] #235190
11/06/08 13:09
11/06/08 13:09
Joined: Nov 2007
Posts: 60
D
darci Offline OP
Junior Member
darci  Offline OP
Junior Member
D

Joined: Nov 2007
Posts: 60
new problem frown

STRING* a_str = "text one";

TEXT* a_txt =
{//------------------------------------
pos_x = 180;
pos_y = 223;
layer = 4;
font = georgia_font;
string (a_str);
flags = VISIBLE;
}

PANEL* game_field_pan =
{//------------------------------------
pos_x = 509;
pos_y =223;
layer = 3;
bmap = "optionen.bmp";
button (10, 47, "on.bmp", "off.bmp", "over.bmp", NewText, NULL, NULL);
flags = /*OVERLAY*/ | VISIBLE;
}

function NewText()
{//------------------------------------
a_str ="text two";
}


i want to change with a button an existing text, but that script dont work smirk

Re: Button in a Panel/ lite c [Re: darci] #235320
11/07/08 00:14
11/07/08 00:14
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
try
Code:
str_cpy(a_str, "text two");
in function NewText()

Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | 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