class GUICurvesField

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 an animation curve or a range between two animation curves.

Public

Constructors

GUICurvesField

GUICurvesField(const PrivatelyConstruct &dummy, const GUIContent &labelContent, u32 labelWidth, const String &style, const GUISizeConstraints &dimensions, bool withLabel, CurveDrawOptions drawOptions = CurveDrawOptions())

Methods

staticGetGuiTypeName

static const String &GetGuiTypeName()

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

SetCurve

void SetCurve(const TAnimationCurve<float> &curve)

Sets an animation curve to display on the field.

SetCurveRange

void SetCurveRange(const TAnimationCurve<float> &curveA, const TAnimationCurve<float> &curveB)

Sets a set of animation curves and displays the difference (range) between them.

GetCurve

const TAnimationCurve<float> &GetCurve() const

Returns the curve represented by the field.

If the field represents a curve range this returns the minimal curve of that range.

GetMinCurve

const TAnimationCurve<float> &GetMinCurve() const

Returns the minimal curve represented by the field containing a curve range.

Returns the only available curve if the field doesn't represent a range.

GetMaxCurve

const TAnimationCurve<float> &GetMaxCurve() const

Returns the maximal curve represented by the field containing a curve range.

Returns the only available curve if the field doesn't represent a range.

SetRange

void SetRange(float xRange, float yRange)

Changes the visible range that the GUI element displays.

xRange
Range of the horizontal area. Displayed area will range from [0, xRange].
yRange
Range of the vertical area. Displayed area will range from [-yRange * 0.5, yRange * 0.5]

SetOffset

void SetOffset(const Vector2 &offset)

Returns the offset at which the displayed timeline values start at.

offset
Value to start the timeline values at, where x = time, y = value.

CenterAndZoom

void CenterAndZoom()

Centers and zooms the view to fully display the provided set of curves.

SetPadding

void SetPadding(u32 padding)

SetTint

void SetTint(const Color &color) override

Sets the tint of the GUI element.

staticCreate

static GUICurvesField *Create(CurveDrawOptions drawOptions, const GUIContent &labelContent, u32 labelWidth, const String &style = StringUtility::kBlank)

Creates a new GUI editor field with a label.

drawOptions
Options that control which additional curve elements to draw.
labelContent
Content to display in the editor field label.
labelWidth
Width of the label in pixels.
style
Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on. If not specified default style is used.

staticCreate

static GUICurvesField *Create(CurveDrawOptions drawOptions, const HString &labelText, u32 labelWidth, const String &style = StringUtility::kBlank)

Creates a new GUI editor field with a label.

drawOptions
Options that control which additional curve elements to draw.
labelText
String to display in the editor field label.
labelWidth
Width of the label in pixels.
style
Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on. If not specified default style is used.

staticCreate

static GUICurvesField *Create(CurveDrawOptions drawOptions, const String &style = StringUtility::kBlank)

Creates a new GUI editor field without a label.

drawOptions
Options that control which additional curve elements to draw.
style
Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on. If not specified default style is used.

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

Clicked

void Clicked()

Triggered when the child color input field is clicked on.

Fields

mCurves

GUICurves * mCurves