class GUIColor

GUI element that displays the set color.

RGB and alpha values are displayed separately.

Public

Methods

staticGetGuiTypeName

static const String &GetGuiTypeName()

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

SetColor

void SetColor(const Color &color)

Sets the color to display.

GetColor

Color GetColor() const

Returns the currently displayed color.

staticCreate

static GUIElementType *Create(const String &styleClass, const TInlineArray<GUIOption, 4> &options)

Creates a new GUI element.

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.
options
Additional options that control GUI element size and position. This will override options set in the style sheet.

Fields

OnClicked

Event<void ()> OnClicked

Triggered when the user clicks on the GUI element.

Internal

Constructors

GUIColor

GUIColor(PrivatelyConstruct, const String &styleName, const GUISizeConstraints &sizeConstraints)

Methods

CalculateUnconstrainedOptimalSize

GUILogicalSize CalculateUnconstrainedOptimalSize() const override

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

Protected

Methods

~GUIColor

virtual ~GUIColor() noexcept

GetStyleSheetElement

const char *GetStyleSheetElement() const override

Returns the name of the GUI element type to be used for style lookup in the style sheet.

UpdateRenderElements

void UpdateRenderElements() override

Recreates the internal render elements.

Must be called before GetRenderElementVertexAndIndexData/FillBuffer if element is dirty. Marks the element as non dirty.

DoOnMouseEvent

bool DoOnMouseEvent(const GUIMouseEvent &event) override

Called when a mouse event is received on any GUI element the mouse is interacting with.

Return true if you have processed the event and don't want other elements to process it.

Private

Fields

mColorSprite

ImageSprite * mColorSprite

mAlphaSprite

ImageSprite * mAlphaSprite

mColorImageSpriteInformation

ImageSpriteInformation mColorImageSpriteInformation

mAlphaImageSpriteInformation

ImageSpriteInformation mAlphaImageSpriteInformation

mValue

Color mValue