![]() |
Lysa UI
0.0
Lysa UI —UI components for the Lysa Engine
|
A value selected by rotating a disc.
Inheritance diagram for Knob:Public Member Functions | |
| Knob (float min=0.0f, float max=100.0f, float value=0.0f, float step=1.0f) | |
| auto | getStartAngle () const |
| void | setStartAngle (float degrees) |
| auto | getSweepAngle () const |
| void | setSweepAngle (float degrees) |
| auto | getDivisions () const |
| void | setDivisions (uint32 divisions) |
| auto | areTicksVisible () const |
| void | setTicksVisible (bool visible=true) |
| auto | areLabelsVisible () const |
| void | setLabelsVisible (bool visible=true) |
| auto | getPrecision () const |
| void | setPrecision (uint32 precision) |
| auto | getTickLength () const |
| void | setTickLength (float length) |
| auto | getTickWidth () const |
| void | setTickWidth (float width) |
| auto | getTickGap () const |
| void | setTickGap (float gap) |
| auto | getLabelGap () const |
| void | setLabelGap (float gap) |
| auto | getCursorWidth () const |
| void | setCursorWidth (float width) |
| auto | getCursorStart () const |
| auto | getCursorEnd () const |
| void | setCursorExtent (float start, float end) |
| float2 | getCenter () const |
| float | getRadius () const |
| float | getTicksRadius () const |
| float | getLabelsRadius () const |
| float | getLabelHeight () const |
| float | getMaxLabelWidth () const |
| float | angleOf (float value) const |
| float2 | pointAt (float angle, float distance) const |
| float | valueOfTick (uint32 index) const |
| std::string | labelOfTick (uint32 index) const |
Public Member Functions inherited from ValueSelect | |
| ValueSelect (Type type, float min, float max, float value, float step) | |
| auto | getMin () const |
| auto | getMax () const |
| auto | getValue () const |
| auto | getStep () const |
| virtual void | setMin (float min) |
| virtual void | setMax (float max) |
| virtual void | setValue (float value) |
| virtual void | setStep (float step) |
Public Member Functions inherited from Widget | |
| Widget (Type type=WIDGET) | |
| ~Widget () override | |
| Type | getType () const |
| bool | isVisible () const |
| void | setVisible (bool show=true) |
| bool | isEnabled () const |
| void | setEnabled (bool isEnabled=true) |
| virtual void | setPos (float x, float y) |
| float | getWidth () const |
| float | getHeight () const |
| float | getRequestedWidth () const |
| float | getRequestedHeight () const |
| virtual void | setSize (float width, float height) |
| void | setWidth (const float width) |
| void | setHeight (const float height) |
| const Rect & | getRect () const |
| Rect | getScreenRect () const |
| void | setRect (float x, float y, float width, float height) |
| void | setRect (const Rect &rect) |
| float | getAspectRatio () const |
| Alignment | getAlignment () const |
| void | setAlignment (Alignment alignment) |
| void | setLayoutDirection (TextDirection direction) |
| TextDirection | getLayoutDirection () const |
| TextDirection | getEffectiveLayoutDirection () const |
| std::shared_ptr< Font > | getFont () const |
| void | setFont (const std::shared_ptr< Font > &font) |
| float | getFontScale () const |
| virtual void | setFontScale (float fontScale) |
| bool | isFocused () const |
| bool | isFocusable () const |
| bool | isTabStop () const |
| void | setTabStop (const bool tabStop) |
| Widget * | getParent () const |
| void | setOverlap (const bool overlap) |
| template<typename T , typename... Args> | |
| std::shared_ptr< T > | create (const std::string &resource, const Alignment alignment, Args &&...args) |
| template<typename T , typename... Args> | |
| std::shared_ptr< T > | create (const Alignment alignment, Args &&...args) |
| template<typename T > | |
| std::shared_ptr< T > | add (std::shared_ptr< T > child, const Alignment alignment=Alignment::NONE, const std::string &resource="", const bool overlap=false) |
| template<typename T > | |
| std::shared_ptr< T > | addPopup (std::shared_ptr< T > child, const std::string &resource="") |
| template<typename T > | |
| std::shared_ptr< T > | addAfter (std::shared_ptr< T > child, const std::shared_ptr< Widget > &after, const Alignment alignment, const std::string &resource="", const bool overlap=false) |
| virtual void | remove (const std::shared_ptr< Widget > &child) |
| virtual void | removeAll () |
| void | setPadding (float padding) |
| float | getPadding () const |
| float | getVBorder () const |
| float | getHBorder () const |
| void | setVBorder (float size) |
| void | setHBorder (float size) |
| bool | isDrawBackground () const |
| void | setDrawBackground (bool drawBackground) |
| bool | isPushed () const |
| bool | isPointed () const |
| bool | isFreezed () const |
| bool | isRedrawOnMouseEvent () const |
| bool | isOverlapping () const |
| Rect | getChildrenRect () const |
| void | setFreezed (const bool f) |
| void | setPushed (const bool p) |
| void | refresh () |
| void | setResource (std::shared_ptr< UIResource > res) |
| uint32 | getGroupIndex () const |
| void | setGroupIndex (int32 index) |
| template<typename T > | |
| T | getUserData () const |
| template<typename T > | |
| std::shared_ptr< T > | getPointerUserData () const |
| const std::any & | getUserData () const |
| void | setUserData (const std::any &data) |
| float | getTransparency () const |
| void | setTransparency (float alpha) |
| void | resizeChildren () |
| float | getChildrenOffsetX () const |
| float | getChildrenOffsetY () const |
| void | setChildrenOffset (float x, float y) |
| std::shared_ptr< Widget > | setFocus (bool focus=true) |
| virtual void | onAttach () |
| virtual void | onDetach () |
| virtual void | onShow () |
| virtual void | onHide () |
| virtual void | onResize () |
| virtual void | onMove () |
| virtual bool | onKeyDown (Key key) |
| virtual bool | onTextInput (const std::string &text) |
| virtual bool | onKeyUp (Key key) |
| virtual bool | onMouseDown (MouseButton button, float x, float y) |
| virtual bool | onMouseUp (MouseButton button, float x, float y) |
| virtual bool | onMouseMove (uint32 buttonsState, float x, float y) |
| virtual void | onMouseLeave () |
| virtual void | onDisable () |
| virtual void | onEnable () |
| virtual void | onGotFocus () |
| virtual void | onLostFocus () |
| bool | getConsumeMouseEvent () const |
| void | setConsumeMouseEvent (const bool consumeMouseEvent) |
| const std::list< std::shared_ptr< Widget > > & | getChildren () const |
| bool | hasChildren () const |
| void | subscribe (const event_type &type, unique_id id, EventHandlerCallback callback) |
| void | subscribe (const event_type &type, EventHandlerCallback callback) |
| void | subscribe (const event_type &type, SignalHandlerCallback callback) |
| void | unsubscribe (unique_id id) |
| virtual void | eventAttach () |
| virtual void | eventDetach () |
| virtual void | eventShow () |
| virtual void | eventAspectRatioChanged () |
| virtual void | eventHide () |
| virtual void | eventEnable () |
| virtual void | eventDisable () |
| virtual void | eventMove (float x, float y) |
| virtual bool | eventTextInput (const std::string &text) |
| virtual bool | eventKeyDown (Key key) |
| virtual bool | eventKeyUp (Key key) |
| virtual void | eventMouseLeave () |
| virtual void | eventGotFocus () |
| virtual void | eventLostFocus () |
| bool | isAttached () const |
| Window & | getWindow () const |
| Style & | getStyle () const |
| Vector2DRenderer & | getRenderer () const |
| RenderingWindow & | getRenderingWindow () const |
| WindowManager & | getWindowManager () const |
| bool | isCustomDraw () const |
| virtual void | draw (UIResource &resources, Vector2DRenderer &renderer, bool stage) const |
| void | skipInvisibleChildren (const bool s) |
Static Public Attributes | |
| static constexpr float | DEFAULT_START_ANGLE {225.0f} |
| Default angle of the minimum value in degrees counterclockwise from the horizontal axis. More... | |
| static constexpr float | DEFAULT_SWEEP_ANGLE {270.0f} |
| Default angle swept clockwise from the minimum to the maximum value in degrees. More... | |
| static constexpr uint32 | DEFAULT_DIVISIONS {8} |
| Default number of intervals between the graduations drawn around the disc. More... | |
| static constexpr float | DEFAULT_TICK_LENGTH {4.0f} |
| Default length of the graduations. More... | |
| static constexpr float | DEFAULT_TICK_WIDTH {1.0f} |
| Default thickness of the graduations. More... | |
| static constexpr float | DEFAULT_TICK_GAP {2.0f} |
| Default space kept between the disc and the graduations. More... | |
| static constexpr float | DEFAULT_LABEL_GAP {2.0f} |
| Default space kept between the graduations and the labels. More... | |
| static constexpr float | DEFAULT_CURSOR_WIDTH {2.0f} |
| Default thickness of the cursor drawn inside the disc. More... | |
| static constexpr float | DEFAULT_CURSOR_START {0.35f} |
| Default distance between the center of the disc and the start of the cursor. More... | |
| static constexpr float | DEFAULT_CURSOR_END {0.85f} |
| Default distance between the center of the disc and the end of the cursor. More... | |
Protected Member Functions | |
| bool | eventMouseDown (MouseButton button, float x, float y) override |
| bool | eventMouseUp (MouseButton button, float x, float y) override |
| bool | eventMouseMove (uint32 buttonsState, float x, float y) override |
Protected Member Functions inherited from ValueSelect | |
| void | eventResize () override |
| virtual void | eventRangeChange () |
| virtual void | eventValueChange (float prev) |
| Knob | ( | float | min = 0.0f, |
| float | max = 100.0f, |
||
| float | value = 0.0f, |
||
| float | step = 1.0f |
||
| ) |
Creates a knob.
| min | Minimum value. |
| max | Maximum value. |
| value | Initial value. |
| step | Wheel mouse step. |
| float angleOf | ( | float | value | ) | const |
Returns the angle of a value in radians counterclockwise from the horizontal axis
|
inline |
Returns true if the value of each graduation is drawn around the disc
|
inline |
Returns true if the graduations are drawn around the disc
|
overrideprotectedvirtual |
Raw mouse down event, see onMouseDown
Reimplemented from lysa::ui::Widget::eventMouseDown()
|
overrideprotectedvirtual |
Raw mouse move event, see onMouseMove
Reimplemented from lysa::ui::Widget::eventMouseMove()
|
overrideprotectedvirtual |
Raw mouse up event, see onMouseUp
Reimplemented from lysa::ui::Widget::eventMouseUp()
| float2 getCenter | ( | ) | const |
Returns the center of the disc
|
inline |
Returns the distance between the center of the disc and the end of the cursor
|
inline |
Returns the distance between the center of the disc and the start of the cursor
|
inline |
Returns the thickness of the cursor drawn inside the disc.
|
inline |
Returns the number of intervals between the graduations drawn around the disc
|
inline |
Returns the space kept between the graduations & the labels.
| float getLabelHeight | ( | ) | const |
Returns the height of a label
| float getLabelsRadius | ( | ) | const |
Returns the distance between the center of the disc and the center of the labels.
| float getMaxLabelWidth | ( | ) | const |
Returns the width of the widest label
|
inline |
Returns the number of decimals of the labels
| float getRadius | ( | ) | const |
Returns the radius of the disc.
|
inline |
Returns the angle of the minimum value in degrees counterclockwise from the horizontal axis
|
inline |
Returns the angle swept clockwise from the minimum to the maximum value in degrees
|
inline |
Returns the space kept between the disc & the graduations.
|
inline |
Returns the length of the graduations.
| float getTicksRadius | ( | ) | const |
Returns the distance between the center of the disc and the start of the graduations
|
inline |
Returns the thickness of the graduations.
| std::string labelOfTick | ( | uint32 | index | ) | const |
Returns the label of a graduation
| float2 pointAt | ( | float | angle, |
| float | distance | ||
| ) | const |
Returns the point at a given angle and a given distance from the center of the disc.
| angle | Angle in radians |
| distance | Distance from the center |
| void setCursorExtent | ( | float | start, |
| float | end | ||
| ) |
Changes the extent of the cursor drawn inside the disc.
| start | Distance between the center and the start of the cursor |
| end | Distance between the center and the end of the cursor |
| void setCursorWidth | ( | float | width | ) |
Changes the thickness of the cursor drawn inside the disc.
| void setDivisions | ( | uint32 | divisions | ) |
Changes the number of intervals between the graduations drawn around the disc
| void setLabelGap | ( | float | gap | ) |
Changes the space kept between the graduations & the labels.
| void setLabelsVisible | ( | bool | visible = true | ) |
Shows or hides the value of each graduation
| void setPrecision | ( | uint32 | precision | ) |
Changes the number of decimals of the labels
| void setStartAngle | ( | float | degrees | ) |
Changes the angle of the minimum value in degrees counterclockwise from the horizontal axis
| void setSweepAngle | ( | float | degrees | ) |
Changes the angle swept clockwise from the minimum to the maximum value in degrees
| void setTickGap | ( | float | gap | ) |
Changes the space kept between the disc & the graduations.
| void setTickLength | ( | float | length | ) |
Changes the length of the graduations.
| void setTicksVisible | ( | bool | visible = true | ) |
Shows or hides the graduations drawn around the disc
| void setTickWidth | ( | float | width | ) |
Changes the thickness of the graduations.
| float valueOfTick | ( | uint32 | index | ) | const |
Returns the value of a graduation
|
staticconstexpr |
Default distance between the center of the disc and the end of the cursor.
|
staticconstexpr |
Default distance between the center of the disc and the start of the cursor.
|
staticconstexpr |
Default thickness of the cursor drawn inside the disc.
|
staticconstexpr |
Default number of intervals between the graduations drawn around the disc.
|
staticconstexpr |
Default space kept between the graduations and the labels.
|
staticconstexpr |
Default angle of the minimum value in degrees counterclockwise from the horizontal axis.
|
staticconstexpr |
Default angle swept clockwise from the minimum to the maximum value in degrees.
|
staticconstexpr |
Default space kept between the disc and the graduations.
|
staticconstexpr |
Default length of the graduations.
|
staticconstexpr |
Default thickness of the graduations.