A file is a container for graphics, identified by a non-negative integer (0 or higher). It holds all information about the contained graphics (pixels, width, height, depth, name, etc). Each of these graphics have a unique identifier inside the file (positive int).
A file can be created for example by loading an FPG (Fichero Para Gráficos, meaning "file for graphics") into it, by using fpg_load(), which creates a new file with the graphics from the loaded FPG and returns a unique identifier. Another option is to create a new, empty one by using fpg_new(). Don't let the name fpg_new() fool you: fpg_new() has nothing to do with the filetype FPG. This is because the FPG format is only for files and not for internal use. There are more ways to load graphics into a file.
Don't forget to unload it with fpg_unload() after use.
import "mod_map" import "mod_grproc" import "mod_key" import "mod_wm" Global int file_id; int file_id2; End Process Main() Begin // Load FPG file_id = load_fpg("example.fpg"); file_id2 = load_fpg("example2.fpg"); // Set locals for display of graph file = file_id; graph = 1; x = y = 50; // assign Ship to use example2.fpg Ship(300,100,5,file_id2,1); // undefined in this sample Repeat frame; Until(key(_ESC)||exit_status) End
Media in example: example.fpg