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 01:55, 1 May 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

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