Skip to main content

Module game_tweens

Module game_tweens 

Source
Expand description

Game-specific tween presets — ready-to-call functions that wire the tween engine to specific game events: menu navigation, combat, screen transitions, stat changes, level ups, death, victory, and more.

Each function takes a &mut TweenManager and the minimum context needed (glyph IDs, bar IDs, positions, values), starts the relevant tweens, and returns the tween IDs for optional cancellation.

Functions§

boss_entrance
Boss entrance: dramatic camera + screen effects.
combat_hit_shake
Combat hit screen shake.
crafting_forge
Forge: glyphs converge to center and flash.
crafting_shatter
Shatter: glyphs explode outward from a center point.
crit_damage_number
Critical hit damage number: bigger arc, gold flash, longer duration.
damage_number_arc
Spawn a damage number arc: rises, scales from big to normal, fades out.
death_text_reveal
“YOU DIED” text scales up from 0 with spring easing.
entity_assemble
Assemble entity: glyphs fly in from scattered positions to formation targets.
entity_death_scatter
Entity death: glyphs scatter and fade.
entity_hit_recoil
Entity hit recoil: brief scale squish + position bump.
heal_number
Healing number: green, floats up gently.
hp_bar_change
Smoothly animate an HP bar from current to new percentage.
hp_bar_damage
Full HP change: animate both fill and ghost bar.
hp_ghost_bar
Ghost bar (recent damage indicator): delays, then slides down.
level_up_ring
Level up pulse ring: expanding ring of glyphs radiating outward.
level_up_screen_flash
Level up screen flash.
menu_cursor_pulse
Pulse the cursor glyph’s emission to indicate it’s selected.
menu_cursor_slide
Slide the menu cursor glyph from one Y position to another.
menu_select_flash
Menu selection confirm: flash bright then fade.
mp_bar_change
MP bar smooth change (no ghost).
pulse_emission
Pulse a glyph’s emission in a loop (for highlights, cursors, etc.). Returns the tween ID — cancel to stop pulsing.
room_cursor_slide
Slide the room cursor to a new position.
room_transition_pan
Room transition: brief camera pan.
score_roll_up
Score counter rolls up from 0 to final value.
screen_crossfade
Theme/screen crossfade: fade out old, swap, fade in new.
screen_fade_through_black
Instant fade to black, hold, then fade in.
stat_decrease_flash
Flash red when a stat decreases.
stat_increase_flash
Flash a stat glyph gold when a stat increases.
status_effect_apply
Apply a status effect visual: tint + emission pulse.
typewriter_reveal
Text typewriter reveal: stagger alpha on each glyph.
victory_text_drop
Victory text entrance: each character drops in with bounce.
xp_bar_fill
XP bar fill (slower, more satisfying).