Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,369 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Can't figure out how to remove a panel #349105
12/04/10 01:39
12/04/10 01:39
Joined: Nov 2010
Posts: 21
E
elegant_mistake Offline OP
Newbie
elegant_mistake  Offline OP
Newbie
E

Joined: Nov 2010
Posts: 21
Hi everybody.

I'm adding some things to the "wizard duel" game from the LiteC tutorials.

I added a panel (pTest_pan) with a button that appears before the game. The button must be clicked to start the game.

I can't figure out how to remove the panel and button after the game has started. They stay on the screen.

I tried "ptr_remove" and reset(pTest_pan, SHOW) to no success. Am I missing something really simple?

Thanks for all your help by the way. I am learning 3dgs quickly thanks to all of you.




Last edited by elegant_mistake; 12/04/10 01:43.

I need to come up with a better signature
Re: Can't figure out how to remove a panel [Re: elegant_mistake] #349110
12/04/10 02:31
12/04/10 02:31
Joined: Dec 2009
Posts: 256
USA , NY
msmith2468 Offline
Member
msmith2468  Offline
Member

Joined: Dec 2009
Posts: 256
USA , NY
You must turn the visibility flag off. its going to look something like this

Panel_Name.flags &= ~SHOW;

this should turn the panel and its buttons off.
also look up flags in the manual.


Mikes Wicked Games

www.mikeswickedgames.com
Re: Can't figure out how to remove a panel [Re: elegant_mistake] #349118
12/04/10 04:13
12/04/10 04:13
Joined: Nov 2010
Posts: 21
E
elegant_mistake Offline OP
Newbie
elegant_mistake  Offline OP
Newbie
E

Joined: Nov 2010
Posts: 21
Thanks man, but I'm still doing something wrong. I get undeclared identifier errors when I compile it. I guess I'll try again tomorrow.

Here is the relevant section of my code if anybody wants to give some advice, but no big whoop either way.

p.s. What's the best way to post code on the forums?

function main()
{
screen_size.x = 800; screen_size.y = 600; screen_color.blue = 150;
mouse_mode = 4;
PANEL* pTest_pan =
{
bmap = "main.pcx";
pos_x = 250;
pos_y = 200;

button(100, 100, start_button.bmp, start_button.bmp, start_button.bmp, game, null, null);
flags = OVERLAY | SHOW;

}
}


function game()
{
pTest_pan.flags &= ~SHOW;
level_load("shooter.wmb");

while(1)
{
if(winner == 1)
draw_text("Well done! Red wins!", 10, 10, vector(50, 50, 255));
else if(winner == 2)
draw_text("Ouch! Green wins!", 10, 10, vector(50, 255, 50));

wait(1);
}

}

Last edited by elegant_mistake; 12/04/10 04:14.

I need to come up with a better signature
Re: Can't figure out how to remove a panel [Re: elegant_mistake] #349150
12/04/10 12:31
12/04/10 12:31
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Why is your PANEL definition inside the main function?! That's why your identifier (pTest_pan) is unknown in your game function. Use [code ] and [/code ] without the spaces to post code.

Code:
PANEL* pTest_pan =
{
	bmap = "main.pcx";
	pos_x = 250;
	pos_y = 200;

	button(100, 100, start_button.bmp, start_button.bmp, start_button.bmp, game, null, null);
	flags = OVERLAY | SHOW;

}

function main()
{
	screen_size.x = 800; screen_size.y = 600; screen_color.blue = 150;
	mouse_mode = 4;
}


function game()
{
	pTest_pan.flags &= ~SHOW;
	level_load("shooter.wmb");

	while(1)
	{
		if(winner == 1)
		draw_text("Well done! Red wins!", 10, 10, vector(50, 50, 255));
		else if(winner == 2)
		draw_text("Ouch! Green wins!", 10, 10, vector(50, 255, 50)); 

		wait(1);
	}

}




"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Can't figure out how to remove a panel [Re: Superku] #349179
12/04/10 17:29
12/04/10 17:29
Joined: Nov 2010
Posts: 21
E
elegant_mistake Offline OP
Newbie
elegant_mistake  Offline OP
Newbie
E

Joined: Nov 2010
Posts: 21
Hey thanks. That made it work. Now I am slightly less retarded than I was yesterday. This is a good thing.


I need to come up with a better signature

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