Talk:ShowAsHelpMessage - Message

Active discussions

Display Text in Center of ScreenEdit

I've found this can be used as a workaround to display text in the center of the screen without using a messagebox. Not the intended use, but I haven't run into any problems so far.

Advantages: Text is more visible in center of screen. Longer text does not compress into tiny fonts (like it does in the upper left corner with Show()). Can set display time. Can use Button Tag Replacement.

Limitations: Text in center of screen can be intrusive. Can't use carriage returns, so can't make the text display lower than the vertical center. If you use a carriage return in the message form, nothing after the return will display. \n just displays as \n, and %r gives an error when editing the form.


Example:

Message property __aHelpMsg auto

...

string HelpMsgEvent = "__aHelpMsgEvent" ; this can be anything at all as long as it's not an event that the game already uses, such as 'jump' -- to be safe, add your mod prefix

float HelpMsgDisplayTime = 2.0 ; unlike the display time in the message form, which doesn't do anything, this actually works

int MaxTimesToDisplay = 1 ; if you set this to any other number, the message will repeat that many times (0=indefinitely); if you're using a custom help message event, the user cannot complete the action (as they can with 'jump'), so the message will continue to repeat itself

__aHelpMsg.ShowAsHelpMessage(HelpMsgEvent,HelpMsgDisplayTime,0,MaxTimesToDisplay)

Utility.Wait(HelpMsgDisplayTime) ; ResetHelpMessage will only execute successfully once the help message display time has passed

Message.ResetHelpMessage(HelpMsgEvent) ; this allows you to use the same event again


--Jayne2132 (talk) 2015-01-29T12:09:47 (EST)

Return to "ShowAsHelpMessage - Message" page.