AS FAR AS I KNOW, THE ANSWER TO YOUR QUESTION IS
NO, HOWEVER
So I have textboxes in my game which are rectangular. (When it comes to solving this problem rectangular and square are the same, however a circle textbox is more difficult). I of course have text inside the textboxes.
Here is a script I made for creating a textbox in the centre of the current view in the room
Code:
textbox_height = 64 (refers to heigh of Text_box background resource)
textbox_top = view_yview - 8 + ((view_hview - textbox_height)/2)
textbox_width = 196 (refers to width of Text_box background resource)
textbox_left = view_xview + ((view_wview - textbox_width)/2)
draw_background(Text_box, textbox_left, textbox_top)
draw_set_font(fnt_standard)
draw_text_ext(textbox_left + 5, textbox_top + 3, argument0,-1,187)
/*
NOTE: TEXTBOXES ARE CENTRED HORIZONTALLY, BUT IN TERMS OF VERTICAL (Y) POSITION,
THEY ARE SLIGHTLY above the mid-y-position of the screen’s view.
Within the draw event of my text object I call the script with the given arguments:\
Code:
script_execute(scr_Draw_Text_and_Box, "The door is locked.")
SOLUTION 1
Create different fonts of different sizes, and to set the different fonts(with the different sizes) for each different variable string.
Using the
function you can set the font to different sizes so that it fits your textbox. You will have to start off with a font size that will cause the text to not fit in your square then keep setting the font smalller by 1 each time until you reached the biggest possible size to have your text for the particular variable string.
for instance argument0, the fonts should be named after the font size of the font: font_size_8 OR font_size_10 OR font_size_12
where font_size_8 refers to the font that is sized as 8 and so on...
SOLUTION 2
Use 1 font with 1 font size.
Fit as much of the text in the textbox as you can.
With the rest of the text that you could not fit, there will be a second identical textbox (but with different string) which is created upon the destruction of the previous textbox.
E.g. pressing down destroys text 1 and creates text 2 while maintaing the same textbox and font size.
Using as many text objects as you need to get through all of your string.
If you want to see the code for my text objects which I figured out how to run smoothly let me know and I will give you all the code you need.