class GUIColorField

A composite GUI object representing an editor field.

Editor fields are a combination of a label and an input field. Label is optional. This specific implementation displays a color input field.

Public

Constructors

GUIColorField

GUIColorField(const PrivatelyConstruct &dummy, const GUIContent &labelContent, u32 labelWidth, const String &style, const GUISizeConstraints &dimensions, bool withLabel)

Methods

staticGetGuiTypeName

static const String &GetGuiTypeName()

Returns type name of the GUI element used for finding GUI element styles.

GetValue

Color GetValue() const

Returns the value of the field.

SetValue

void SetValue(const Color &value)

Changes the value of the field.

GetAllowHdr

bool GetAllowHdr() const

SetAllowHdr

void SetAllowHdr(bool allow)

Determines if the color assigned to the field is allowed to have values outside of [0-1] range.

SetTint

void SetTint(const Color &color) override

Sets the tint of the GUI element.

staticCreate

static T *Create(const GUIContent &labelContent, u32 labelWidth, const String &styleClass = StringUtility::kBlank)

Creates a new GUI editor field with a label.

labelContent
Content to display in the editor field label.
labelWidth
Width of the label in pixels.
styleClass
Style class that will be used for determining GUI element visuals from the current style sheet. If no class is provided, default style is determined based on GUI element type.

Fields

OnClicked

Event<void ()> OnClicked

Triggered when the user clicks on the GUI element.

Internal

Methods

CalculateUnconstrainedOptimalSize

GUILogicalSize CalculateUnconstrainedOptimalSize() const override

Calculates the optimal size for the GUI element, ignoring size constraints.

Protected

Methods

~GUIColorField

virtual ~GUIColorField() noexcept = default

Clicked

void Clicked()

Triggered when the child color input field is clicked on.

Fields

mLabelWidth

u32 mLabelWidth

mValue

Color mValue

mLabel

GUILabel * mLabel

mColor

GUIColor * mColor

mAllowHDR

bool mAllowHDR