Skip to content

Class LemonUI::Screen

ClassList > 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:

  • og The 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:

  • x The 1080p based X position.
  • y The 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:

  • pos The start of the area.
  • size The 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:

  • x The start X position.
  • y The start Y position.
  • width The height of the search area from X.
  • height The 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:

  • horizontal The Horizontal alignment of the items.
  • vertical The 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:

  • horizontal The Horizontal alignment of the items.
  • vertical The 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:

  • relativeX The relative value of X.
  • relativeY The relative value of Y.
  • absoluteX The value of X scaled to 1080p.
  • absoluteY The 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:

  • absoluteX The 1080p based X coord.
  • absoluteY The 1080p based Y coord.
  • relativeX The value of X converted to relative.
  • relativeY The value of Y converted to relative.

The documentation for this class was generated from the following file repos/LemonUI/LemonUI/Screen.cs