Module UI
Donxon UI module.
This module contains the functionality for scripts running on the client.
It can be used in script files registered in the "ui" array of project.json.
Data Structures
| .uiGetCenterPositionOption | The UI:GetCenterPosition options. |
Functions
| GetScreenRelativePosition ([x=0[, y=0]]) | Gets screen's relative position calculated from absolute position. |
| GetScreenAbsolutePosition ([x=0.0[, y=0.0]]) | Gets screen's absolute position calculated from relative position. |
| GetCenterPosition ([x[, y[, width[, height]]]]) | Gets center position on the screen. |
| GetDeltaTime () | Gets the delta time. |
Tables
| ALIGN | Text alignment. |
| UI.FONT.SMALL | Small font table. |
| UI.FONT.MEDIUM | Medium font table. |
| UI.FONT.LARGE | Large font table. |
| UI.FONT.VERYLARGE | Very Large font table. |
Classes
| Rectangle | UI Rectangle class. |
| ProgressBar | UI Progress Bar class. |
| HUDText | UI HUD Text class. |
| TextMenu | UI Text Menu class. |
| ScreenFade | UI Screen Fade class. |
| BarTime | UI BarTime class. |
Data Structures
- .uiGetCenterPositionOption
-
The UI:GetCenterPosition options.
- x int The value of X. (optional)
- y int The value of Y. (optional)
- width int Width. (optional)
- height int Height. (optional)
Functions
- GetScreenRelativePosition ([x=0[, y=0]])
-
Gets screen's relative position calculated from absolute position.
Parameters:
- x number or table The value of X. | The vector-compatible table. (default 0)
- y
number
The value of Y (Ignored if
xis table). (default 0)
Returns:
-
Common.Vector2D
The relative position.
- GetScreenAbsolutePosition ([x=0.0[, y=0.0]])
-
Gets screen's absolute position calculated from relative position.
Parameters:
- x number or table The value of X (-1 = center position). | The vector-compatible table. (default 0.0)
- y
number
The value of Y (-1 = center position)(Ignored if
xis table). (default 0.0)
Returns:
-
Common.Vector2D
The absolute position.
- GetCenterPosition ([x[, y[, width[, height]]]])
-
Gets center position on the screen.
Parameters:
- x number or .uiGetCenterPositionOption The value of X. | The options table. (optional)
- y
number
The value of Y (Ignored if
xis option table). (optional) - width
number
Width (Ignored if
xis option table). (optional) - height
number
Height (Ignored if
xis option table). (optional)
Returns:
-
Common.Vector2D
The center position.
- GetDeltaTime ()
-
Gets the delta time.
Returns:
-
number
The delta time.
Tables
- ALIGN
-
Text alignment.
Fields:
- LEFT Left text alignment.
- CENTER Center text alignment.
- RIGHT Right text alignment.
- UI.FONT.SMALL
-
Small font table.
Fields:
- font Font type.
- height Font height.
- UI.FONT.MEDIUM
-
Medium font table.
Fields:
- font Font type.
- height Font height.
- UI.FONT.LARGE
-
Large font table.
Fields:
- font Font type.
- height Font height.
- UI.FONT.VERYLARGE
-
Very Large font table.
Fields:
- font Font type.
- height Font height.
Classes
- Rectangle
-
UI Rectangle class.
For drawing rectangles.
- Rectangle UI.Rectangle
- ProgressBar
-
UI Progress Bar class.
For drawing progress bars.
- ProgressBar UI.ProgressBar
- HUDText
-
UI HUD Text class.
For drawing HUD texts.
- HUDText UI.HUDText
- TextMenu
-
UI Text Menu class.
To displays text menus.
This class should be ignored. Use Game.TextMenu class instead.
- TextMenu UI.TextMenu
- ScreenFade
-
UI Screen Fade class.
To fades the screen.
- ScreenFade UI.ScreenFade
- BarTime
-
UI BarTime class.
To displays progress bar similar to C4 planting/defusing progress bar.
- BarTime UI.BarTime