Keeping a paper talisman readable on a phone in RagePal
The doll in RagePal wears a paper talisman with an invented grievance and, sometimes, a nickname. It sits on the 3D character, which means the label has to stay readable at the size of a phone screen. A two-word label and a longer translation still get the same piece of paper.
We draw the paper in a 2D canvas and use it as a Three.js texture. Before measuring anything, we pass the actual grievance and name to the browser's font loader. The brush font is split into character ranges, so asking for the font by name alone can leave the characters we need unloaded. We cap the wait at 2.5 seconds so a slow font does not hold the scene indefinitely.
The text layout treats the name and grievance as separate blocks. We measure the widest line to fit it within the paper. A long nickname can use two lines if that keeps it substantially larger. If the name still squeezes the grievance, we reduce the name in small steps and give that room back to the grievance. Korean, Japanese, and Chinese labels can stack in short lines. The current fallback keeps unspaced Thai text together, which can make a long Thai label look small.
I’d like to hear from developers who put player-facing text into textures. For a narrow label in Thai, would you start with language-aware line breaking or put a separate text label next to the prop? I’m especially interested in what stays readable on a small phone.
AlyDoit’s RagePal game page and iOS and Android links
AI assisted with drafting this post. The rendering details are based on the project’s current implementation.
Comments(0)
Help the developer improve their game
Join the discussion
Sign in to share your feedback on this devlog.
No comments yet. Be the first!