Class Screen
Contains a set of tools to work with the screen information.
Inherited Members
Namespace: LemonUI
Assembly: LemonUI.SHVDN3.dll
Syntax
[Obsolete("Use the LemonUI.Tools and LemonUI.Math namespaces.")]
public static class Screen
Properties
View SourceAspectRatio
The Aspect Ratio of the screen resolution.
Declaration
public static float AspectRatio { get; }
Property Value
Type | Description |
---|---|
float |
CursorPositionRelative
The location of the cursor on screen between 0 and 1.
Declaration
public static PointF CursorPositionRelative { get; }
Property Value
Type | Description |
---|---|
PointF |
Resolution
Gets the actual Screen resolution the game is being rendered at.
Declaration
public static Size Resolution { get; }
Property Value
Type | Description |
---|---|
Size |
Methods
View SourceGetRealPosition(PointF)
Converts the specified position into one that is aware of SetElementAlignment(GFXAlignment, GFXAlignment).
Declaration
public static PointF GetRealPosition(PointF og)
Parameters
Type | Name | Description |
---|---|---|
PointF | og | The original 1080p based position. |
Returns
Type | Description |
---|---|
PointF | A new 1080p based position that is aware of the the Alignment. |
GetRealPosition(float, float)
Converts the specified position into one that is aware of SetElementAlignment(GFXAlignment, GFXAlignment).
Declaration
public static PointF GetRealPosition(float x, float y)
Parameters
Type | Name | Description |
---|---|---|
float | x | The 1080p based X position. |
float | y | The 1080p based Y position. |
Returns
Type | Description |
---|---|
PointF | A new 1080p based position that is aware of the the Alignment. |
IsCursorInArea(PointF, SizeF)
Checks if the cursor is inside of the specified area.
Declaration
public static bool IsCursorInArea(PointF pos, SizeF size)
Parameters
Type | Name | Description |
---|---|---|
PointF | pos | The start of the area. |
SizeF | size | The size of the area to check. |
Returns
Type | Description |
---|---|
bool | true if the cursor is in the specified bounds, false otherwise. |
Remarks
This function takes values scaled to 1080p and is aware of the alignment set via SET_SCRIPT_GFX_ALIGN.
IsCursorInArea(float, float, float, float)
Checks if the cursor is inside of the specified area.
Declaration
public static bool IsCursorInArea(float x, float y, float width, float height)
Parameters
Type | Name | Description |
---|---|---|
float | x | The start X position. |
float | y | The start Y position. |
float | width | The height of the search area from X. |
float | height | The height of the search area from Y. |
Returns
Type | Description |
---|---|
bool | true if the cursor is in the specified bounds, false otherwise. |
Remarks
This function takes values scaled to 1080p and is aware of the alignment set via SET_SCRIPT_GFX_ALIGN.
ResetElementAlignment()
Resets the alignment of the game elements.
Declaration
public static void ResetElementAlignment()
SetElementAlignment(Alignment, GFXAlignment)
Sets the alignment of game elements like ScaledRectangle, ScaledText and ScaledTexture.
Declaration
public static void SetElementAlignment(Alignment horizontal, GFXAlignment vertical)
Parameters
Type | Name | Description |
---|---|---|
Alignment | horizontal | The Horizontal alignment of the items. |
GFXAlignment | vertical | The vertical alignment of the items. |
SetElementAlignment(Alignment, GFXAlignment)
Sets the alignment of game elements like ScaledRectangle, ScaledText and ScaledTexture.
Declaration
public static void SetElementAlignment(Alignment horizontal, GFXAlignment vertical)
Parameters
Type | Name | Description |
---|---|---|
Alignment | horizontal | The Horizontal alignment of the items. |
GFXAlignment | vertical | The vertical alignment of the items. |
SetElementAlignment(Alignment, GFXAlignment)
Sets the alignment of game elements like ScaledRectangle, ScaledText and ScaledTexture.
Declaration
public static void SetElementAlignment(Alignment horizontal, GFXAlignment vertical)
Parameters
Type | Name | Description |
---|---|---|
Alignment | horizontal | The Horizontal alignment of the items. |
GFXAlignment | vertical | The vertical alignment of the items. |
SetElementAlignment(GFXAlignment, GFXAlignment)
Sets the alignment of game elements like ScaledRectangle, ScaledText and ScaledTexture.
Declaration
public static void SetElementAlignment(GFXAlignment horizontal, GFXAlignment vertical)
Parameters
Type | Name | Description |
---|---|---|
GFXAlignment | horizontal | The Horizontal alignment of the items. |
GFXAlignment | vertical | The vertical alignment of the items. |
SetElementAlignment(Alignment, GFXAlignment)
Sets the alignment of game elements like ScaledRectangle, ScaledText and ScaledTexture.
Declaration
public static void SetElementAlignment(Alignment horizontal, GFXAlignment vertical)
Parameters
Type | Name | Description |
---|---|---|
Alignment | horizontal | The Horizontal alignment of the items. |
GFXAlignment | vertical | The vertical alignment of the items. |
ShowCursorThisFrame()
Shows the cursor during the current game frame.
Declaration
public static void ShowCursorThisFrame()
ToAbsolute(float, float, out float, out float)
Converts a relative resolution into one scaled to 1080p.
Declaration
public static void ToAbsolute(float relativeX, float relativeY, out float absoluteX, out float absoluteY)
Parameters
Type | Name | Description |
---|---|---|
float | relativeX | The relative value of X. |
float | relativeY | The relative value of Y. |
float | absoluteX | The value of X scaled to 1080p. |
float | absoluteY | The value of Y scaled to 1080p. |
ToRelative(float, float, out float, out float)
Converts a 1080p-based resolution into relative values.
Declaration
public static void ToRelative(float absoluteX, float absoluteY, out float relativeX, out float relativeY)
Parameters
Type | Name | Description |
---|---|---|
float | absoluteX | The 1080p based X coord. |
float | absoluteY | The 1080p based Y coord. |
float | relativeX | The value of X converted to relative. |
float | relativeY | The value of Y converted to relative. |