class
GUICurves
GUI element that displays one or multiple curves.
Public
Methods
staticGetGuiTypeName
Returns type name of the GUI element used for finding GUI element styles.
GetCurves
SetRange
Changes the visible range that the GUI element displays.
SetOffset
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
Centers and zooms the view to fully display the provided set of curves.
PixelToCurveSpace
Converts pixel coordinates into coordinates in curve space.
- pixelCoords
- Coordinates relative to this GUI element, in pixels.
- curveCoords
- Curve coordinates within the range as specified by setRange(). Only valid when function returns true.
- padding
- Determines should coordinates over the area reserved for padding be registered.
Returns: True if the coordinates are within the curve area, false otherwise.
CurveToPixelSpace
Converts coordinate in curve space (time, value) into pixel coordinates relative to this element's origin.
- curveCoords
- Time and value of the location to convert.
Returns: Coordinates relative to this element's origin, in pixels.
FindCurve
Attempts to find a curve under the provided coordinates.
- pixelCoords
- Coordinates relative to this GUI element in pixels.
Returns: Index of the curve, or -1 if none found.
FindKeyFrame
Attempts to find a keyframe under the provided coordinates.
- pixelCoords
- Coordinates relative to this GUI element in pixels.
- keyframe
- Output object containing keyframe index and index of the curve it belongs to. Only valid if method returns true.
Returns: True if there is a keyframe under the coordinates, false otherwise.
FindTangent
Attempts to find a a tangent handle under the provided coordinates.
- pixelCoords
- Coordinates relative to this GUI element in pixels.
- tangent
- Output object containing keyframe information and tangent type. Only valid if method returns true.
Returns: True if there is a tangent handle under the coordinates, false otherwise.
SelectKeyframe
Marks the specified key-frame as selected, changing the way it is displayed.
- keyframeRef
- Keyframe reference containing the curve and keyframe index.
- tangentMode
- Type of tangent to display on the selected keyframe.
- selected
- True to select it, false to deselect it.
ClearSelectedKeyframes
Clears any key-frames that were marked as selected.
staticCreate
Creates a new GUI element.
- contents
- Structure describing the contents of the GUI element to create.
- 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
Internal
Constructors
GUICurves
Protected
Methods
~GUICurves
TangentToNormal
Converts a keyframe tangent (slope) value into a 2D normal vector.
- tangent
- Keyframe tangent (slope).
Returns: Normalized 2D vector pointing in the direction of the tangent.
GetTangentPosition
Returns the position of the tangent, in element's pixel space.
- keyFrame
- Keyframe that the tangent belongs to.
- type
- Which tangent to retrieve the position for.
Returns: Position of the tangent, relative to the this GUI element's origin, in pixels.
IsTangentDisplayed
Checks if the tangent should be displayed, depending on the active tangent mode.
- mode
- Tangent mode for the keyframe.
- type
- Which tangent to check for.
Returns: True if the tangent should be displayed.
IsSelected
Checks is the provided key-frame currently marked as selected.
- curveIdx
- Index of the curve the keyframe is on.
- keyIdx
- Index of the keyframe.
Returns: True if selected, false otherwise.
DrawFrameMarker
Draws a vertical frame marker on the curve area.
DrawCenterLine
Draws a horizontal line representing the line at y = 0.
DrawDiamond
Draws a diamond shape of the specified size at the coordinates.
DrawKeyframe
Draws a keyframe a the specified time and value.
- t
- Time to draw the keyframe at.
- y
- Y value to draw the keyframe at.
- selected
- Determines should the keyframe be drawing using the selected color scheme, or normally.
DrawTangents
Draws zero, one or two tangents for the specified keyframe.
Whether tangents are drawn depends on the provided mode.
- keyFrame
- Keyframe to draw the tangents for.
- tangentMode
- Type of tangents in the keyframe.
DrawCurve
Draws the curve using the provided color.
- curve
- Curve to draw within the currently set range.
- color
- Color to draw the curve with.
DrawCurveRange
UpdateRenderElements
Recreates the internal render elements.
Must be called before GetRenderElementVertexAndIndexData/FillBuffer if element is dirty. Marks the element as non dirty.
DoOnMouseEvent
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.