5. Hand and animations¶
5.1 QuickCards Hand (UQuickCardsHandWidget)¶
A hand of cards along the bottom of its widget, in a fan or a row (the UMG palette's QuickCards Hand, or Create Widget; anchor it to the bottom of the screen and give it the width the hand may use). It's deliberately basic: the layout, picking up, carrying and tapping. What a release means is the game's (On Card Released).
- Hover (PC) lifts and enlarges a card and stands it straight; on touch, pressing does the same.
- Tap / click fires On Card Tapped and, by default, opens the inspect view.
- Press and drag past Pick Up Distance picks the card up: it follows the pointer, a little bigger, leaning with its movement (through its own feel: a Floaty card swings). On Card Picked Up and On Card Moved fire.
- Let go fires On Card Released with the pointer's absolute (screen) position. Remove the card there to take it out; otherwise it slides back to its place, or, let go over the hand, takes the place it was let go at.
- New cards rise into the hand from below; the others glide to make room. No ticking work while nothing moves.
- The hand's empty space doesn't catch the pointer: clicks there reach what's behind it.
QuickCards | Hand
| Setting | Default | Notes |
|---|---|---|
| Shape | Fan | Fan (the outer cards turned and lower) or Row |
| Card Width | 160 | Hand units; the height follows the card's shape |
| Spacing | 0.75 | Between neighbors' centers, in card widths: 1 = edge to edge, less overlaps |
| Squeeze To Fit | on | Closer together when the cards would be wider than the hand |
| Angle Per Card | 5° | Fan: the turn from one card to the next |
| Max Angle | 18° | Fan: the most the outer cards turn |
| Arc Height | 0.08 | Fan: how much lower the outer cards sit, in card heights (at Max Angle) |
| Bottom Padding | 16 | Between the cards' bottom edge and the hand's |
| Hover Lift | 0.3 | Card heights a hovered card rises |
| Hover Scale | 1.2 | |
| Straighten On Hover | on | A hovered card in a fan stands straight |
| Carry Scale | 1.1 | |
| Carry Lean | 1 | How much a carried card leans with its movement; 0 = none |
| Reorder On Release | on | Let go over the hand, a card takes that place |
| Inspect On Tap | on | Tapping opens the inspect view (Inspect Widget Class: QuickCards Inspect or your own) |
| Card Feel Preset | none | The cards' feel; empty = the card widget's own |
| Pick Up Distance (Advanced) | 8 | Hand units a press moves before it's a pick-up, not a tap |
| Move Speed (Advanced) | 14 | How quickly cards glide to their places |
| Card Class (Advanced) | QuickCards Card | Or your subclass with its own defaults |
Gamepad and keyboard: the hand is focusable. Focusing it (Set Keyboard Focus, or gamepad navigation onto it) focuses its middle card; Focus Card focuses one. The focused card rises like a hovered one and takes keyboard focus itself, so the right stick tilts it (its Feel's Gamepad Tilt). Left / Right (arrows, D-pad, left stick) move the focus along the hand; Enter / Space / the confirm button tap the focused card (On Card Tapped, the inspect view). Removing the focused card focuses its neighbor.
Blueprint: AddCard (Card, Index = end), AddCardInstance, RemoveCard, ClearHand, MoveCardToIndex,
GetCards, GetCardCount, GetCardIndex, GetCarriedCard, GetHoveredCard, FocusCard, GetFocusedCard,
CancelCarry (slides back, no release event). Get Card Place (Index, Count, Hand Size) is overridable in a Widget Blueprint made from the hand:
return each card's center, turn and scale for your own layout (hover and carrying are applied on top). A Widget
Blueprint may also hold a Canvas Panel named "CardPanel" for the cards (otherwise one is made).
Events: On Card Added, On Card Removed, On Card Hovered, On Card Unhovered, On Card Tapped, On Card Picked Up, On Card Moved, On Card Released (Hand, Card, Absolute Position for the pointer ones).
5.2 Animation nodes (UQuickCardsAnimationLibrary, palette: QuickCards > Animation)¶
Nodes that wait until the animation ends before running the next node (latent, like Delay; Event Graph only), so a sequence is one straight chain. The card widget's own Flip Card, Show Side and Play Reveal Sweep start the same animations without waiting; On Card Flipped and On Reveal Sweep Finished fire when they end (sounds, haptics).
| Node | Inputs (default) | Next node runs |
|---|---|---|
| Flip Card and Wait | Card, Duration (0.5 s) | when the card lands on its other side |
| Show Side and Wait | Card, Back (off), Duration (0.5 s; 0 = at once) | when it lands on that side |
| Play Reveal Sweep and Wait | Card, Duration (0.8 s), Strength (1) | when the light has crossed |
| Move Widget To | Widget (a card or any widget), Offset, Angle (0°), Scale (1), Duration (0.4 s), Easing (Ease In Out) | when it arrives |
Move Widget To moves the widget's render transform (from where it's drawn now to Offset from its place in its layout, turned and sized), so the layout around it doesn't shift; Easing is the engine's easing list (Linear, Ease In, Ease Out, Ease In Out, Expo, Circular, Sinusoidal, Step...). A node called again while it's still running is ignored (like Delay). Cards in a QuickCards Hand are placed by the hand: move those with the hand instead.