FileID

From Bennu Wiki
Jump to navigation Jump to search


Definition

FileID

A FileID is an identifier associated with a certain file (FPG). It is returned by load_fpg(), when a file is loaded to memory and can be used in many functions, wanting a FileID, for example map_put() or start_scroll(). A FileID can also be assigned to the local variable file of a process or function, which will make the process in question look in that file (FPG) for the graphic, associated with the GraphID specified by the process' graph local variable.

Notes

You can fill out 0 for the FileID to target the system file, for graphics with an ID of 1000 or higher, which are graphics created on the fly.

Example

Program files;
Global
    int file_id;
Begin

    // Load FPG
    file_id = load_fpg("example.fpg");

    // Set locals for display of graph
    file = file_id;
    graph = 1;
    x = y = 50;

    Repeat
        frame;
    Until(key(_frame))

End

Used in example: load_fpg(), key(), file, graph