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
Show_message("A photo of a lady in a hat. Her smile reminds me of an old friend");
by
draw_text(40,50,"A photo of a lady in a hat. Her smile reminds me of an old friend...");
and that doen't work at all. Please, any input?
This drove me crazy all weekend é_è
All I can find is tutorial on how to make a text box, jrpg style, with typewriter effect and the possibility to speed up the text and all...I just don't know what I am supposed to leave out of these codes if I just want the text to display.
Pick the font that you want and give it name, just like you name anything else. Lets call it font_text_log. Try a size of 12 to start. You can also try Arial Rounded MT Bold as an example. Now that you have created a font, you can use it in your code as shown below.
Also, I think you probably want to use the draw_text_ext command so that you can control the length of your text line and the spacing between lines. Also set the color.
draw_set_color(c_white);
draw_set_font(font_text_log);
draw_text_ext(40, 50, "A photo of a lady in a hat. Her smile reminds me of an old friend", 18, 200);
Create Event:
text_index = 0;
Step Event:
if keyboard_check_pressed(ord('T'))
text_index += 1;
if text_index > 1
text_index = 0;
Draw or Draw GUI Event:
draw_set_color(c_white);
draw_set_font(font_text_log);
if text_index != 0
&& point_distance(x, y, your_object.x, your_object.y) < 200
draw_text_ext(40, 50, "A photo of a lady in a hat. Her smile reminds me of an old friend", 18, 200);
Make sure you review the code and understand how and why it works.
Draw or Draw GUI Event:
draw_set_color(c_black);
draw_set_alpha (0.7);
draw_roundrect(35,45,215,85,0);
draw_set_alpha (1);
draw_set_color(c_white);
draw_set_font(font_text_log);
if text_index != 0
&& point_distance(x, y, your_object.x, your_object.y) < 200
draw_text_ext(40, 50, "A photo of a lady in a hat. Her smile reminds me of an old friend", 18, 200);
Just remember in draw events, everything draws in sequence. So with the code above, it draws the rectangle FIRST. And then it draws the text on top of the rectangle.
If you put the draw text code first, then the rectangle would get drawn over the top of the text.
Edit:
Also notice how I changed the alpha here. Everytime you draw something, if you want a different alpha, font, or color, you need to set it each time. Unless you are using the same settings for all text or drawing, in which case you can just set it one time at the top of your draw event.
So, in this example I set the alpha transparency of the rectangle to 0.7. But then I change the alpha back to 1 so that I have full color alpha when drawing the text after drawing the rectangle.
http://steamcommunity.com/sharedfiles/filedetails/?id=863401756
For example the:
draw_set_color(c_white);
draw_set_font(font_text_log);
draw_text_ext(40, 50, "A photo of a lady in a hat. Her smile reminds me of an old friend", 18, 200);
That, I get. It's telling GMS that under a certain circumstance, it will draw a text, in white, with the fon_text_log and at the coordonates, and the text written in " ". I don't know what the 18,200 stands for though; I'm going to assume it is for the number of characters and/or the distance between two lines of text one over the other. But simple question: where do I type the code? Is it a script? Do I put it inside the "step" event for the main character?
As for the rest, I don't really understand how to put it in practice even though I finally understood the underlying logic behind the process, but I'm going to say this: I'm a real beginner, and I don't now how to manipulate this software yet.
So I keep this code under my pillow, and I'm going to watch every single rpg tutorial from Heartbeast on YT, which hopefully will give me the basics to understand your answer, because I obviously lack the very fundations to make it.
Thank you nonetheless! That will come in handy at some point. :D