I am trying to implement a dialogue system for a game that I am making. I have the actual system for handling the text and input all set up. My question is asking about how you actually show the text and have it formatted properly in a certain sprite.
Asked
Active
Viewed 482 times
1 Answers
0
The "best way" is a broad and subjective term, and it may be different for each person, but I can give you some tips regarding the question in your second sentence, to put you in the right direction:
How to actually show the text and have it formatted properly in a certain sprite?
- Considering a dialogue box is a User Interface, you should put the code, that draws the dialog box, in the
Draw_Gui
of the object. Because that will draw stuff in front of the camera, and doesn't need to keep positions of the map in mind. SinceDraw_Gui
is in an object, you can put the dialogue box in a parent NPC, or let a seperate persistent object handle it (called an object manager) - To format it properly within a sprite, you can use
draw_text_ext(x,y,string,sep,w)
, especially thew
parameter will be helpful, as that allows you to let the text start on a new line if it exceeds past that width, and thesep
parameter let you deside the space between the lines of text, to ensure the amount or lines in your dialog box will look clean.

Steven
- 1,996
- 3
- 22
- 33