Here is my final blocking-but-not-pausing Display replacement. Basically all it requires other than the code below is to create a GUI named gDisplay with a Label control on it named dLabel, and set the view mode to Normal (but make sure a gDisplay.Visible = false; is added in your game_start).
Any suggestions for improvements are welcome, but I'm pretty happy with this at the moment, and I'm super happy that I can change the font and margins with this replacement (the default font for Display() is very ugly, and the margins are way too close to the text IMO). Basically this is pretty much the same as Display() except rep_ex_always is allowed to continue, which in my case allows for some other animation (namely the typewriter effect I mentioned in another thread) to continue without pausing awkwardly. I imagine it could also be useful for things like repeated animations (e.g. fire) that you wanted to persist.
Note that in my case I have a pure text parser GUI (no mouse at all) that I am hiding here when the display window is open; if you were using a mouse control system I imagine you would do something else to indicate that input was "paused".
Code: ags
Any suggestions for improvements are welcome, but I'm pretty happy with this at the moment, and I'm super happy that I can change the font and margins with this replacement (the default font for Display() is very ugly, and the margins are way too close to the text IMO). Basically this is pretty much the same as Display() except rep_ex_always is allowed to continue, which in my case allows for some other animation (namely the typewriter effect I mentioned in another thread) to continue without pausing awkwardly. I imagine it could also be useful for things like repeated animations (e.g. fire) that you wanted to persist.
Note that in my case I have a pure text parser GUI (no mouse at all) that I am hiding here when the display window is open; if you were using a mouse control system I imagine you would do something else to indicate that input was "paused".
function dDisplay(String message) {
gDisplay.Width = 250; //reset to max width
dLabel.Width = 244; //reset to max width
if(GetTextWidth(message, dLabel.Font) < dLabel.Width) { //shrink width if just a little bit of text
int rMargin = (gDisplay.Width - dLabel.Width)/2; //make sure it has the same right hand margin as before
dLabel.Width = GetTextWidth(message, dLabel.Font)+4; //new label width -- pad it a little because sometimes GetTextWidth comes up a few pixels short
gDisplay.Width = dLabel.Width + rMargin; //set right margin of GUI
}
dLabel.Height = GetTextHeight(message,dLabel.Font,dLabel.Width); //resize height
gDisplay.Height = dLabel.Height + (dLabel.Y*3);
dLabel.Text = message; //set message
gDisplay.Centre(); //center
gDisplay.Visible = true; //make this GUI visible
gTextparser.Visible = false; //make parser invisible
WaitKey(2400); //display for a minute, or wait until they hit a key
gTextparser.Visible = true; //make parser GUI visible
gDisplay.Visible = false; //make this GUI invisible
}