FINComputerGPUT2

Functions

drawBezier (p0 : Struct<Vector2D>, p1 : Struct<Vector2D>, p2 : Struct<Vector2D>, p3 : Struct<Vector2D>, thickness : Float, color : Struct<Color>)

Draws a Cubic Bezier Spline from one position to another with given control points, thickness and color.

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Draw Bezier

Parameters
Name Type Description

P0 p0

Struct<Vector2D>

The local position of the start point of the spline.

P1 p1

Struct<Vector2D>

The local position of the first control point.

P2 p2

Struct<Vector2D>

The local position of the second control point.

P3 p3

Struct<Vector2D>

The local position of the end point of the spline.

Thickness thickness

Float

The thickness of the line drawn.

Color color

Struct<Color>

The color of the line drawn.

drawBox (boxSettings : Struct<GPUT2DrawCallBox>)

Draws a box.

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Draw Box

Parameters
Name Type Description

Box Settings boxSettings

Struct<GPUT2DrawCallBox>

The settings of the box you want to draw.

drawLines (points : Array<Struct<Vector2D>>, thickness : Float, color : Struct<Color>)

Draws connected lines through all given points with the given thickness and color.

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Draw Lines

Parameters
Name Type Description

Points points

Array<Struct<Vector2D>>

The local points that get connected by lines one after the other.

thickness thickness

Float

The thickness of the lines.

Color color

Struct<Color>

The color of the lines.

drawRect (position : Struct<Vector2D>, size : Struct<Vector2D>, color : Struct<Color>, image : String, rotation : Float)

Draws a Rectangle with the upper left corner at the given local position, size, color and rotation around the upper left corner.

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Draw Rectangle

Parameters
Name Type Description

Position position

Struct<Vector2D>

The local position of the upper left corner of the rectangle.

Size size

Struct<Vector2D>

The size of the rectangle.

Color color

Struct<Color>

The color of the rectangle.

Image image

String

If not empty string, should be image reference that should be placed inside the rectangle.

Rotation rotation

Float

The rotation of the rectangle around the upper left corner in degrees.

drawSpline (start : Struct<Vector2D>, startDirections : Struct<Vector2D>, end_ : Struct<Vector2D>, endDirection : Struct<Vector2D>, thickness : Float, color : Struct<Color>)

Draws a Spline from one position to another with given directions, thickness and color.

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Draw Spline

Parameters
Name Type Description

Start start

Struct<Vector2D>

The local position of the start point of the spline.

Start Direction startDirections

Struct<Vector2D>

The direction of the spline of how it exists the start point.

End end_

Struct<Vector2D>

The local position of the end point of the spline.

End Directions endDirection

Struct<Vector2D>

The direction of how the spline enters the end position.

Thickness thickness

Float

The thickness of the line drawn.

Color color

Struct<Color>

The color of the line drawn.

drawText (position : Struct<Vector2D>, text : String, size : Int, color : Struct<Color>, monospace : Bool)

Draws some Text at the given position (top left corner of the text), text, size, color and rotation.

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Draw Text

Parameters
Name Type Description

Position position

Struct<Vector2D>

The position of the top left corner of the text.

Text text

String

The text to draw.

Size size

Int

The font size used.

Color color

Struct<Color>

The color of the text.

Monospace monospace

Bool

True if a monospace font should be used.

flush ()

Flushes all draw calls to the visible draw call buffer to show all changes at once. The draw buffer gets cleared afterwards.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Flush

getFontBaseline (size : Int, monospace : Bool) → ReturnValue : Int

Get offset from the bottom of the font height to the baseline.

Details

Flags

RuntimeSync MemberFunc

Display Name

Get Font Baseline

Parameters
Name Type Description

Size size

Int

Font size in points.

Monospace monospace

Bool

Whether to use monospace or normal font.

Return Values
Name Type Description

ReturnValue ReturnValue

Int

getFontBaselineBatch (size : Array<Int>, monospace : Array<Bool>) → ReturnValue : Array<Int>

Same as getFontBaseline, but optimized to perform multiple requests at once.

Details

Flags

RuntimeSync MemberFunc

Display Name

Get Font Baseline Batch

Parameters
Name Type Description

Size size

Array<Int>

Font size in points.

Monospace monospace

Array<Bool>

Whether to use monospace or normal font.

Return Values
Name Type Description

ReturnValue ReturnValue

Array<Int>

getFontHeight (size : Int, monospace : Bool) → ReturnValue : Int

Get height of a tallest glyph in a font, in pixels. When measuring text, its height is always equal to font height multiplied by number of text lines.

Details

Flags

RuntimeSync MemberFunc

Display Name

Get Font Height

Parameters
Name Type Description

Size size

Int

Font size in points.

Monospace monospace

Bool

Whether to use monospace or normal font.

Return Values
Name Type Description

ReturnValue ReturnValue

Int

getFontHeightBatch (size : Array<Int>, monospace : Array<Bool>) → ReturnValue : Array<Int>

Same as getFontHeight, but optimized to perform multiple requests at once.

Details

Flags

RuntimeSync MemberFunc

Display Name

Get Font Height Batch

Parameters
Name Type Description

Size size

Array<Int>

Font size in points.

Monospace monospace

Array<Bool>

Whether to use monospace or normal font.

Return Values
Name Type Description

ReturnValue ReturnValue

Array<Int>

measureText (text : String, size : Int, monospace : Bool) → ReturnValue : Struct<Vector2D>

Measures dimensions that a text will take when rendered. Respects selected font and font size. Does not take into account any transforms pushed onto a transform stack.

Details

Flags

RuntimeSync MemberFunc

Display Name

Measure Text

Parameters
Name Type Description

Text text

String

Text to measure.

Size size

Int

Font size in points.

Monospace monospace

Bool

Whether to use monospace or normal font.

Return Values
Name Type Description

ReturnValue ReturnValue

Struct<Vector2D>

measureTextBatch (text : Array<String>, size : Array<Int>, monospace : Array<Bool>) → ReturnValue : Array<Struct<Vector2D>>

Same as measureText, but optimized to perform multiple requests at once.

Details

Flags

RuntimeSync MemberFunc

Display Name

Measure Text Batch

Parameters
Name Type Description

Text text

Array<String>

Text to measure.

Size size

Array<Int>

Font size in points.

Monospace monospace

Array<Bool>

Whether to use monospace or normal font.

Return Values
Name Type Description

ReturnValue ReturnValue

Array<Struct<Vector2D>>

popClip ()

Pops the top most clipping zone from the clipping stack. The latest clipping zone on the stack gets removed first. (Last In, First Out)

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Pop Clipping Zone

popGeometry ()

Pops the top most geometry from the geometry stack. The latest geometry on the stack gets removed first. (Last In, First Out)

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Pop Geometry

pushClipRect (position : Struct<Vector2D>, size : Struct<Vector2D>)

Pushes a rectangle to the clipping stack. All subsequent drawcalls will be clipped to only be visible within this clipping zone and all previously pushed clipping zones. Be aware, only all draw calls, till this clipping zone gets pop’ed are getting clipped by it, previous draw calls (and draw calls after the pop) are unaffected by this.

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Push Clip Rectangle

Parameters
Name Type Description

Position position

Struct<Vector2D>

The local position of the upper left corner of the clipping rectangle.

Size size

Struct<Vector2D>

The size of the clipping rectangle.

pushClipPolygon (topLeft : Struct<Vector2D>, topRight : Struct<Vector2D>, bottomLeft : Struct<Vector2D>, bottomRight : Struct<Vector2D>)

Pushes a 4 pointed polygon to the clipping stack. All subsequent drawcalls will be clipped to only be visible within this clipping zone and all previously pushed clipping zones. Be aware, only all draw calls, till this clipping zone gets pop’ed are getting clipped by it, previous draw calls (and draw calls after the pop) are unaffected by this.

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Push Clipping Polygon

Parameters
Name Type Description

Top Left topLeft

Struct<Vector2D>

The local position of the top left point.

Top Right topRight

Struct<Vector2D>

The local position of the top right point.

Bottom Left bottomLeft

Struct<Vector2D>

The local position of the top right point.

Bottom Right bottomRight

Struct<Vector2D>

The local position of the bottom right point.

pushLayout (offset : Struct<Vector2D>, size : Struct<Vector2D>, scale : Float)

Pushes a layout to the geometry stack. All subsequent drawcalls will be transformed through all previously pushed geometries and this one. Be aware, only all draw calls, till this geometry gets pop’ed are transformed, previous draw calls (and draw calls after the pop) are unaffected by this.

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Push Layout

Parameters
Name Type Description

Offset offset

Struct<Vector2D>

The local translation (or offset) that is supposed to happen to all further drawcalls. Translation can be also thought as 'repositioning'.

Size size

Struct<Vector2D>

The scale that gets applied to the whole screen localy along both axis. No change in scale is 1.

Scale scale

Float

pushTransform (translation : Struct<Vector2D>, rotation : Float, scale : Struct<Vector2D>)

Pushes a transformation to the geometry stack. All subsequent drawcalls will be transformed through all previously pushed geometries and this one. Be aware, only all draw calls till, this geometry gets pop’ed are transformed, previous draw calls (and draw calls after the pop) are unaffected by this.

Details

Flags

RuntimeSync RuntimeParallel RuntimeAsync MemberFunc

Display Name

Push Transform

Parameters
Name Type Description

Translation translation

Struct<Vector2D>

The local translation that is supposed to happen to all further drawcalls. Translation can be also thought as 'repositioning'.

Rotation rotation

Float

The local rotation that gets applied to all subsequent draw calls. The origin of the rotation is the whole screens center point. The value is in degrees.

Scale scale

Struct<Vector2D>

The scale that gets applied to the whole screen localy along the (rotated) axis. No change in scale is (1,1).

Signals

OnKeyChar (String Character c, Int Modifiers modifiers)

Triggers when a character key got 'clicked' and essentially a character got typed in, usful for text input.

Details
Parameters
Name Type Description

Character c

String

The character that got typed in as string.

Modifiers modifiers

Int

The Modifiers-Bit-Field providing information about the key release event. Bits: 1th left mouse pressed 2th right mouse button pressed 3th ctrl key pressed 4th shift key pressed 5th alt key pressed 6th cmd key pressed

OnKeyDown (Int C c, Int Code code, Int Modifiers modifiers)

Triggers when a key got pressed.

Details
Parameters
Name Type Description

C c

Int

The ASCII number of the character typed in.

Code code

Int

The number code of the pressed key.

Modifiers modifiers

Int

The Modifiers-Bit-Field providing information about the key press event. Bits: 1th left mouse pressed 2th right mouse button pressed 3th ctrl key pressed 4th shift key pressed 5th alt key pressed 6th cmd key pressed

OnKeyUp (Int C c, Int Code code, Int Modifiers modifiers)

Triggers when a key got released.

Details
Parameters
Name Type Description

C c

Int

The ASCII number of the character typed in.

Code code

Int

The number code of the pressed key.

Modifiers modifiers

Int

The Modifiers-Bit-Field providing information about the key release event. Bits: 1th left mouse pressed 2th right mouse button pressed 3th ctrl key pressed 4th shift key pressed 5th alt key pressed 6th cmd key pressed

OnMouseDown (Struct<Vector2D> Position position, Int Modifiers modifiers)

Triggers when a mouse button got pressed.

Details
Parameters
Name Type Description

Position position

Struct<Vector2D>

The position of the cursor.

Modifiers modifiers

Int

The Modifier-Bit-Field providing information about the pressed button event. Bits: 1th left mouse pressed 2th right mouse button pressed 3th ctrl key pressed 4th shift key pressed 5th alt key pressed 6th cmd key pressed

OnMouseEnter (Struct<Vector2D> Position position, Int Modifiers modifiers)

Triggers when the mouse cursor enters the screen area.

Details
Parameters
Name Type Description

Position position

Struct<Vector2D>

The position of the cursor.

Modifiers modifiers

Int

The Modifiers-Bit-Field providing information about the move event. Bits: 1th left mouse pressed 2th right mouse button pressed 3th ctrl key pressed 4th shift key pressed 5th alt key pressed 6th cmd key pressed

OnMouseLeave (Struct<Vector2D> Position position, Int Modifiers modifiers)

Triggers when the mouse cursor leaves the screen area.

Details
Parameters
Name Type Description

Position position

Struct<Vector2D>

The position of the cursor.

Modifiers modifiers

Int

The Modifiers-Bit-Field providing information about the move event. Bits: 1th left mouse pressed 2th right mouse button pressed 3th ctrl key pressed 4th shift key pressed 5th alt key pressed 6th cmd key pressed

OnMouseMove (Struct<Vector2D> Position position, Int Modifiers modifiers)

Triggers when the mouse cursor moves on the screen.

Details
Parameters
Name Type Description

Position position

Struct<Vector2D>

The position of the cursor.

Modifiers modifiers

Int

The Modifiers-Bit-Field providing information about the move event. Bits: 1th left mouse pressed 2th right mouse button pressed 3th ctrl key pressed 4th shift key pressed 5th alt key pressed 6th cmd key pressed

OnMouseUp (Struct<Vector2D> Position position, Int Modifiers modifiers)

Triggers when a mouse button got released.

Details
Parameters
Name Type Description

Position position

Struct<Vector2D>

The position of the cursor.

Modifiers modifiers

Int

The Modifiers-Bit-Field providing information about the released button event. Bits: 1th left mouse pressed 2th right mouse button pressed 3th ctrl key pressed 4th shift key pressed 5th alt key pressed 6th cmd key pressed

OnMouseWheel (Struct<Vector2D> Position position, Float Wheel Delta wheelDelta, Int Modifiers modifiers)

Triggers when the mouse wheel rotates on the screen.

Details
Parameters
Name Type Description

Position position

Struct<Vector2D>

The position of the cursor.

Wheel Delta wheelDelta

Float

The delta value of how much the mouse wheel got moved.

Modifiers modifiers

Int

The Modifiers-Bit-Field providing information about the move event. Bits: 1th left mouse pressed 2th right mouse button pressed 3th ctrl key pressed 4th shift key pressed 5th alt key pressed 6th cmd key pressed