Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [AGK] Teletype effect

Author
Message
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 12th Feb 2023 21:33
Parameters you need to set are delay (time inbetween characters), line spacing (or line height, the distance between lines vertically), and line length (max number of characters per line). SetDialogText will parse a single string down into the appropriate amount of lines, breaking each line at a space when the next word would exceed the maximum line length.


setDialogText(dialog, string)
positionDialog(dialog, x, y)
teletype(dialog) : returns 1 when finished, else 0
resetDialog(dialog)


I used a mono spaced font and attached it but here's a link to where I found it.
https://www.1001freefonts.com/overpass-mono.font


Use the mouse to move the sprite (dialog box) around, the text will be set to follow. Press spacebar to start/restart the teletype effect.


Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda
Pixel-Perfect Collision

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 12th Feb 2023 22:48
So apparently SetTextMaxWidth is a thing and I could've avoided a lot of unnecessary work...
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda
Pixel-Perfect Collision

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Login to post a reply

Server time is: 2024-04-24 15:01:13
Your offset time is: 2024-04-24 15:01:13