ULimenSlider
Overview
ULimenSlider is a custom widget class derived from UWidget. It provides a user interface element for selecting a numeric value through mouse interaction or text input. The widget supports various customization options such as input methods, display styles, and blinking effects.
Properties
Type | Name | Access | Description |
|---|---|---|---|
ELimenSliderInputMethod | SliderInputMethod | EditAnywhere | Determines the method for adjusting the slider value (Mouse Position or Drag). |
float | InitialSliderValue | EditAnywhere | The initial value of the slider when it is created. |
int32 | DecimalDigits | EditAnywhere | The number of decimal places to display in the slider's text representation. |
float | SliderMinValue | EditAnywhere | The minimum allowable value for the slider. |
float | SliderMaxValue | EditAnywhere | The maximum allowable value for the slider. |
FSlateBrush | BackgroundBrush | EditAnywhere | The brush used as the background of the slider. |
FSlateBrush | BackgroundHoveredBrush | EditAnywhere | The brush used as the background when the mouse hovers over the slider. |
FSlateBrush | BorderBrush | EditAnywhere | The brush used for the border around the slider. |
FMargin | BorderPadding | EditAnywhere | The padding around the border of the slider. |
FSlateBrush | SliderBrush | EditAnywhere | The brush used to represent the slider itself. |
FMargin | SliderPadding | EditAnywhere | The padding around the slider image. |
FSlateColor | BlinkColor | EditAnywhere | The color used for blinking effects on the slider. |
float | BlinkSpeed | EditAnywhere, ClampMin="0" | The speed at which the blink effect occurs. |
ELimenSliderDisplay | SliderDisplayMethod | EditAnywhere | Determines how the slider value is displayed (None, Value, or Custom Image). |
TArray | ValueColors | EditAnywhere | An array of color ranges that determine the color of the slider based on its value. |
float | DisplayBoxWidth | EditAnywhere | The width of the display box for the slider value. |
bool | bUserCanEditValue | EditAnywhere | Determines if the user can edit the slider's value through text input. |
EHorizontalAlignment | DisplayHorizontalAlignment | EditAnywhere | The horizontal alignment of the displayed slider value. |
EVerticalAlignment | DisplayVerticalAlignment | EditAnywhere | The vertical alignment of the displayed slider value. |
FSlateBrush | CustomImageBrush | EditAnywhere, EditCondition="SliderDisplayMethod == ELimenSliderDisplay::CustomImage" | The brush used for custom images when |
FSlateColor | TextColor | EditAnywhere, EditCondition="SliderDisplayMethod == ELimenSliderDisplay::Value" | The color of the text displayed when |
FSlateColor | InvalidTextColor | EditAnywhere, EditCondition="SliderDisplayMethod == ELimenSliderDisplay::Value" | The color of invalid text input when |
FSlateFontInfo | NumberTextFont | EditAnywhere, EditCondition="SliderDisplayMethod == ELimenSliderDisplay::Value" | The font used for the displayed slider value. |
ETextJustify::Type | NumberTextJustification | EditAnywhere, EditCondition="SliderDisplayMethod == ELimenSliderDisplay::Value" | The justification of the text displayed when |
FMargin | NumberTextMargin | EditAnywhere, EditCondition="SliderDisplayMethod == ELimenSliderDisplay::Value" | The margin around the text displayed when |
Functions
Return Type | Signature | Description |
|---|---|---|
float | GetValue() const | Returns the current value of the slider. |
void | SetValue(const float NewValue) | Sets the slider's value and broadcasts the new value if necessary. |
void | SetValueRange(const FFloatRange& NewRange) | Sets the minimum and maximum values for the slider. |
void | SetDecimalDigitsCount(const int32 NewDecimalDigits) | Sets the number of decimal places to display in the slider's text representation. |
int32 | GetDecimalDigitsCount() const | Returns the current number of decimal places displayed in the slider's text representation. |
void | SetBlinkState(const bool bNewState) | Enables or disables the blinking effect on the slider. |
void | SetBlinkColor(const FSlateColor InColor) | Sets the color used for the blinking effect on the slider. |
bool | IsBlinking() const | Returns whether the blinking effect is currently active. |
void | SetUserCanEditValue(const bool bCanEdit) | Enables or disables text input for editing the slider's value. |
bool | UserCanEditValue() const | Returns whether text input for editing the slider's value is enabled. |
Usage & Implementation Notes
The widget supports both mouse drag and mouse position input methods.
The slider can display its value as a number, custom image, or nothing at all.
Blinking effects can be toggled on and off, with customizable colors and speeds.
The widget handles text input validation to ensure values are within the specified range.