This wiki is out of date, use the continuation of this wiki instead

New map

From FenixWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 15:46, 13 November 2007 (edit)
Sandman (Talk | contribs)
m
← Previous diff
Revision as of 15:50, 13 November 2007 (edit) (undo)
Sandman (Talk | contribs)
m
Next diff →
Line 5: Line 5:
'''INT''' new_map ( <'''INT''' width> , <'''INT''' height> , <'''INT''' depth> ) '''INT''' new_map ( <'''INT''' width> , <'''INT''' height> , <'''INT''' depth> )
-Creates a new [[graph]] and sets the color of all pixels to 0 (transparent).+Creates a new [[graphic]] and sets the color of all pixels to 0 (transparent).
== Parameters == == Parameters ==
Line 17: Line 17:
== Returns == == Returns ==
-'''INT''' : The [[graphID]] of the newly created graph.+'''INT''' : [[GraphID]]
{| {|
| 0 || - There was an error. | 0 || - There was an error.
|- |-
-| >0 || - The graphID.+| >0 || - The graphID of the newly created graphic.
|} |}
== Errors == == Errors ==
{| {|
-| Unsupported color depth || - The specified color depth is not supported.+| Unsupported color depth || - The specified color depth is not supported. ''(Console)''
|- |-
-| Insufficient memory || - There is insufficient memory available. This error doesn't occur often.+| Insufficient memory || - There is insufficient memory available. This error doesn't occur often. ''(Console)''
|} |}

Revision as of 15:50, 13 November 2007


Contents

Definition

INT new_map ( <INT width> , <INT height> , <INT depth> )

Creates a new graphic 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 : GraphID

0 - There was an error.
>0 - The graphID of the newly created graphic.

Errors

Unsupported color depth - The specified color depth is not supported. (Console)
Insufficient memory - There is insufficient memory available. This error doesn't occur often. (Console)

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:
new_map.PNG

Personal tools