- This wiki is out of date, use the continuation of this wiki instead
Load pal
From FenixWiki
(Difference between revisions)
| Revision as of 23:09, 8 August 2007 (edit) 201.52.35.117 (Talk) (created the page) ← Previous diff |
Current revision (23:52, 8 August 2007) (edit) (undo) Sandman (Talk | contribs) (enhanced) |
||
| Line 1: | Line 1: | ||
| [[Category:functions]] | [[Category:functions]] | ||
| + | [[Category:palettes]] | ||
| ==Definition== | ==Definition== | ||
| - | load_pal ( <'''STRING''' filename>) | + | '''INT''' load_pal ( <'''STRING''' filename>) |
| Loads a color palette from a file. | Loads a color palette from a file. | ||
| - | The current palette is switched to the loaded one. Note that one can load a palette from | + | The current [[palette]] is switched to the loaded one. Note that one can load a palette from an 8bit [[FPG]] or [[MAP]] file (the remaining graphic data will not be loaded) or a [[PAL]] file. Since [[Fenix]] [[0.85]] the following filetypes can also be used to obtain the palette: [[FGC]], [[FBM]] and [[FPL]]. (''Need confirmation'') |
| == Parameters == | == Parameters == | ||
| {| | {| | ||
| - | | '''STRING''' filename || - The filename of the | + | | '''STRING''' filename || - The filename of the file that you wish to load the [[palette]] from (including extension and possible path). |
| + | |} | ||
| + | |||
| + | == Returns == | ||
| + | '''INT''' : Error. | ||
| + | {| | ||
| + | | -1 || - Error: could not open file; corrupt or truncated file; file doesn't contain palette information. | ||
| + | |- | ||
| + | | 0 || - Error: could not obtain filename; some [[FPL]] error. | ||
| + | |- | ||
| + | | 1 || - No error: [[palette]] was loaded with success. | ||
| |} | |} | ||
| Line 16: | Line 27: | ||
| <pre> | <pre> | ||
| Program example; | Program example; | ||
| - | |||
| Begin | Begin | ||
| - | load_pal(" | + | load_pal("example.pal"); |
| + | |||
| Loop | Loop | ||
| - | ... | ||
| frame; | frame; | ||
| End | End | ||
| + | |||
| End | End | ||
| </pre> | </pre> | ||
| - | Used in example: | ||
Current revision
Contents |
[edit] Definition
INT load_pal ( <STRING filename>)
Loads a color palette from a file.
The current palette is switched to the loaded one. Note that one can load a palette from an 8bit FPG or MAP file (the remaining graphic data will not be loaded) or a PAL file. Since Fenix 0.85 the following filetypes can also be used to obtain the palette: FGC, FBM and FPL. (Need confirmation)
[edit] Parameters
| STRING filename | - The filename of the file that you wish to load the palette from (including extension and possible path). |
[edit] Returns
INT : Error.
| -1 | - Error: could not open file; corrupt or truncated file; file doesn't contain palette information. |
| 0 | - Error: could not obtain filename; some FPL error. |
| 1 | - No error: palette was loaded with success. |
[edit] Example
Program example;
Begin
load_pal("example.pal");
Loop
frame;
End
End
