Create Event:
execute code:
mytext = "Sir Winston Leonard Spencer-Churchill, (30 November 1874 – 24 January 1965) was a British politician and statesman, soldier in the British Army, orator, and strategist, and is studied as part of the modern British and world history. A prolific author, he won the Nobel Prize in Literature in 1953 for his writings on British and world history.. ## Source: Wikipedia.org";
In this first part I assign the text to a variable. mytext is henceforth a variable containing this string. It will be the content that I write out.
Draw Event:
execute code:
draw_rectangle_color(0,0,room_width,room_height,c_ltgray,c_ltgray,c_gray,c_gray,false);
draw_set_color(c_gray);
draw_set_alpha(0.
;draw_rectangle(20,40,room_width-20,room_height,false);
draw_text_color(20,5,"Tell me all you know about# Winston Churchill!",c_gray,c_gray,c_black,c_black,1);
draw_set_alpha(1);
draw_set_color(c_black);
This code above here is just some layout stuff that I put together, you don't need to care about. This which I will show you next is the important stuff...
draw_text_ext(25,45,string_copy(mytext,1,string_length(keyboard_string)),-1,room_width-50);
draw_text_ext will write out a string will write out a string at a suiting position, with correct width and separation. The string will be what the user sees and it needs to be as long as what he has written himself. What the user writes is automatically stored in a variable called keyboard_string, which makes this pretty simple. We simply copy as many letters from the variable mytext as keyboard_string consists of. string_length(keyboard_string) is the number of characters the user has input, so now we copy that many characters from mytext, and that will be what we write out: string_copy(mytext,1,string_length(keyboard_string))
<b>Example:</b> Download
Ask any questions by commenting, as always
Comments
Loading comments...