UDreamSlider
A slider whose hierarchy is code, not an asset.
Inherits from UDreamUIControl.
Declared in Public/Controls/DreamSlider.h.
A slider whose hierarchy is code, not an asset.
The same five nodes both preset Blueprints carry -- a track, a fill area holding the fill, a handle area holding the handle -- with one difference that is the point: BP_HorizontalSlider and BP_VerticalSlider are two assets because an asset cannot branch on a property, and this class is one control because code can. Direction re-anchors the parts; there is nothing else the two presets disagreed about.
The areas exist because UUISlider positions the fill and the handle INSIDE whatever their parents are -- FillArea and HandleArea are how the track tells it where "0" and "1" live. The handle area is inset by the handle's own size so the handle rides within the track's ends instead of overhanging them.
Properties
| Name | Type | Category | In the details panel | From Blueprint | Description |
|---|---|---|---|---|---|
Style | FDreamSliderStyle | Slider | yes | GetStyle / SetStyle | This instance's own look. The project sheet wins while StyleSource says so AND a sheet actually exists; with no sheet in the project this IS the look in effect -- which is why it stays editable instead of being gated on the enum: the old edit condition greyed the exact values that were driving the control. |
bLocked | bool | Slider | yes | IsLocked / SetLocked | Shows its value and refuses to be moved -- UMG's Locked, pushed onto the behaviour. A press on a locked slider begins no mouse capture, so OnMouseCaptureBegin and OnMouseCaptureEnd stay silent, as SSlider's do. |
SliderBarColor | FColor | Slider | yes | GetSliderBarColor / SetSliderBarColor | A tint over the bar the handle travels along -- UMG's SliderBarColor, which is a tint over SSlider's bar image for exactly the same reason this is one: the STYLE says what the slider looks like, and this says what is happening to it right now. White is no opinion. |
SliderHandleColor | FColor | Slider | yes | GetSliderHandleColor / SetSliderHandleColor | The same, over the handle's five state colours -- UMG's SliderHandleColor. |
bIndentHandle | bool | Slider | yes | GetIndentHandle / SetIndentHandle | Whether the handle stays inside the track's ends -- UMG's IndentHandle. |
Direction | EUISliderDirectionType | Slider | yes | GetDirection / SetDirection | Which way it runs. One property instead of two Blueprint assets. |
Value | float | Slider | yes | GetValue / SetValue | Authored value in; mirror of the behaviour's out. A property so .dui and bindings can see it. |
MinValue | float | Slider | yes | GetMinValue / SetMinValue | |
MaxValue | float | Slider | yes | GetMaxValue / SetMaxValue | |
bWholeNumbers | bool | Slider | yes | GetWholeNumbers / SetWholeNumbers | Whole numbers only -- the behaviour has always had this and the control never pushed it, so a slider authored as an integer picker answered 3.7215. Every value the slider takes is rounded to the nearest whole number -- a drag, a gamepad step, SetValue -- so an authored fractional Value is rounded at the next push rather than refused. |
NavigationChangeInterval | float | Slider | yes | GetNavigationChangeInterval / SetNavigationChangeInterval | How far one gamepad or keyboard press moves the value, as a FRACTION of the range: a press is worth (MaxValue - MinValue) * this. Also the behaviour's, also never pushed before -- so every slider in the project stepped by the library's 0.1 whatever its .dui said. |
StepSize | float | Slider | yes | GetStepSize / SetStepSize | The quantum a MOUSE drag moves the value in, while bMouseUsesStep is on -- UMG's StepSize. |
bMouseUsesStep | bool | Slider | yes | GetMouseUsesStep / SetMouseUsesStep | Quantise a mouse drag to StepSize. Off, a drag is continuous. |
bRequiresControllerLock | bool | Slider | yes | GetRequiresControllerLock / SetRequiresControllerLock | A gamepad must capture this slider before its directions move the value -- UMG's RequiresControllerLock, on by default for the reason it is on there: a row of sliders a stick travels THROUGH is unusable if the first one swallows every left and right. |
TrackNode | TObjectPtr<UDreamWidget> | Slider | - | read only | |
FillNode | TObjectPtr<UDreamWidget> | Slider | - | read only | |
FillAreaNode | TObjectPtr<UDreamWidget> | Slider | - | read only | |
HandleNode | TObjectPtr<UDreamWidget> | Slider | - | read only | |
HandleAreaNode | TObjectPtr<UDreamWidget> | Slider | - | read only | |
SliderBehaviour | TObjectPtr<UUISlider> | Slider | - | read only |
Functions
| Function | Kind | Description |
|---|---|---|
EUISliderDirectionType GetDirection() | pure | Get Direction |
bool GetIndentHandle() | pure | Get Indent Handle |
float GetMaxValue() | pure | Get Max Value |
float GetMinValue() | pure | Get Min Value |
bool GetMouseUsesStep() | pure | Get Mouse Uses Step |
float GetNavigationChangeInterval() | pure | Get Navigation Change Interval |
float GetNormalizedValue() | pure | Where the value sits between the two ends, 0 to 1 -- UMG's GetNormalizedValue. |
bool GetRequiresControllerLock() | pure | Get Requires Controller Lock |
FColor GetSliderBarColor() | pure | Get Slider Bar Color |
FColor GetSliderHandleColor() | pure | Get Slider Handle Color |
float GetStepSize() | pure | Get Step Size |
FDreamSliderStyle GetStyle() | pure | Get Style |
float GetValue() | pure | Get Value |
bool GetWholeNumbers() | pure | Get Whole Numbers |
bool IsControllerCaptured() | pure | Whether a gamepad currently holds this slider -- read straight off the behaviour. |
bool IsLocked() | pure | Is Locked |
void SetDirection(EUISliderDirectionType InDirection) | callable | Re-anchors the parts: the direction decides which axis the track, fill and handle run along. |
void SetIndentHandle(bool bInIndentHandle) | callable | Re-places the handle area, which is the one thing this decides. |
void SetLocked(bool bInLocked) | callable | Set Locked |
void SetMaxValue(float InMaxValue) | callable | Set Max Value |
void SetMinValue(float InMinValue) | callable | Range before value, always: the value is clamped against the range, never the other way. |
void SetMouseUsesStep(bool bInMouseUsesStep) | callable | Set Mouse Uses Step |
void SetNavigationChangeInterval(float InInterval) | callable | Set Navigation Change Interval |
void SetRequiresControllerLock(bool bInRequiresControllerLock) | callable | Set Requires Controller Lock |
void SetSliderBarColor(FColor InSliderBarColor) | callable | Set Slider Bar Color |
void SetSliderHandleColor(FColor InSliderHandleColor) | callable | Set Slider Handle Color |
void SetStepSize(float InStepSize) | callable | Set Step Size |
void SetStyle(FDreamSliderStyle InStyle) | callable | This instance's whole look, replaced and pushed. See UDreamButton::SetStyle for the caveat. |
void SetValue(float InValue) | callable | Set Value |
void SetWholeNumbers(bool bInWholeNumbers) | callable | Set Whole Numbers |
Events
| Event | Signature | Description |
|---|---|---|
OnMouseCaptureBegin | void DreamSliderCaptureEvent__DelegateSignature() | The four capture moments UMG's slider speaks, re-broadcast from the behaviour exactly as the value change is. Mouse begin/end are the press and release; controller begin/end are the lock being taken and given back. What they are FOR is the reason UMG has them: a consumer that writes the value into a setting, plays a sound or asks the server can hold off while the player is still dragging, and act once on the moment they let go. |
OnMouseCaptureEnd | void DreamSliderCaptureEvent__DelegateSignature() | |
OnControllerCaptureBegin | void DreamSliderCaptureEvent__DelegateSignature() | |
OnControllerCaptureEnd | void DreamSliderCaptureEvent__DelegateSignature() | |
OnValueChanged | void DreamSliderValueChangedEvent__DelegateSignature(float Value) | Re-broadcast from the behaviour, so a consumer binds to the control, not to a part of it. |
OnValueChangedBP | void DreamSliderValueChangedEvent__DelegateSignature(float Value) | The <-> convention: two-way bindings synthesize their reverse route against this exact name, so a value control carries it alongside its spoken events. Fires with them. |
Compared with UMG
Every Blueprint-facing member of the UMG class, and where it went. adopt: same name, same meaning. map: here under another name or on another type. reject: deliberately absent, with the reason.
| UMG | Member | Status | Here | Note |
|---|---|---|---|---|
USlider | Value | adopt | Value | |
USlider | MinValue | adopt | MinValue | |
USlider | MaxValue | adopt | MaxValue | |
USlider | WidgetStyle | map | Style | FDreamSliderStyle: track thickness and colour, fill colour, handle size and its five state colours. |
USlider | Orientation | map | Direction | EUISliderDirectionType has four values rather than two: horizontal and vertical each carry their reversed form, which UMG spells with a separate FlipForRightToLeft. |
USlider | SliderBarColor | adopt | SliderBarColor | FColor, and a TINT over the style's track colour -- which is what it is in Slate too (SSlider multiplies it over the bar image). Rides the track, not the fill. |
USlider | SliderHandleColor | adopt | SliderHandleColor | A tint over all five of the handle's state colours, so a tinted handle stays tinted through a hover. |
USlider | IndentHandle | map | bIndentHandle | Named with this codebase's bool prefix. On (the default, and what this slider has always drawn) the handle's travel is the track minus the handle's own width; off gives it the track's whole length, so the handle's centre reaches the ends and half of it hangs off. It is the handle AREA's inset either way, so the reported value is unaffected -- the same drag spans the same numbers. |
USlider | Locked | map | bLocked | Pushed to UUISlider::bLocked, which gates CalculateInputValue, the mouse capture and the navigation directions: a press on a locked slider begins no capture, so OnMouseCaptureBegin/End stay silent, as SSlider's do. Input only: SetValue keeps working, and the look does not change. |
USlider | MouseUsesStep | map | bMouseUsesStep | Named with this codebase's bool prefix. |
USlider | RequiresControllerLock | map | bRequiresControllerLock | Named with this codebase's bool prefix. |
USlider | StepSize | adopt | StepSize | |
USlider | IsFocusable | map | UDreamWidget::bIsFocusable | Every widget here carries it. |
USlider | bPreventThrottling | reject | Slate throttles the whole application's tick while a widget is being dragged, and this flag opts out of that. There is no Slate widget and no throttle here -- the UI is rendered geometry in the level. | |
USlider | OnMouseCaptureBegin | adopt | OnMouseCaptureBegin | |
USlider | OnMouseCaptureEnd | adopt | OnMouseCaptureEnd | |
USlider | OnControllerCaptureBegin | adopt | OnControllerCaptureBegin | |
USlider | OnControllerCaptureEnd | adopt | OnControllerCaptureEnd | |
USlider | OnValueChanged | adopt | OnValueChanged | |
USlider | GetValue | adopt | GetValue | |
USlider | GetNormalizedValue | adopt | GetNormalizedValue | A zero-width range answers zero rather than dividing by it. |
USlider | SetValue | adopt | SetValue | |
USlider | SetMinValue | adopt | SetMinValue | |
USlider | SetMaxValue | adopt | SetMaxValue | |
USlider | SetIndentHandle | adopt | SetIndentHandle | Re-places the handle area, which is the one thing it decides. |
USlider | SetLocked | adopt | SetLocked | |
USlider | SetStepSize | adopt | SetStepSize | |
USlider | SetSliderBarColor | adopt | SetSliderBarColor | |
USlider | SetSliderHandleColor | adopt | SetSliderHandleColor | |
USlider | SetStyle | adopt | SetStyle | Not a UFUNCTION on USlider (its Setter meta names it); added here so a look can be replaced at runtime. |