PixelCrushers.DialogueSystem.UnityGUI.ScaledValue Class Reference

A scaled value, which is used by ScaledRect. More...

Collaboration diagram for PixelCrushers.DialogueSystem.UnityGUI.ScaledValue:

Public Member Functions

 ScaledValue (ValueScale scale, float value)
 Initializes a new ScaledValue. More...
 
 ScaledValue (ScaledValue source)
 Copy constructor. More...
 
 ScaledValue ()
 Default constructor. More...
 
float GetPixelValue (float windowSize)
 Gets the pixel value of this ScaledValue. More...
 

Static Public Member Functions

static ScaledValue FromPixelValue (float value)
 Static utility function to create a ScaledValue from a pixel value. More...
 
static ScaledValue FromNormalizedValue (float value)
 Static utility function to create a ScaledValue from a normalized value. More...
 

Public Attributes

ValueScale scale
 The scale used by the value (pixel-scale or normalized-scale). More...
 
float value
 The value in the scale. More...
 

Static Public Attributes

static readonly ScaledValue zero = new ScaledValue(ValueScale.Pixel, 0)
 Represents a length of zero. More...
 
static readonly ScaledValue max = new ScaledValue(ValueScale.Normalized, 1)
 Represents a length equal to the size of the window. More...
 

Detailed Description

A scaled value, which is used by ScaledRect.

The value can be scaled in pixel measurements or normalized [0,,1] to the size of the window/screen.

Constructor & Destructor Documentation

◆ ScaledValue() [1/3]

PixelCrushers.DialogueSystem.UnityGUI.ScaledValue.ScaledValue ( ValueScale  scale,
float  value 
)

Initializes a new ScaledValue.

Parameters
scaleScale to use.
valueValue to use.

◆ ScaledValue() [2/3]

PixelCrushers.DialogueSystem.UnityGUI.ScaledValue.ScaledValue ( ScaledValue  source)

Copy constructor.

Initializes a new ScaledValue.

Parameters
sourceSource to copy.

◆ ScaledValue() [3/3]

PixelCrushers.DialogueSystem.UnityGUI.ScaledValue.ScaledValue ( )

Default constructor.

Member Function Documentation

◆ FromNormalizedValue()

static ScaledValue PixelCrushers.DialogueSystem.UnityGUI.ScaledValue.FromNormalizedValue ( float  value)
static

Static utility function to create a ScaledValue from a normalized value.

Returns
The ScaledValue that represents the pixel value.
Parameters
valueThe normalized value.

◆ FromPixelValue()

static ScaledValue PixelCrushers.DialogueSystem.UnityGUI.ScaledValue.FromPixelValue ( float  value)
static

Static utility function to create a ScaledValue from a pixel value.

Returns
The ScaledValue that represents the pixel value.
Parameters
valueThe pixel value.

◆ GetPixelValue()

float PixelCrushers.DialogueSystem.UnityGUI.ScaledValue.GetPixelValue ( float  windowSize)

Gets the pixel value of this ScaledValue.

Returns
The pixel value.
Parameters
windowSizeFor normalized values, windowSize is the pixel value represented by the normalized value 1.

Member Data Documentation

◆ max

readonly ScaledValue PixelCrushers.DialogueSystem.UnityGUI.ScaledValue.max = new ScaledValue(ValueScale.Normalized, 1)
static

Represents a length equal to the size of the window.

If the window is the whole screen, this value is Screen.width for horizontal values or Screen.height for vertical values.

◆ scale

ValueScale PixelCrushers.DialogueSystem.UnityGUI.ScaledValue.scale

The scale used by the value (pixel-scale or normalized-scale).

◆ value

float PixelCrushers.DialogueSystem.UnityGUI.ScaledValue.value

The value in the scale.

◆ zero

readonly ScaledValue PixelCrushers.DialogueSystem.UnityGUI.ScaledValue.zero = new ScaledValue(ValueScale.Pixel, 0)
static

Represents a length of zero.


The documentation for this class was generated from the following file: