Skip to content

attract_camera

Anthony Samms edited this page Jun 1, 2026 · 2 revisions

The attract camera shows a live webcam feed during the attract mode sequence on the title screen.

AttractCamera

AttractCamera();

Opens the webcam specified by general.webcam_number in the config, plays the camera bgm at attract mode volume, and starts a TextureChangeAnimation for the animated LIVE icon. The start time is recorded so is_finished can track elapsed time.

void update(double current_ms);

Updates the webcam capture and the LIVE icon animation. The camera feed is considered finished after 30 seconds have elapsed since construction.

void draw();

Draws the camera background, then the live webcam frame if the camera is ready. The frame is rendered into a fixed destination rectangle (332, 119 to 962 × 589 scaled by tex.screen_scale) using DrawTexturePro. The animated LIVE icon and the static LIVE text are drawn on top.

bool is_finished();

Returns true after 30 seconds have elapsed since the object was constructed.

Clone this wiki locally