ed aggiungete questo come script.
Serve per lavorare con i file in generale, li apre e li utilizza.
Codice: Seleziona tutto
global.fname = get_open_filename("Tutti","");
ext = string(filename_ext(global.fname));
s = false;
f = false;
if ext = ".txt" or ext = ".rtf"
{
file = file_bin_open(global.fname,2);
str = file_text_read_string(file);
draw_text(10,10,str);
exit;
}
if ext = ".mp3" or ext = ".wav" && s = false
{
sound = sound_add(global.fname,0,s);
s = true;
sound_play(sound);
exit;
}
if ext = ".mp3" or ext = ".wav" && s = true
{
sound_replace(sound,global.fname,0,false);
global.scelta = "suono";
sound_play(sound);
exit;
}
if ext = ".jpg" or ext = ".png" or ext = ".gif" or ext = ".bmp" && f = false
{
sprite = sprite_add(global.fname,1,f,f,f,f,0,0);
f = true;
draw_sprite(sprite,false,10,10);
exit;
}
if ext = ".jpg" or ext = ".png" or ext = ".gif" or ext = ".bmp" && f = true
{
sprite_replace(argument2,global.fname,1,false,false,false,false,0,0);
draw_sprite(sprite,false,10,10);
exit;
}
Bè straziatevi un po anche con questo .