Screen get

From Bennu Wiki
Jump to: navigation, search


Definition

INT screen_get ( )

Creates a new graphic containing a copy of the lastly rendered frame.

The map will contain everything, including background, processes, drawings and text. Just like map_new(), the newly created graphic will be located in the System file (fileID of 0); the graphID will be returned. After the use of this graphic, it should be freed using map_unload().

Also called get_screen().

Returns

INT : GraphID

0 - Some error.
>0 - The GraphID of the graphic created.

Example

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

Global
    int my_map;
End

Process Main()
Begin
    Repeat
        if(key(_F5))
            my_map = screen_get();
            png_save(0,my_map,"snapshot.PNG");
            map_unload(0,my_map);
            while(key(_F5)) frame; end
        end
        frame;
    Until(key(_ESC))
End

Used in example: key(), screen_get(), png_save(), map_unload()


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()