GPU T1 Buffer

A structure that can hold a buffer of characters and colors that can be displayed with a gpu

Functions

clone () → buffer : Struct<GPUT1Buffer>

Clones this buffer into a new struct

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Clone

Return Values
Name Type Description

Buffer buffer

Struct<GPUT1Buffer>

The clone of this buffer

copy (x : Int, y : Int, buffer : Struct<GPUT1Buffer>, textBlendMode : Int, foregroundBlendMode : Int, backgroundBlendMode : Int)

Copies the given buffer at the given offset of the upper left corner into this buffer.

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Copy

Parameters
Name Type Description

X x

Int

The x offset of the upper left corner of the buffer relative to this buffer

Y y

Int

The y offset of the upper left corener of the buffer relative to this buffer

Buffer buffer

Struct<GPUT1Buffer>

The buffer from wich you want to copy from

Text Blend Mode textBlendMode

Int

The blend mode that is used for the text. 0 = Overwrite this with the content of the given buffer 1 = Overwrite with only characters that are not ' ' 2 = Overwrite only were this characters are ' ' 3 = Keep this buffer

Foreground Color Blend Mode foregroundBlendMode

Int

The blend mode that is used for the foreground color. 0 = Overwrite with the given color 1 = Normal alpha composition 2 = Multiply 3 = Divide 4 = Addition 5 = Subtraction 6 = Difference 7 = Darken Only 8 = Lighten Only 9 = None

Background Color Blend Mode backgroundBlendMode

Int

The blend mode that is used for the background color. 0 = Overwrite with the given color 1 = Normal alpha composition 2 = Multiply 3 = Divide 4 = Addition 5 = Subtraction 6 = Difference 7 = Darken Only 8 = Lighten Only 9 = None

fill (x : Int, y : Int, width : Int, height : Int, character : String, foreground : Struct<Color>, background : Struct<Color>)

Draws the given character at all given positions in the given rectangle on-to the hidden screen buffer.

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Fill

Parameters
Name Type Description

X x

Int

The x coordinate at which the rectangle should get drawn. (upper-left corner)

Y y

Int

The y coordinate at which the rectangle should get drawn. (upper-left corner)

Width width

Int

The width of the rectangle.

Height height

Int

The height of the rectangle.

Character character

String

A string with a single character that will be used for each pixel in the range you want to fill.

Foreground foreground

Struct<Color>

The foreground color which will be used to fill the rectangle.

Background background

Struct<Color>

The background color which will be used to fill the rectangle.

get (x : Int, y : Int) → (c : String, foreground : Struct<Color>, background : Struct<Color>)

Allows to get a single pixel from the buffer at the given position

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Get

Parameters
Name Type Description

X x

Int

The x position of the character you want to get

Y y

Int

The y position of the character you want to get

Return Values
Name Type Description

Char c

String

The character at the given position

Foreground Color foreground

Struct<Color>

The foreground color of the pixel at the given position

Background Color background

Struct<Color>

The background color of the pixel at the given position

getSize () → (width : Float, height : Float)

Allows to get the dimensions of the buffer.

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Get Size

Return Values
Name Type Description

Width width

Float

The width of this buffer

Height height

Float

The height of this buffer

set (x : Int, y : Int, c : String, foreground : Struct<Color>, background : Struct<Color>) → done : Bool

Allows to set a single pixel of the buffer at the given position

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Set

Parameters
Name Type Description

X x

Int

The x position of the character you want to set

Y y

Int

The y position of the character you want to set

Char c

String

The character the pixel should have

Foreground Color foreground

Struct<Color>

The foreground color the pixel at the given position should have

Background Color background

Struct<Color>

The background color the pixel at the given position should have

Return Values
Name Type Description

Done done

Bool

True if the pixel got set successfully

setRaw (characters : String, foreground : Array<Float>, background : Array<Float>) → success : Bool

Allows to set the internal data of the buffer more directly.

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Set Raw

Parameters
Name Type Description

Characters characters

String

The characters you want to draw with a length of exactly width*height.

Foreground Color foreground

Array<Float>

The values of the foreground color slots for each character were a group of four values give one color. so the length has to be exactly width*height*4.

Background Color background

Array<Float>

The values of the background color slots for each character were a group of four values give one color. so the length has to be exactly width*height*4.

Return Values
Name Type Description

Success success

Bool

True if the raw data was successfully written

setSize (width : Float, height : Float)

Allows to set the dimensions of the buffer.

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Set Size

Parameters
Name Type Description

Width width

Float

The width this buffer should now have

Height height

Float

The height this buffer now have

setText (x : Int, y : Int, text : String, foreground : Struct<Color>, background : Struct<Color>)

Allows to write the given text onto the buffer and with the given offset.

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Set Text

Parameters
Name Type Description

X x

Int

The X Position at which the text should begin to get written.

Y y

Int

The Y Position at which the text should begin to get written.

Text text

String

The text that should get written.

Foreground foreground

Struct<Color>

The foreground color which will be used to write the text.

Background background

Struct<Color>

The background color which will be used to write the text.