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

Map put pixel

From FenixWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 01:17, 26 April 2007 (edit)
Sandman (Talk | contribs)
m (Example)
← Previous diff
Revision as of 01:34, 1 May 2007 (edit) (undo)
Sandman (Talk | contribs)
m (Throws - -> Errors)
Next diff →
Line 23: Line 23:
'''INT''' : [[true]] '''INT''' : [[true]]
-== Throws ==+== Errors ==
{| {|
| Invalid map || - Map doesn't exist. | Invalid map || - Map doesn't exist.

Revision as of 01:34, 1 May 2007


Contents

Definition

INT map_put_pixel ( <INT fileID> , <INT graphID> , <INT x> , <INT y> , <INT color> )

Draws a single colored pixel on a graph.

Parameters

INT fileID - The file that holds the graph.
INT graphID - The graph to draw on.
INT x - Where on the graph's x-axis to put the pixel.
INT y - Where on the graph's y-axis to put the pixel.
INT color - What color to draw.

Returns

INT : true

Errors

Invalid map - Map doesn't exist.
Unsupported colordepth - Destination graph is of an unsupported colordepth.

Example

Program awesome;
Begin

    set_mode(640,480,16);
    
    graph=new_map(100,100,16);
    map_clear(0,graph,rgb(255,0,0)); //makes the graphic a red square
    x=320;
    y=240;

    map_put_pixel(0,graph,50,50,rgb(255,255,255)); //puts a white pixel in the center of the graphic

    Loop
  
        frame;
    End
End

Used in example: set_mode(), new_map(), map_clear()

Personal tools