Module core.display
T-Engine display API
Functions
FBOActive () | Check if Frame Buffer Objects are active. |
disableFBO () | Disable Frame Buffer Objects. |
drawQuad (x, y, w, h, r, g, b, a, txt) | Draw a rectangle. |
drawStringBlendedNewSurface (font, string, r, g, b) | Creates a SDL surface of an anti-aliased string, if possible. |
drawStringNewSurface (font, string, r, g, b) | Create a SDL surface of a string. |
forceRedraw () | Forces redrawing of the T-Engine display. |
fullscreen () | Toggle fullscreen mode. |
getModesList () | Find potential window sizes. |
getTextBlended () | Get the anti-aliasing status of fonts. |
loadImage (path) | Creates a SDL surface from an image. |
newFBO (width, height) | Creates a new frame buffer object (FBO). |
newFont (path, size) | Load a TrueType font. |
newSurface (width, height) | Create a new SDL surface. |
newTile (width, height, font, char, x, y, fr, fg, fb, br, bg, bb, alpha) | Create a new SDL surface based on a tile. |
setMouseCursor (ox, oy, surface_up, surface_down) | Set images for the mouse cursor. |
setTextBlended (status) | Set the anti-aliasing status of fonts. |
setWindowSize (width, height) | Set the window dimensions. |
setWindowTitle (title) | Set the window's title. |
size (width, height) | Set the fullscreen dimensions. |
Functions
- FBOActive ()
-
Check if Frame Buffer Objects are active.
Return value:
Boolean, true if FBOs are active. - disableFBO ()
- Disable Frame Buffer Objects.
- drawQuad (x, y, w, h, r, g, b, a, txt)
-
Draw a rectangle.
Parameters
- x: Horizontal offset to start the rectangle (in pixels).
- y: Vertical offset to start the rectangle (in pixels).
- w: Width in pixels.
- h: Height in pixels.
- r: Red color (0-255).
- g: Green color (0-255).
- b: Blue color (0-255).
- a: Alpha factor (0-1).
- txt: Optional OpenGL texture userdata.
- drawStringBlendedNewSurface (font, string, r, g, b)
-
Creates a SDL surface of an anti-aliased string, if possible.
Parameters
- font: TrueType font userdata.
- string: String to put on the surface.
- r: Red color of the font (0-255).
- g: Green color of the font (0-255).
- b: Blue color of the font (0-255).
Return value:
An SDL surface userdata. - drawStringNewSurface (font, string, r, g, b)
-
Create a SDL surface of a string.
Parameters
- font: TrueType font userdata.
- string: String to put on the surface.
- r: Red color of the font (0-255).
- g: Green color of the font (0-255).
- b: Blue color of the font (0-255).
Return value:
An SDL surface userdata. - forceRedraw ()
- Forces redrawing of the T-Engine display.
- fullscreen ()
- Toggle fullscreen mode.
- getModesList ()
-
Find potential window sizes.
Return value:
A table of tables containing {w=width, h=height}. - getTextBlended ()
- Get the anti-aliasing status of fonts.
- loadImage (path)
-
Creates a SDL surface from an image.
Parameters
- path: Image path relative to the module directory.
Return value:
An SDL surface. - newFBO (width, height)
-
Creates a new frame buffer object (FBO).
Parameters
- width: Width of the FBO (in pixels).
- height: Height of the FBO (in pixels).
Return value:
The FBO userdata. - newFont (path, size)
-
Load a TrueType font.
Parameters
- path: Font file path relative to the module directory.
- size: The font size.
Return value:
The font userdata. - newSurface (width, height)
-
Create a new SDL surface.
Parameters
- width: Surface width in pixels.
- height: Surface height in pixels.
Return value:
An SDL surface userdata. - newTile (width, height, font, char, x, y, fr, fg, fb, br, bg, bb, alpha)
-
Create a new SDL surface based on a tile.
Parameters
- width: Surface width in pixels.
- height: Surface height in pixels.
- font: A TrueType font userdata.
- char: An ASCII character to display in the tile.
- x: Horizontal offset to draw the character on the tile (in pixels).
- y: Vertical offset to draw the character on the tile (in pixels).
- fr: Foreground red color (0-255).
- fg: Foreground green color (0-255).
- fb: Foreground blue color (0-255).
- br: Background red color (0-255).
- bg: Background green color (0-255).
- bb: Background blue color (0-255).
- alpha: Alpha factor (0-1).
Return value:
An SDL surface userdata. - setMouseCursor (ox, oy, surface_up, surface_down)
-
Set images for the mouse cursor.
Parameters
- ox: Veritcal offset (in pixels) of the surface relative to the cursor position.
- oy:
- surface_up: SDL surface to use when the mouse button is up.
- surface_down: SDL surface to use when the mouse button is down.
- setTextBlended (status)
-
Set the anti-aliasing status of fonts.
Parameters
- status: Enable anti-aliasing if true.
- setWindowSize (width, height)
-
Set the window dimensions.
Parameters
- width: Width in pixels.
- height: Height in pixels.
- setWindowTitle (title)
-
Set the window's title.
Parameters
- title: The string to use as a title.
- size (width, height)
-
Set the fullscreen dimensions.
Parameters
- width: Width in pixels.
- height: Height in pixels.