class
GUIUtility
Helper class that performs various operations related to GUI.
Public
Methods
staticLogicalToPhysical
Converts a value from logical pixels to physical pixels.
- value
- Value in logical pixels.
- scale
- Scale applied to physical pixels. Normally the DPI scale, but can also include per-element scale depending on the requirements.
Returns: Value in physical pixels.
staticLogicalToPhysical
Converts a value from logical pixels to physical pixels.
- value
- Value in logical pixels.
- scale
- Scale applied to physical pixels. Normally the DPI scale, but can also include per-element scale depending on the requirements.
Returns: Value in physical pixels.
staticLogicalToPhysical
Converts a value from logical pixels to physical pixels.
- value
- Value in logical pixels.
- scale
- Scale applied to physical pixels. Normally the DPI scale, but can also include per-element scale depending on the requirements.
Returns: Value in physical pixels.
staticLogicalToPhysical
Converts a value from logical pixels to physical pixels.
- value
- Value in logical pixels.
- scale
- Scale applied to physical pixels. Normally the DPI scale, but can also include per-element scale depending on the requirements.
Returns: Value in physical pixels.
staticLogicalToPhysical
Converts a value from logical pixels to physical pixels.
- value
- Value in logical pixels.
- scale
- Scale applied to physical pixels. Normally the DPI scale, but can also include per-element scale depending on the requirements.
Returns: Value in physical pixels.
staticLogicalToPhysical
Converts a value from logical pixels to physical pixels.
- value
- Value in logical pixels.
- scale
- Scale applied to physical pixels. Normally the DPI scale, but can also include per-element scale depending on the requirements.
Returns: Value in physical pixels.
staticLogicalToPhysical
Converts a value from logical pixels to physical pixels.
- value
- Value in logical pixels.
- scale
- Scale applied to physical pixels. Normally the DPI scale, but can also include per-element scale depending on the requirements.
Returns: Value in physical pixels.
staticLogicalToPhysical
Converts a value from logical pixels to physical pixels.
- value
- Value in logical pixels.
- scale
- Scale applied to physical pixels. Normally the DPI scale, but can also include per-element scale depending on the requirements.
Returns: Value in physical pixels.
staticPhysicalToLogical
Converts a value from physical pixels to logical pixels.
- value
- Value in physical pixels.
- scale
- Scale applied to physical pixels. Normally the DPI scale, but can also include per-element scale depending on the requirements.
Returns: Value in logical pixels.
staticPhysicalToLogical
Converts a value from physical pixels to logical pixels.
- value
- Value in physical pixels.
- scale
- Scale applied to physical pixels. Normally the DPI scale, but can also include per-element scale depending on the requirements.
Returns: Value in logical pixels.
staticPhysicalToLogical
Converts a value from physical pixels to logical pixels.
- value
- Value in physical pixels.
- scale
- Scale applied to physical pixels. Normally the DPI scale, but can also include per-element scale depending on the requirements.
Returns: Value in logical pixels.
staticPhysicalToLogical
Converts a value from physical pixels to logical pixels.
- value
- Value in physical pixels.
- scale
- Scale applied to physical pixels. Normally the DPI scale, but can also include per-element scale depending on the requirements.
Returns: Value in logical pixels.
staticPhysicalToLogical
Converts a value from physical pixels to logical pixels.
- value
- Value in physical pixels.
- scale
- Scale applied to physical pixels. Normally the DPI scale, but can also include per-element scale depending on the requirements.
Returns: Value in logical pixels.
staticPhysicalToLogical
Converts a value from physical pixels to logical pixels.
- value
- Value in physical pixels.
- scale
- Scale applied to physical pixels. Normally the DPI scale, but can also include per-element scale depending on the requirements.
Returns: Value in logical pixels.
staticPhysicalToLogical
Converts a value from physical pixels to logical pixels.
- value
- Value in physical pixels.
- scale
- Scale applied to physical pixels. Normally the DPI scale, but can also include per-element scale depending on the requirements.
Returns: Value in logical pixels.
staticPhysicalToLogical
Converts a value from physical pixels to logical pixels.
- value
- Value in physical pixels.
- scale
- Scale applied to physical pixels. Normally the DPI scale, but can also include per-element scale depending on the requirements.
Returns: Value in logical pixels.
staticCalculateSizeWithPaddingAndBorder
Calculates size of the GUI element area based on the GUI content size.
This is just the content area expanded by padding and border provided by the style.
- contentSize
- Size of the GUI element's content area.
- styleSheetRule
- Style to use when rendering the GUI element.
Returns: Size of the GUI element (including the border).
staticCalculateOptimalContentSizeWithPaddingAndBorder
Calculates optimal size for displaying particular GUI contents.
- content
- Content to calculate size for.
- styleSheetRule
- Style that the content will be displayed with.
- wordWrapWidth
- If non-zero, the width at which to perform word wrap. If not provided, all the text will be placed in a single line. Only relevant if the contents contain text.
Returns: Optimal size of the GUI element, including content size, style padding and border width.
staticCalculateOptimalContentSizeWithPaddingAndBorder
Calculates optimal size for displaying text.
- text
- Text to calculate size for.
- styleSheetRule
- Style that the content will be displayed with.
- wordWrapWidth
- If non-zero, the width at which to perform word wrap. If not provided, all the text will be placed in a single line.
Returns: Optimal size of the GUI element, including content size and the style padding (area within GUI elements border).
staticRemovePaddingAndBorder
Calculates the content area based on the total element size (i.e. size as calculated by the layout).
This is the layout area potentially offset/reduced by border/padding as specified in the style sheet rules.
staticCalculateTextBounds
Calculates optimal content size for the provided text using the provided font and size.
Size is calculated without word wrap.
- text
- Text to calculate the size for.
- font
- Font to use for rendering the text.
- fontSize
- Size of individual characters in the font, in points.
Returns: Width/height required to display the text, in pixels.