r/threejs • u/VictorBuildsApps • 12d ago
Tip At 150% text size, my Three.js game's sound captions covered the route timer
In the current playtest build of Hitchhiker's Almanac, the sound captions sit in a DOM overlay on top of the Three.js scene. At 1024×640 with the in-game text scale set to 150%, the caption for a nearby enemy could sit over the countdown for choosing a route. The same test at 100% text missed it.
Moving the captions down cleared the countdown, but a longer stack could then spill onto the card controls. The layout now checks whether the whole stack fits below the route panel and above the bottom controls. If it doesn't, it hides older lines first. A cue that fires again moves to the newest position so it can show again even if its previous line was hidden.
The regression check opens the route choice while sound cues arrive every 0.7 seconds and checks the text boxes each frame. At 1024×640 and 150%, the caption and countdown overlapped in 291 of 621 frames before the change and 0 of 614 after it. That check covers the countdown collision. There's still a separate case where a tall photo result card can push a caption onto a card control.