DreamGUI
类参考

UDreamThrobber

A throbber whose hierarchy is code, not an asset: N pieces that pulse, saying only "something is

本页由 DreamGUIReferenceDocs commandlet 从反射生成,正文是头文件注释的原文(英文),所以不翻译——这样它永远和代码一致。概念讲解见核心概念。

Inherits from UDreamUIControl.

Declared in Public/Controls/DreamThrobber.h.

A throbber whose hierarchy is code, not an asset: N pieces that pulse, saying only "something is happening".

ONE CONTROL FOR UMG'S TWO, which is the call this library has already made three times: the progress bar has Bar and Radial rather than two classes, the slider has a Direction rather than two Blueprint presets, the scroll box has an Orientation. The pieces, the period, the colours and the fade are identical between a Throbber and a CircularThrobber; the only thing that differs is where the pieces are put, so that is one enum and not one class. The palette still offers both rows -- they differ by a single property write, exactly like the two sliders.

WHY IT TICKS, WHEN NOTHING ELSE IN THE LIBRARY DOES

Every other animated thing here is a TWEEN: it has a start, an end and a duration, and the tween manager owns the clock. A throbber has none of those -- it runs until somebody takes it off screen -- so a tween would have to be re-started forever, and a looping tween per piece would be N objects the manager walks every frame to do arithmetic this control can do in one pass. So it opts into NativeOnTick (off by default for every widget, see UDreamUserWidget::SetWantsTick) and writes the opacities itself.

That also makes it correct where the tween manager does not exist: the manager is a world subsystem and hands back null in a headless test and in the designer's preview, where a tween-based throbber would simply stand still. This one animates wherever something calls its tick, and holds its first frame where nothing does -- which is a throbber that LOOKS like a throbber in the designer rather than an empty box.

NO PLAY / STOP, for UMG's reason: a throbber is not a timeline. Take it off screen to stop it.

Properties

NameTypeCategoryIn the details panelFrom BlueprintDescription
StyleFDreamThrobberStyleThrobberyesGetStyle / SetStyleThis 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.
ShapeEDreamThrobberShapeThrobberyesGetShape / SetShapeA row of pieces, or pieces around a circle. UMG's Throbber and CircularThrobber.
bAnimateboolThrobberyesGetAnimate / SetAnimateOff holds the pieces at the phase they were on. The widget stops ticking with it.
bAnimateHorizontallyboolThrobberyesGetAnimateHorizontally / SetAnimateHorizontallyWhether a piece also PULSES on that axis -- UMG's bAnimateHorizontally / bAnimateVertically, and Slate's rule for them: the piece is scaled on the ticked axis by the same wave that drives its opacity, so it swells as it brightens and shrinks as it fades.
bAnimateVerticallyboolThrobberyesGetAnimateVertically / SetAnimateVertically
PieceRootNodeTObjectPtr<UDreamWidget>Throbber-read onlyWhat the pieces hang under, and the control's one built-in node.
PieceNodesTArray<TObjectPtr<UDreamWidget> >Throbber-read onlyThe pieces, in order. Public because a decorator may want to skin one.

Functions

FunctionKindDescription
bool GetAnimate()pureGet Animate
bool GetAnimateHorizontally()pureGet Animate Horizontally
bool GetAnimateOpacity()pureWhether the pieces fade at all -- UMG's bAnimateOpacity, read off how faint they are allowed to get: a floor of 1 keeps every piece solid, which is the flag being off.
bool GetAnimateVertically()pureGet Animate Vertically
int32 GetNumberOfPieces()pureThe four numbers UMG's two throbbers offer one at a time.
float GetPeriod()pureGet Period
float GetPhase()pureHow far through one cycle the animation is, 0 to 1. Authored in; readable out.
float GetRadius()pureGet Radius
EDreamThrobberShape GetShape()pureGet Shape
FDreamThrobberStyle GetStyle()pureGet Style
void SetAnimate(bool bInAnimate)callableSet Animate
void SetAnimateHorizontally(bool bInAnimateHorizontally)callableTurning it OFF re-places every piece at once, because a piece frozen mid-pulse would otherwise keep the width the last tick gave it -- a switch that leaves the thing it switched off in a random state is a switch that looks broken.
void SetAnimateOpacity(bool bInAnimateOpacity)callableOff pins the floor at 1. On restores the style's shipped floor, but only when the floor is currently 1 -- so switching off and on again is not a way to lose a hand-tuned value, and a throbber already fading keeps fading exactly as far as it did.
void SetAnimateVertically(bool bInAnimateVertically)callableSet Animate Vertically
void SetNumberOfPieces(int32 InNumberOfPieces)callableRebuilds the piece pool, which is what a count IS here.
void SetPeriod(float InPeriod)callableSeconds for one full cycle. Drives the linear shape too, where UMG offers it only on the ring.
void SetRadius(float InRadius)callableHow far out the pieces ride. Circular only, as in UMG; the linear shape ignores it.
void SetShape(EDreamThrobberShape InShape)callableRe-places every piece: the two shapes put them in different places, nothing else differs.
void SetStyle(FDreamThrobberStyle InStyle)callableThis instance's whole look, replaced and pushed -- which for a throbber means the piece POOL is rebuilt if the count changed. See UDreamButton::SetStyle for the caveat about the sheet.

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.

UMGMemberStatusHereNote
UCircularThrobberNumberOfPiecesmapFDreamThrobberStyle::NumberOfPiecesOne control and one style for UMG's two throbbers; Shape = Circular is this class.
UCircularThrobberPeriodmapFDreamThrobberStyle::PeriodSeconds for one full cycle, and it drives the linear shape too -- UMG only offers it on the circular one.
UCircularThrobberRadiusmapFDreamThrobberStyle::RadiusHow far out the pieces ride, measured from the middle. Circular only, as in UMG.
UCircularThrobberImagemapFDreamThrobberStyle::PieceBrushSee the Throbber table: a piece is a procedural rect, so the brush is its body texture.
UCircularThrobberSetNumberOfPiecesadoptSetNumberOfPiecesOne control for UMG's two, so this is the same call the Throbber table lists.
UCircularThrobberSetPeriodadoptSetPeriodDrives the linear shape too, where UMG offers it only on the ring.
UCircularThrobberSetRadiusadoptSetRadiusCircular only, as in UMG; the linear shape ignores it.
UCircularThrobberbEnableRadiusrejectThe inline tick beside UMG's Radius, and Transient there: it exists so an unticked radius falls back to the Slate style's. A radius here is always the style's own number, so there is nothing for a tick to choose between.
UThrobberNumberOfPiecesmapFDreamThrobberStyle::NumberOfPiecesIn the style: how many dots a project's spinners have is a theme decision, and the control rebuilds its piece pool on every push.
UThrobberbAnimateHorizontallyadoptbAnimateHorizontallySlate's rule, kept: the piece is SCALED on the ticked axis by the same wave that drives its opacity, so it swells as it brightens. One wave for both rather than a second clock. Off by default, which is what this throbber has always drawn.
UThrobberbAnimateVerticallyadoptbAnimateVertically
UThrobberbAnimateOpacitymapFDreamThrobberStyle::MinOpacityA float where UMG has a bool, and it says more: MinOpacity 1 is UMG's bAnimateOpacity off (every piece stays solid), and anything less is how faint a piece gets at the bottom of its cycle. GetAnimateOpacity / SetAnimateOpacity spell UMG's bool over it.
UThrobberImagemapFDreamThrobberStyle::PieceBrushFDreamUIFaceBrush rather than FSlateBrush -- a piece is a procedural rect and the brush is its body texture. Empty is the plain rounded dot.
UThrobberSetNumberOfPiecesadoptSetNumberOfPiecesRebuilds the piece pool, which is what a count IS here. Edits this instance's style; see UDreamBorder::SetPadding for the caveat about a project sheet.
UThrobberSetAnimateHorizontallyadoptSetAnimateHorizontallyTurning it off re-places every piece, so a piece frozen mid-pulse does not keep the width the last tick gave it.
UThrobberSetAnimateVerticallyadoptSetAnimateVertically
UThrobberSetAnimateOpacityadoptSetAnimateOpacityOff pins the floor at 1; on restores the shipped floor only when the floor is currently 1, so switching off and on is not a way to lose a hand-tuned value.
UThrobberSetStyleadoptSetStyleUThrobber has no style struct; this is the family's spelling, and the one call that rebuilds the piece pool.

本页目录