Show / Hide Table of Contents

Struct Scale

Represents a scaling.

Implements
IEquatable<Scale>
Inherited Members
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: RGB.NET.Core
Assembly: RGB.NET.Core.dll
Syntax
public readonly struct Scale : IEquatable<Scale>

Constructors

| Edit this page View Source

Scale(float)

Initializes a new instance of the Scale class using the provided values.

Declaration
public Scale(float scale = 1)
Parameters
Type Name Description
float scale

The value used for horizontal and vertical scaling. 0 if not set.

| Edit this page View Source

Scale(float, float)

Initializes a new instance of the Scale class using the provided values.

Declaration
public Scale(float horizontal, float vertical)
Parameters
Type Name Description
float horizontal

The value used for horizontal scaling.

float vertical

The value used for vertical scaling.

Properties

| Edit this page View Source

Horizontal

Gets the horizontal scaling value.

Declaration
public float Horizontal { get; }
Property Value
Type Description
float
| Edit this page View Source

Vertical

Gets the vertical scaling value.

Declaration
public float Vertical { get; }
Property Value
Type Description
float

Methods

| Edit this page View Source

Deconstruct(out float, out float)

Deconstructs the scale into the horizontal and vertical value.

Declaration
public void Deconstruct(out float horizontalScale, out float verticalScale)
Parameters
Type Name Description
float horizontalScale

The horizontal scaling value.

float verticalScale

The vertical scaling value.

| Edit this page View Source

Equals(Scale)

Tests whether the specified Scale is equivalent to this Scale.

Declaration
public bool Equals(Scale other)
Parameters
Type Name Description
Scale other

The scale to test.

Returns
Type Description
bool

true if other is equivalent to this Scale; otherwise, false.

| Edit this page View Source

Equals(object?)

Tests whether the specified object is a Scale and is equivalent to this Scale.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
object obj

The object to test.

Returns
Type Description
bool

true if obj is a Scale equivalent to this Scale; otherwise, false.

Overrides
ValueType.Equals(object)
| Edit this page View Source

GetHashCode()

Returns a hash code for this Scale.

Declaration
public override int GetHashCode()
Returns
Type Description
int

An integer value that specifies the hash code for this Scale.

Overrides
ValueType.GetHashCode()
| Edit this page View Source

ToString()

Converts the Horizontal and Vertical value of this Scale to a human-readable string.

Declaration
public override string ToString()
Returns
Type Description
string

A string that contains the Horizontal and Vertical value of this Scale. For example "[Horizontal: 1, Vertical: 0.5]".

Overrides
ValueType.ToString()

Operators

| Edit this page View Source

operator +(Scale, float)

Returns a new Scale representing the addition of the Scale and the provided value.

Declaration
public static Scale operator +(Scale scale, float value)
Parameters
Type Name Description
Scale scale

The Scale.

float value

The value to add.

Returns
Type Description
Scale

A new Scale representing the addition of the Scale and the provided value.

| Edit this page View Source

operator /(Scale, float)

Returns a new Scale representing the division of the Scale and the provided value.

Declaration
public static Scale operator /(Scale scale, float value)
Parameters
Type Name Description
Scale scale

The Scale.

float value

The value to device with.

Returns
Type Description
Scale

A new Scale representing the division of the Scale and the provided value.

| Edit this page View Source

operator ==(Scale, Scale)

Returns a value that indicates whether two specified Scale are equal.

Declaration
public static bool operator ==(Scale scale1, Scale scale2)
Parameters
Type Name Description
Scale scale1

The first Scale to compare.

Scale scale2

The second Scale to compare.

Returns
Type Description
bool

true if scale1 and scale2 are equal; otherwise, false.

| Edit this page View Source

implicit operator Scale(float)

Converts a float to a Scale.

Declaration
public static implicit operator Scale(float scale)
Parameters
Type Name Description
float scale

The scale value to convert.

Returns
Type Description
Scale
| Edit this page View Source

operator !=(Scale, Scale)

Returns a value that indicates whether two specified Scale are equal.

Declaration
public static bool operator !=(Scale scale1, Scale scale2)
Parameters
Type Name Description
Scale scale1

The first Scale to compare.

Scale scale2

The second Scale to compare.

Returns
Type Description
bool

true if scale1 and scale2 are not equal; otherwise, false.

| Edit this page View Source

operator *(Scale, float)

Returns a new Scale representing the multiplication of the Scale and the provided value.

Declaration
public static Scale operator *(Scale scale, float value)
Parameters
Type Name Description
Scale scale

The Scale.

float value

The value to multiply with.

Returns
Type Description
Scale

A new Scale representing the multiplication of the Scale and the provided value.

| Edit this page View Source

operator -(Scale, float)

Returns a new Scale representing the subtraction of the Scale and the provided value.

Declaration
public static Scale operator -(Scale scale, float value)
Parameters
Type Name Description
Scale scale

The Scale.

float value

The value to substract.

Returns
Type Description
Scale

A new Scale representing the subtraction of the Scale and the provided value.

Implements

IEquatable<T>
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX