Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Hope it helps:-
In Create event:
myPos=1
In script called from step event:
// Display First Line of Text
draw_set_halign (fa_left);
texttotype=(""+string(instruction01))
textx=((room_width-string_width(texttotype))/2)
copystr01=string_copy(texttotype,1,myPos01)
draw_text(textx,208,copystr01) // change 208 to your preferred height.
if copystr01<>texttotype then
{
myPos01+=0.45 // adjust this for typing speed in letters per frame. lower is slower.
{
Merry Christmas.
:)
Merry Christmas
My method involves two string variables and one variable meant to hold your position. There is a function called string_char_at() that's pretty useful here, but essentially you'd have the first string be what you want to say and the second string start blank, adding one letter to it at a time.
I can't actually test run this on the computer I'm working from at the moment, so forgive me if GM has a fit about something in there. Given I didn't botch something, how that should work is that one more letter from FullText should be added to DisplayText each step. If Pos gets high enough that it would try to add a character that doesn't exist, the additional steps won't occur, which is put in place as I'm pretty sure trying to add non-existent characters gets you an out of bounds error and crashes your game.
All that's left to do, then, is actually draw the text in your Draw event, which should give you that progressive, typewriteresque effect.
Function references: string_char_at()[docs.yoyogames.com], string_length()[docs.yoyogames.com].