Custom save names
inspiredevistate

Okay maybe I am just having a general brainfart here, but how do I allow the user to specify the name of the file s/he wants to save? I am reading the typed name into the buffer using readykey(). I am also using save_bitmap(filenamehere, eg, eg);

Thanks in adavance:)

LennyLen

If you've read the user input to a buffer called save_name, then:

save_bitmap(save_name, bmp, pal)

inspiredevistate

for example i've read into the buffer... called buffer

the user types "myfile"

then all I do is use save_bitmap(buffer, bmp, pal);

LennyLen
Quote:

then all I do is use save_bitmap(buffer, bmp, pal);

Yes. I'm also assuming that as you're adding the input to the buffer that you're checking for characters that aren't allowed in filenames (Windows doen't allow /\:*?"<>|, and I dont know about other OSes).

inspiredevistate

awesome, thank you!! :P

TeamTerradactyl

You can also use the standard Allegro file_select_ex which does the whole "keyboard input" thing for you...

Thread #588659. Printed from Allegro.cc