Overview
ThePowerAnimation component is a factory component that selects and renders the appropriate power animation based on the original system’s display technology. It automatically chooses between CRT, LCD handheld, or LCD portable animations to create authentic, era-appropriate visual effects when powering games on or off.
Use this component when you want GameLord to automatically select the correct animation style based on the system being emulated. For direct control over a specific animation type, use the individual animation components like CRTAnimation.
Props
The display technology of the original hardware. Determines which animation style to render.Valid values:
'crt'- CRT television animation (home consoles, arcade)'lcd-handheld'- Passive/reflective LCD animation (Game Boy, GBA, DS)'lcd-portable'- Backlit TFT/IPS animation (PSP, modern portables)
Whether this is a power-on or power-off animation. Power-on animations simulate hardware warming up and revealing the screen. Power-off animations show the display shutting down.
Callback function invoked when the animation sequence completes. Use this to transition to the next state (e.g., showing the game canvas after power-on, closing the window after power-off).
Optional override for total animation duration in milliseconds. Each animation type has its own default duration tuned for authenticity. Only override this if you need synchronized timing across different animation types.Default durations:
- CRT power-on: 800ms
- CRT power-off: 500ms
- LCD animations: vary by type
Usage
Display type mapping
GameLord includes a built-in mapping from system IDs to display types:Animation behavior
ThePowerAnimation component delegates to specialized animation components based on the display type:
-
CRT (
displayType="crt"): Simulates a CRT television warming up (horizontal line expanding to full screen with phosphor glow and static) or shutting down (screen collapsing to a line, then a glowing dot that fades out). -
LCD Handheld (
displayType="lcd-handheld"): Mimics the appearance of passive/reflective LCD screens powering on with characteristic ghosting and fade-in effects. -
LCD Portable (
displayType="lcd-portable"): Recreates the backlit TFT/IPS panel boot sequence with modern LCD characteristics.
The animation is rendered with
z-index: 100 and pointer-events: none, positioned absolutely over the game canvas. It won’t interfere with user interaction during the animation sequence.Integration example
Here’s howPowerAnimation is used in GameLord’s GameWindow component:
Related components
- CRTAnimation - Direct CRT television animation component
LCDHandheldAnimation- LCD handheld animation (Game Boy, GBA, DS)LCDPortableAnimation- LCD portable animation (PSP and modern portables)