Map put pixel

From Bennu Wiki
Jump to: navigation, search


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 color depth - Destination graph is of an unsupported colordepth.

Example

import "mod_video"
import "mod_map"
import "mod_screen"
import "mod_wm"
import "mod_draw"

Process Main()
Private
    int map;
    int i;
Begin

    // Set the mode to 16bit and some res
    set_mode(320,200,16);

    // Create a blue-ish square map
    map = new_map(100,100,16);
    map_clear(0,map,rgb(50,100,150));

    // Puts 100 yellow-ish pixels in random places in the graphic
    for(i=0; i<100; i++)
        map_put_pixel(0,map,rand(0,100),rand(0,100),rgb(255,255,55));
    end

    // Puts the map in the center of the screen
    put(0,map,160,100);

    Repeat
        frame;
    Until(exit_status)

End

Used in example: set_mode(), new_map(), map_clear(), map_put_pixel(), rand(), put()


Mod_draw
Globals None
Imported:
DumptypeFadingFpsFrametimeM7Restoretype
Constants None
Imported:
BACKGROUNDCOMPLETEDUMPCOMPLETERESTORECSCREENNORESTOREPARTIALDUMPPARTIALRESTORESCALEHQ2XSCALENOFILTERSCALENONESCALENORMAL2XSCALESCALE2XSCALESCANLINE2XSCREEN
Locals None
Imported:
AngleCnumberCtypeSpecial:Badtitle/NS108:FileFlagsHeightRegionResolutionSizeSizexSizeyXXgraphYZ
Functions Deletedraw()Drawbox()Drawcircle()Drawcurve()Drawfcircle()Drawline()Drawrect()Drawingalpha()Drawingcolor()Drawingmap()Drawingstipple()Drawingz()Getpixel()Mapgetpixel()Mapputpixel()Movedraw()Putpixel()