Skip to content

Class LemonUI::Tools::Extensions

ClassList > LemonUI > Tools > Extensions

Extensions for converting values between relative and scaled.

Public Static Functions

Type Name
PointF ToRelative (this PointF point)
Converts a scaled 1080p-based position into a relative one.
SizeF ToRelative (this SizeF size)
Converts a scaled 1080p-based position into a relative one.
PointF ToScaled (this PointF point)
Converts a relative 0-1 position into a scaled one.
SizeF ToScaled (this SizeF size)
Converts a relative 0-1 position into a scaled one.
float ToXRelative (this float x)
Converts the scaled X or Width to a relative one.
float ToXScaled (this float x)
Converts the relative X or Width float to a scaled one.
float ToYRelative (this float y)
Converts the scaled Y or Height to a relative one.
float ToYScaled (this float y)
Converts the relative Y or Height float to a scaled one.

Public Static Functions Documentation

function ToRelative [1/2]

Converts a scaled 1080p-based position into a relative one.

static PointF LemonUI::Tools::Extensions::ToRelative (
    this PointF point
) 

Parameters:

  • point The scaled PointF.

Returns:

A new PointF with relative values.

function ToRelative [2/2]

Converts a scaled 1080p-based position into a relative one.

static SizeF LemonUI::Tools::Extensions::ToRelative (
    this SizeF size
) 

Parameters:

  • size The scaled SizeF.

Returns:

A new SizeF with relative values.

function ToScaled [1/2]

Converts a relative 0-1 position into a scaled one.

static PointF LemonUI::Tools::Extensions::ToScaled (
    this PointF point
) 

Parameters:

  • point The relative PointF.

Returns:

A new PointF with scaled values.

function ToScaled [2/2]

Converts a relative 0-1 position into a scaled one.

static SizeF LemonUI::Tools::Extensions::ToScaled (
    this SizeF size
) 

Parameters:

  • size The relative SizeF.

Returns:

A new SizeF with scaled values.

function ToXRelative

Converts the scaled X or Width to a relative one.

static float LemonUI::Tools::Extensions::ToXRelative (
    this float x
) 

Parameters:

  • x The value to convert.

Returns:

A relative float between 0 and 1.

function ToXScaled

Converts the relative X or Width float to a scaled one.

static float LemonUI::Tools::Extensions::ToXScaled (
    this float x
) 

Parameters:

  • x The float to convert.

Returns:

A scaled float.

function ToYRelative

Converts the scaled Y or Height to a relative one.

static float LemonUI::Tools::Extensions::ToYRelative (
    this float y
) 

Parameters:

  • y The value to convert.

Returns:

A relative float between 0 and 1.

function ToYScaled

Converts the relative Y or Height float to a scaled one.

static float LemonUI::Tools::Extensions::ToYScaled (
    this float y
) 

Parameters:

  • y The float to convert.

Returns:

A scaled float.


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