User Tools

Site Tools


4rpl:commands:showgamemessage

This is an old revision of the document!


Index

ShowGameMessage

ShowGameMessage(<-messageID <-button0Text <-button1Text <-pauseGame <-callbackFunction)

Description

Shows a game message by message key. A game message is a popup message that appears at the top of the screen.
'messageID' is the ADA message ID to show. Create a message using the ADA message editor, and reference it via it's ID.
The 'button0Text' and 'button1Text' are used to show one or two buttons. If you don't want button(s), set them to “”. Otherwise buttons will be shown and the specificed text will be on the buttons.
Set 'pauseGame' to true to auto pause the game.
The 'callbackFunction' is the name of the function to call when a button is pressed. If a button is shown, a callback will be made when the button is pressed. A varialbe named '_DATA' will contain either a 0 or 1 to indicate which button was pressed.
If a message is already showing, then calling this function will do nothing. If you want to replace the message, you must first call CloseGameMessage if there is already a message showing.
You can use “\\n” to create a line break in the button text.

Examples

ShowGameMessage("MyMessage" "Yes" "No" true "GameMessageCallback")
 
:GameMessageCallback
   <-_DATA ->result
   if (<-result eq0)
      print("Button 0 Pressed")
   else
      print("Button 1 Pressed")
   endif

Index

4rpl/commands/showgamemessage.1610121708.txt.gz · Last modified: 2025/02/14 14:56 (external edit)