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

New map

From FenixWiki

Jump to: navigation, search


Contents

[edit] Definition

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

Creates a new graphic, sets the color of all pixels to 0 (transparent) and puts it in the system file.

[edit] 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

[edit] Returns

INT : GraphID

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

[edit] 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)

[edit] 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


Maps Functions
Graphic_info() • Map_block_copy() • Map_clear() • Map_clone() • Map_put() • Map_put_pixel() • Map_xput() • Map_xputnp() • New_map() • Save_png() • Unload_map() •
Personal tools