GPU T1
Building Type |
| Build Gun | In Game |
|---|---|
|
|
This computer module is a GPU and allows you to render a character grid onto any kind of screen. Each character can have it’s own background and foreground color.
You can also change the resolution to up to 150x50 characters.
If the bound monitor allows for it, the GPU can also have user input like mouse clicks, keyboard key strokes or just simple mouse movement over the screen. "Touch input" by looking/clicking with the crosshair over/onto a screen in the world is also supported.
To define the color of a character, you need to set the currently used foreground and background color. All further character changes cause the changed character to have the currently used foreground and background colors. If you change the currently used foreground and background color, the color of the already drawn/changed characters wont change. (Until you draw them again)
When you do changes, those changes will only occur on a hidden buffer.
That means you need to call flush() after you have changes something and want to display it.
Interface
Parent |
Functions
Set Text setText (Int X x, Int Y y, String String str)
Draws the given text at the given position to the hidden screen buffer.
Flags |
RuntimeSync RuntimeParallel RuntimeAsync |
- Parameters
-
Name Type Description X
xInt
The x coordinate at which the text should get drawn.
Y
yInt
The y coordinate at which the text should get drawn.
String
strString
The text you want to draw on-to the buffer.
Set Size setSize (Int Width w, Int Height h)
Changes the size of the text-grid (and buffer).
Flags |
RuntimeSync RuntimeParallel |
- Parameters
-
Name Type Description Width
wInt
The width of the text-gird.
Height
hInt
The height of the text-grid.
Set Foreground Color setForeground (Float Red r, Float Green g, Float Blue b, Float Alpha a)
Changes the foreground color that is used for the next draw calls.
Flags |
RuntimeSync RuntimeParallel RuntimeAsync |
- Parameters
-
Name Type Description Red
rFloat
The red portion of the foreground color. (0.0 - 1.0)
Green
gFloat
The green portion of the foreground color. (0.0 - 1.0)
Blue
bFloat
The blue portion of the foreground color. (0.0 - 1.0)
Alpha
aFloat
The opacity of the foreground color. (0.0 - 1.0)
Set Buffer setBuffer (Struct(GPUT1Buffer) Buffer buffer)
Allows to change the back buffer of the GPU to the given buffer.
Flags |
RuntimeSync RuntimeParallel RuntimeAsync |
- Parameters
-
Name Type Description Buffer
bufferStruct(GPUT1Buffer)
The Buffer you want to now use as back buffer.
Set Background Color setBackground (Float Red r, Float Green g, Float Blue b, Float Alpha a)
Changes the background color that is used for the next draw calls.
Flags |
RuntimeSync RuntimeParallel RuntimeAsync |
- Parameters
-
Name Type Description Red
rFloat
The red portion of the background color. (0.0 - 1.0)
Green
gFloat
The green portion of the background color. (0.0 - 1.0)
Blue
bFloat
The blue portion of the background color. (0.0 - 1.0)
Alpha
aFloat
The opacity of the background color. (0.0 - 1.0)
Get Size getSize (Int Width w out, Int Height h out)
Returns the size of the text-grid (and buffer).
Flags |
RuntimeSync RuntimeParallel |
- Return Values
-
Name Type Description Width
wInt out
The width of the text-gird.
Height
hInt out
The height of the text-grid.
Get Screen getScreen (Object(Object) Screen screen out)
Returns the currently bound screen.
Flags |
RuntimeSync RuntimeParallel |
- Return Values
-
Name Type Description Screen
screenObject(Object) out
The currently bound screen.
Get Buffer getBuffer (Struct(GPUT1Buffer) Buffer buffer out)
Returns the back buffer as struct to be able to use advanced buffer handling functions. (struct is a copy)
Flags |
RuntimeSync RuntimeParallel RuntimeAsync |
- Return Values
-
Name Type Description Buffer
bufferStruct(GPUT1Buffer) out
The Buffer that is currently the back buffer.
Flush flush ()
Flushes the hidden screen buffer to the visible screen buffer and so makes the draw calls visible.
Flags |
RuntimeSync RuntimeParallel |
Fill fill (Int X x, Int Y y, Int DX dx, Int DY dy, String String str)
Draws the given character at all given positions in the given rectangle on-to the hidden screen buffer.
Flags |
RuntimeSync RuntimeParallel RuntimeAsync |
- Parameters
-
Name Type Description X
xInt
The x coordinate at which the rectangle should get drawn. (upper-left corner)
Y
yInt
The y coordinate at which the rectangle should get drawn. (upper-left corner)
DX
dxInt
The width of the rectangle.
DY
dyInt
The height of the rectangle.
String
strString
The character you want to use for the rectangle. (first char in the given string)
Signals
Screen Size Changed ScreenSizeChanged (Int old Width oldW, Int old Height oldH)
Triggers when the size of the text grid changed.
Flags |
|
- Parameters
-
Name Type Description old Width
oldWInt
The old width of the screen.
old Height
oldHInt
The old height of the screen.
On Mouse Up OnMouseUp (Int X x, Int Y y, Int Button btn)
Triggers when a mouse button got released.
Flags |
|
- Parameters
-
Name Type Description X
xInt
The x position of the cursor.
Y
yInt
The y position of the cursor.
Button
btnInt
The Button-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
On Mouse Move OnMouseMove (Int X x, Int Y y, Int Button btn)
Triggers when the mouse cursor moves on the screen.
Flags |
|
- Parameters
-
Name Type Description X
xInt
The x position of the cursor.
Y
yInt
The y position of the cursor.
Button
btnInt
The Button-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
On Mouse Down OnMouseDown (Int X x, Int Y y, Int Button btn)
Triggers when a mouse button got pressed.
Flags |
|
- Parameters
-
Name Type Description X
xInt
The x position of the cursor.
Y
yInt
The y position of the cursor.
Button
btnInt
The Button-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
On Key Up OnKeyUp (Int C c, Int Code code, Int Button btn)
Triggers when a key got released.
Flags |
|
- Parameters
-
Name Type Description C
cInt
The ASCII number of the character typed in.
Code
codeInt
The number code of the pressed key.
Button
btnInt
The Button-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
On Key Down OnKeyDown (Int C c, Int Code code, Int Button btn)
Triggers when a key got pressed.
Flags |
|
- Parameters
-
Name Type Description C
cInt
The ASCII number of the character typed in.
Code
codeInt
The number code of the pressed key.
Button
btnInt
The Button-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
On Key Character OnKeyChar (String Character c, Int Button btn)
Triggers when a character key got 'clicked' and essentially a character got typed in, usful for text input.
Flags |
|
- Parameters
-
Name Type Description Character
cString
The character that got typed in as string.
Button
btnInt
The Button-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
- Computer Modules
-
Drive Holder - GPU Base - GPU T1 - Internet Card - Network Card - Processor Lua - RAM - Screen Driver
- Buildings