Class LemonUI::Screen
Contains a set of tools to work with the screen information.
Public Static Properties
| Type | Name |
|---|---|
| property float | AspectRatio The Aspect Ratio of the screen resolution. |
| property PointF | CursorPositionRelative The location of the cursor on screen between 0 and 1. |
Public Static Functions
| Type | Name |
|---|---|
| PointF | GetRealPosition (PointF og) Converts the specified position into one that is aware of SetElementAlignment(GFXAlignment, GFXAlignment). |
| PointF | GetRealPosition (float x, float y) Converts the specified position into one that is aware of SetElementAlignment(GFXAlignment, GFXAlignment). |
| bool | IsCursorInArea (PointF pos, SizeF size) Checks if the cursor is inside of the specified area. |
| bool | IsCursorInArea (float x, float y, float width, float height) Checks if the cursor is inside of the specified area. |
| void | ResetElementAlignment () Resets the alignment of the game elements. |
| void | SetElementAlignment (Alignment horizontal, GFXAlignment vertical) Sets the alignment of game elements like Elements.ScaledRectangle ,Elements.ScaledText andElements.ScaledTexture . |
| void | SetElementAlignment (GFXAlignment horizontal, GFXAlignment vertical) Sets the alignment of game elements like Elements.ScaledRectangle ,Elements.ScaledText andElements.ScaledTexture . |
| void | ShowCursorThisFrame () Shows the cursor during the current game frame. |
| void | ToAbsolute (float relativeX, float relativeY, out float absoluteX, out float absoluteY) Converts a relative resolution into one scaled to 1080p. |
| void | ToRelative (float absoluteX, float absoluteY, out float relativeX, out float relativeY) Converts a 1080p-based resolution into relative values. |
Public Static Properties Documentation
property AspectRatio
float LemonUI.Screen.AspectRatio;
property CursorPositionRelative
PointF LemonUI.Screen.CursorPositionRelative;
Public Static Functions Documentation
function GetRealPosition [1/2]
Converts the specified position into one that is aware of SetElementAlignment(GFXAlignment, GFXAlignment).
static PointF LemonUI::Screen::GetRealPosition (
PointF og
)
Parameters:
ogThe original 1080p based position.
Returns:
A new 1080p based position that is aware of the the Alignment.
function GetRealPosition [2/2]
Converts the specified position into one that is aware of SetElementAlignment(GFXAlignment, GFXAlignment).
static PointF LemonUI::Screen::GetRealPosition (
float x,
float y
)
Parameters:
xThe 1080p based X position.yThe 1080p based Y position.
Returns:
A new 1080p based position that is aware of the the Alignment.
function IsCursorInArea [1/2]
Checks if the cursor is inside of the specified area.
static bool LemonUI::Screen::IsCursorInArea (
PointF pos,
SizeF size
)
This function takes values scaled to 1080p and is aware of the alignment set via SET_SCRIPT_GFX_ALIGN.
Parameters:
posThe start of the area.sizeThe size of the area to check.
Returns:
true if the cursor is in the specified bounds, false otherwise.
function IsCursorInArea [2/2]
Checks if the cursor is inside of the specified area.
static inline bool LemonUI::Screen::IsCursorInArea (
float x,
float y,
float width,
float height
)
This function takes values scaled to 1080p and is aware of the alignment set via SET_SCRIPT_GFX_ALIGN.
Parameters:
xThe start X position.yThe start Y position.widthThe height of the search area from X.heightThe height of the search area from Y.
Returns:
true if the cursor is in the specified bounds, false otherwise.
function ResetElementAlignment
static void LemonUI::Screen::ResetElementAlignment ()
function SetElementAlignment [1/2]
Sets the alignment of game elements like Elements.ScaledRectangle ,Elements.ScaledText andElements.ScaledTexture .
static void LemonUI::Screen::SetElementAlignment (
Alignment horizontal,
GFXAlignment vertical
)
Parameters:
horizontalThe Horizontal alignment of the items.verticalThe vertical alignment of the items.
function SetElementAlignment [2/2]
Sets the alignment of game elements like Elements.ScaledRectangle ,Elements.ScaledText andElements.ScaledTexture .
static void LemonUI::Screen::SetElementAlignment (
GFXAlignment horizontal,
GFXAlignment vertical
)
Parameters:
horizontalThe Horizontal alignment of the items.verticalThe vertical alignment of the items.
function ShowCursorThisFrame
static void LemonUI::Screen::ShowCursorThisFrame ()
function ToAbsolute
Converts a relative resolution into one scaled to 1080p.
static inline void LemonUI::Screen::ToAbsolute (
float relativeX,
float relativeY,
out float absoluteX,
out float absoluteY
)
Parameters:
relativeXThe relative value of X.relativeYThe relative value of Y.absoluteXThe value of X scaled to 1080p.absoluteYThe value of Y scaled to 1080p.
function ToRelative
Converts a 1080p-based resolution into relative values.
static inline void LemonUI::Screen::ToRelative (
float absoluteX,
float absoluteY,
out float relativeX,
out float relativeY
)
Parameters:
absoluteXThe 1080p based X coord.absoluteYThe 1080p based Y coord.relativeXThe value of X converted to relative.relativeYThe value of Y converted to relative.
The documentation for this class was generated from the following file repos/LemonUI/LemonUI/Screen.cs