Home | SCI Documentation | SCI Tutorials | SCI Tools | SCI Wiki | Community

Chapter 24 - Using The Print Procedures

The print procedures allow you to print message boxes. These are most commonly used to simply print messages throughout the game, but they are also used for things such as the quit dialog, death dialog, and more! They can do far more than print messages. They can have buttons, title bars and icons. You can set their width, font, coordinates and more!

There are five different print procedures, each with their own purpose. They are Print, IconPrint, EditPrint, GetNumber and FormatPrint.

The Print Procedure

The Print procedure prints a message box on the screen. It can take a virtually unlimited amount of parameters. Each parameter starts with it's name then it's subparameters. Here are some examples.

Printing a Plain Message

Example:
Code:
Print("Hello World")

This would print the following:
Hello World

Printing a Message With a Title

Example:
Code:
Print("Hello World" #title "This is the title!")

This would print the following:
Hello World with title

Changing The Font

Example:
Code:

Print(
  "Hello World"
  #title "This is the title!"
  #font LARGE_FONT
)

This would print the following:
Hello World with large font

Printing With An Icon

Example:
Code:
Print(
  "Look! It's an icon!"
  #title "An Icon Print!"
  #font LARGE_FONT
  #icon 0 0 0
)

This prints the message box with view.000 loop #0, cel #0 as it's icon.

This would print the following:
Hello World with icon

Printing With Buttons

Example:
Code:
(var button)
=
button Print(
  "Do you want to click Yes or No?"
  #title "Click What?"
  #font LARGE_FONT
  #icon 0 0 0
  #button " Yes " 1
  #button " No " 0
)
(
if(== button 1)
  Print("You clicked YES")
)(
else
  Print("You clicked NO")
)

When specifying the buttons, you give their name, and then their number ID. It then returns the ID of the button clicked. In the example, we check which button was clicked, then display another message box stating which button the player clicked.

This would print the following:
Hello World with buttons

That sums up the print procedure. For more detailed information on it, and the others available, see the section in the Script Controls section from the SCI Studio Help File.

< Previous: Chapter 23 - Using The Death Handler Next: Chapter 25 - Customizing The Menubar >
 

by helping to defray some of the costs of hosting this site. If it has been of help to you, please consider contributing to help keep it online.
Thank you.
pixe
Top

© 2013 to present The Sierra Help Pages. All rights reserved. All Sierra games, artwork and music © Sierra.