- This wiki is out of date, use the continuation of this wiki instead
New map
From FenixWiki
(Difference between revisions)
| Revision as of 01:55, 1 May 2007 (edit) Sandman (Talk | contribs) ← Previous diff |
Revision as of 15:46, 13 November 2007 (edit) (undo) Sandman (Talk | contribs) m Next diff → |
||
| Line 17: | Line 17: | ||
| == Returns == | == Returns == | ||
| - | '''INT''' : The graphID of the newly created graph. | + | '''INT''' : The [[graphID]] of the newly created graph. |
| {| | {| | ||
| | 0 || - There was an error. | | 0 || - There was an error. | ||
| Line 26: | Line 26: | ||
| == Errors == | == Errors == | ||
| {| | {| | ||
| - | | Unsupported color depth || - The specified color depth is not supported | + | | Unsupported color depth || - The specified color depth is not supported. |
| + | |- | ||
| + | | Insufficient memory || - There is insufficient memory available. This error doesn't occur often. | ||
| |} | |} | ||
Revision as of 15:46, 13 November 2007
Contents |
Definition
INT new_map ( <INT width> , <INT height> , <INT depth> )
Creates a new graph and sets the color of all pixels to 0 (transparent).
Parameters
| INT width | - The width of the to be created graph in pixels. |
| INT height | - The height of the to be created graph in pixels. |
| INT depth | - The color depth of the to be created graph in bits |
Returns
INT : The graphID of the newly created graph.
| 0 | - There was an error. |
| >0 | - The graphID. |
Errors
| Unsupported color depth | - The specified color depth is not supported. |
| Insufficient memory | - There is insufficient memory available. This error doesn't occur often. |
Example
Program a_map_is_born;
Private
int map;
Begin
// Create a new graph of size 100x100 and color depth of 8bit
map = new_map(100,100,8);
// Clear the map red
map_clear(0,map,rgb(255,0,0));
// Put it in the center of the screen
put(0,map,160,100);
Loop
frame;
End
End
Used in example: map_clear(), put()
This will result in something like:
