Put

From Bennu Wiki
Jump to: navigation, search


Definition

INT put ( <INT fileID> , <INT graphID> , <INT x> , <INT y> )

Draws (blits) a graph onto the background.

For more advanced blitting, see:

Parameters

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

Returns

INT : true

Notes

The x and y parameters denote where to draw the graph, that is, where the center of the to be drawn graph will be.

Errors

Unsupported color depth - The origin graph's color depth is greater than the destination graph's.

Example

import "mod_map"
import "mod_screen"
import "mod_key"

Process Main()
Private
    int map;
Begin

    // Create a new graph of size 100x100 and color depth of 8bit
    map = map_new(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);

    Repeat
        frame;
    Until(key(_ESC))

End

Used in example: map_new(), map_clear(), put(), key()

This will result in something like:

New map.png
Putting a new map


Mod_screen
Globals None
Imported:
DumptypeFadingFpsFrametimeFullscreenGraphmodeM7RestoretypeScalemodeScaleresolutionScaleresolutionaspectratioScaleresolutionorientation
Constants None
Imported:
BACKGROUNDBABLENDBALPHABHMIRRORBNOCOLORKEYBSBLENDBTRANSLUCENTBVMIRRORCOMPLETEDUMPCOMPLETERESTORECSCREENDOUBLEBUFFERHWSURFACEM1024X768M1280X1024M320X200M320X240M320X400M360X240M376X282M400X300M512X384M640X400M640X480M800X600MODE16BITSMODE16BPPMODE2XSCALEMODE8BITSMODE8BPPMODEDOUBLEBUFFERMODEFRAMELESSMODEFULLSCREENMODEHARDWAREMODEMODALMODEWAITVSYNCMODEWINDOWNORESTOREPARTIALDUMPPARTIALRESTORESCALEHQ2XSCALENOFILTERSCALENONESCALENORMAL2XSCALESCALE2XSCALESCANLINE2XSCREEN
Locals None
Imported:
AngleCnumberCtypeSpecial:Badtitle/NS108:FileFlagsHeightRegionResolutionSizeSizexSizeyXXgraphYZ
Functions Put()Regiondefine()Regionout()Screenclear()Screenget()Screenput()Xput()