bmap_for_screen help

Posted By: DLively

bmap_for_screen help - 04/28/15 20:32

Code:
BMAP* screen_map = "emptypanel.pcx";
PANEL * testpan ={
	pos_x = 100;
	pos_y = 100;
	button = (0,0,screen_map, screen_map, screen_map, NULL,NULL,NULL);
	window = (0,0,400,300,screen_map, 0,0);
	flags = SHOW;
}
function grab_screen(BMAP* Bmap, var modify, var delay, STRING* Save_settings){
	bmap_for_screen (Bmap, modify, delay);  
	wait (1);  // wait 1 frame until the bitmap can be saved
	game_save ("savegame", 0, Save_settings);
}
on_q = grab_screen(screen_map, 1, 1, "SV_VARS + SV_BMAPS");

function grab_screen2(){
	bmap_for_screen (screen_map, 1, 1);   
	wait (1);  // wait 1 frame until the bitmap can be saved
	game_save ("savegame", 0, SV_VARS + SV_BMAPS);
}
on_z = grab_screen2;



Why Doesn't either of these methods work?
I don't get any syntax errors - But I also don't get any results :3

I basically pulled this from the manual and I'm trying to make it a bit more function-able..
Everything seems to be in order...

The bmap pointer is Valid
button and windows are set up
panel is visible
bmap was selected
vars were set
parameters were saved..... now what? grin

Shouldn't this have worked? or is there a #include file I need? Once again, I get no errors..


EDIT: grab_screen2(); will work fine if i hard code it. I want it to work with the press of keys as I shown above. is that possible?

EDIT2: I realize that
Code:
if(key_z) grab_screen2();

would work - But Im trying to avoid that.
Posted By: 3run

Re: bmap_for_screen help - 04/28/15 20:51

Originally Posted By: DLively
Code:
on_q = grab_screen(screen_map, 1, 1, "SV_VARS + SV_BMAPS");


You can't do this. There should be no brackets, when calling function on 'on_' key.
Posted By: DLively

Re: bmap_for_screen help - 04/28/15 20:57

@3run: thank you for your help. It is appreciated.
As much as I knew that, I still had to try and exhaust all options before getting to the final conclusion. -- On the offchance that someone pointed me in the correct direction for such a thing (If it was even possible, though I knew it likely 98% wasn't) I would have been happy with that as well.

Any chance someone knows why grab_screen2 Doesn't work with on_z?
© 2024 lite-C Forums