this weekend i'm adding speech bubbles to a prototype
it might get messy and to keep me motivated i'll post the progress here so mute this thread if you're not interested in speech bubbles and nobody will judge you for it
the objective is to make this dog talk
basic styling and hitting my first hurdle as i can't find a proper english word for the little trail attached to the bubble
it's a tail/pointer, moving on
basic tracking
a Transform represents the talker's origin, i'm adding an offset to get the bubble world's origin (blue point), then translating it from world space to screen space, and finally adding a screen offset
this way i can also get the trail's direction, which will be the direction from the bubble to the talker's origin, both in screen space
i don't want the tail to ever go in a straight vertical direction so i added an automatic x offset to the bubble according to the talker's direction vs player's position
clamping it like a pro
using textmeshpro to predict the bubble size according to the text + adding some padding
taking a quick break to decipher the guitar chords of the bridge from the 1995 hit song SECRET HEART by Ron Sexsmith
it's Fm(add9)
moving on to animation
alright now
launching the "talk" action starts a coroutine which handles the whole dialogue, it
- scales up the speech bubble
- setups the bubble size
- displays the text one character at a time
- waits for the player's input
- loops back if there is another line, else scales down
the text animation is a well known trick which consists of setting the whole text with maxVisibleCharacters to 0, and increasing this last value over time (vs creating a new string each time by adding a character🙃)
added a small lerp to the offset thing + events when a bubble starts and ends
there is a bug, the height of a block of text is randomly overestimated from time to time and i'll fix it tomorrow because i'm done for today
i fixed the bug it was a margin issue
today i'm going to try adding text animations
here is a mockup for reference
it is too difficult©
instead i made a pooling system for the bubbles and added the option for automatic closing vs wait for player's input
with help from @mikeevmm, now with characters animation !!
very happy to be on vacation while the indie video game discourse is apparently about text boxes now
You can follow @ok_remi_ok.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: