Difference between revisions of "SCI Kernel Documentation/Resource Functions"
| Line 29: | Line 29: | ||
| | ||
| − | + | ==<br /> Resource Functions == | |
| + | |||
| + | Resources are the various components of a game: views, pictures, scripts, etc. and, except for the MEMORY resource, reside on disk, waiting to be loaded when needed. Resources are handled automatically by the kernel, but several functions are provided to allow the programmer a bit more control over how the handling is done. | ||
| + | |||
| + | ===<br /> (Load resType resID) === | ||
| + | |||
| + | <blockquote> | ||
| + | Loads a resource of type resType and ID (number) resID into hunk space. While any attempt to use a resource which is not loaded will cause the resource to be loaded, it is not generally a good idea to rely on this as it may cause a disk-access delay in the midst of a crucial animation sequence. It is best to do an explicit Load of all resources during the initialization phase of a room to insure that everything is in memory. The resource types are: | ||
| + | |||
| + | <blockquote> | ||
| + | VIEW<br /> | ||
| + | PICTURE<br /> | ||
| + | SCRIPT<br /> | ||
| + | TEXT<br /> | ||
| + | SOUND<br /> | ||
| + | MEMORY (used internally by the kernel)<br /> | ||
| + | VOCAB (used internally by the kernel)<br /> | ||
| + | FONT<br /> | ||
| + | CURSOR<br /> | ||
| + | </blockquote> | ||
| + | |||
| + | Example: (Load SCRIPT forest) loads the script whose number is in the variable forest into memory. | ||
| + | </blockquote> | ||
| + | |||
| + | ===<br /> (UnLoad resType resID) === | ||
| + | |||
| + | ---- | ||
| + | |||
| | ||
Revision as of 00:16, 3 December 2015
Resource Functions
Resources are the various components of a game: views, pictures, scripts, etc. and, except for the MEMORY resource, reside on disk, waiting to be loaded when needed. Resources are handled automatically by the kernel, but several functions are provided to allow the programmer a bit more control over how the handling is done.
(Load resType resID)
Loads a resource of type resType and ID (number) resID into hunk space. While any attempt to use a resource which is not loaded will cause the resource to be loaded, it is not generally a good idea to rely on this as it may cause a disk-access delay in the midst of a crucial animation sequence. It is best to do an explicit Load of all resources during the initialization phase of a room to insure that everything is in memory. The resource types are:
VIEW
PICTURE
SCRIPT
TEXT
SOUND
MEMORY (used internally by the kernel)
VOCAB (used internally by the kernel)
FONT
CURSOR
Example: (Load SCRIPT forest) loads the script whose number is in the variable forest into memory.
(UnLoad resType resID)
- Notes
< Previous: SCI OverviewNext: List Functions >