Map clear

From Bennu Wiki
Revision as of 03:05, 2 October 2008 by Sandman (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Definition

INT map_clear ( <INT fileID> , <INT graphID> , <WORD color> )

Clears a certain graph to a certain color.

Parameters

INT fileID - The file that holds the graphic.
INT graphID - The graphic to clear.
WORD color - The color used to clear.

Returns

INT : true

Notes

Instead of using map_clear() to clear the screen background, clear_screen() is recommended as it is a little bit faster.

Errors

Unsupported color depth - The specified graph has a not supported color depth.

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: new_map(), put()

This will result in something like:
http://wwwhome.cs.utwente.nl/~bergfi/fenix/wiki/new_map.PNG


Maps Functions
Get_pixel()Graphic_info()Graphic_set()Map_block_copy()Map_buffer()Map_clear()Map_clone()Map_del()Map_exists()Map_get_pixel()Map_info()Map_info_get()Map_info_set()Map_load()Map_name()Map_new()Map_put()Map_put_pixel()Map_save()Map_set_name()Map_unload()Map_xput()Map_xputnp()Pcx_load()Png_load()Png_save()Point_get()Point_set()Put_pixel()