SCICompanion
3.0
  • Overview
  • Getting Started
  • View Editor
  • Pic Editor
  • Script editor
  • The SCI0 class library
  • The SCI1.1 class library
    • Classes
      • Actor (of Prop)
      • AnimDialog (of Dialog)
      • Approach (of Motion)
      • BegLoop (of CycleTo)
      • Blink (of Cycle)
      • Block (of Object)
      • BorderWindow (of SysWindow)
      • Cage (of Block)
      • Chase (of Motion)
      • ChoiceNarrator (of Narrator)
      • ChoiceTalker (of Talker)
      • Code (of Object)
      • Collection (of Object)
      • Control (of Object)
      • ControlIcon (of IconItem)
      • Controls (of List)
      • Conversation (of List)
      • Cue (of Object)
      • CueObj (of Script)
      • Cursor (of Object)
      • Cycle (of Object)
      • CycleTo (of Cycle)
      • DButton (of Control)
      • DCIcon (of DIcon)
      • DColorButton (of DButton)
      • DEdit (of Control)
      • Dialog (of List)
      • DialogEditor (of List)
      • DIcon (of Control)
      • Door (of Prop)
      • DPath (of Motion)
      • DSelector (of Control)
      • DText (of Control)
      • Ego (of Actor)
      • EndLoop (of CycleTo)
      • Event (of Object)
      • EventHandler (of Set)
      • Feature (of Object)
      • FeatureWriter
      • FiddleStopWalk (of Smopper)
      • File (of Object)
      • FileSelector (of DSelector)
      • Flags (of Object)
      • FlickerCycler (of Cycle)
      • Follow (of Motion)
      • Forward (of Cycle)
      • ForwardCounter (of Forward)
      • Game (of Object)
      • GameControls (of IconBar)
      • GameEgo (of Ego)
      • Gauge (of Dialog)
      • GradualCycler (of Cycle)
      • GradualLooper (of Code)
      • IconBar (of Set)
      • IconItem (of Object)
      • Inset (of Code)
      • InsetWindow (of BorderWindow)
      • InventoryBase (of IconBar)
      • InventoryItem (of IconItem)
      • Jump (of Motion)
      • JumpTo (of Jump)
      • List (of Collection)
      • MessageObj (of Object)
      • Messager (of Object)
      • Motion (of Object)
      • MouthSync (of Cycle)
      • MoveCycle (of Cycle)
      • MoveFwd (of PolyPath)
      • MoveTo (of Motion)
      • Narrator (of Prop)
      • Object
      • OnMeAndLowY (of Code)
      • Orbit (of Motion)
      • Oscillate (of Cycle)
      • PAvoider (of Code)
      • PChase (of PolyPath)
      • PFollow (of PolyPath)
      • PolyEdit (of List)
      • Polygon (of Object)
      • PolyPath (of Motion)
      • Print (of Object)
        • Properties
        • Methods
      • PriorityTalker (of Talker)
      • Prop (of View)
      • PseudoMouse (of Code)
      • RandCycle (of Cycle)
      • RangeOscillate (of Cycle)
      • Region (of Object)
      • RegionPath (of MoveTo)
      • RelDPath (of DPath)
      • Restore (of SaveRestoreDialog)
      • Reverse (of Cycle)
      • Room (of Region)
      • Save (of SaveRestoreDialog)
      • SaveRestoreDialog (of Dialog)
      • Scaler (of Code)
      • ScaleTo (of Scaler)
      • Script (of Object)
      • ScrollableInventory (of InventoryBase)
      • ScrollInsetWindow (of BorderWindow)
      • Set (of List)
      • Slider (of IconItem)
      • SmoothLooper (of Code)
      • Smopper (of Cycle)
      • Sound (of Object)
      • Sounds (of EventHandler)
      • SpeakWindow (of SysWindow)
      • SQ5 (of Game)
      • StopWalk (of Forward)
      • Sync (of Object)
      • SysWindow (of Object)
      • Talker (of Narrator)
      • TimeOut (of Object)
      • Timer (of Object)
      • Track (of Motion)
      • User (of Object)
      • View (of Feature)
      • Walk (of Forward)
      • Wander (of Motion)
      • Window (of SysWindow)
    • Script Files
    • Public Procedures
  • Kernel Functions
  • SCI Studio compatible compiler
  • The SCI Compiler
  • Text Editor
  • Message editor
  • Sound Editor
  • Vocabs
  • Font Editor
  • Cursor Editor
  • VGA Palette Editor
  • Digital Audio
  • Output Pane
  • Debugger
  • Undo
  • Aspect Ratio
  • Palette cycling
  • Anatomy of an SCI game
  • Decompiler
  • Preferences
  • Game/Interpreter Versions
  • Importing and exporting resources
  • Extract All
  • Handy tips
  • A Basic Tutorial
SCICompanion
  • Docs »
  • The SCI1.1 class library »
  • Classes »
  • Print (of Object)
  • View page source

Print (of Object)¶

class Print¶

Defined in Print.sc.

The Print class lets you show text, buttons and images in a GUI on screen.

It is generally used as a static class, in the sense that you call methods on Print directly without making an instance of it. The init: method then displays the dialog.

Example usage:

(Print
        addTitle: "This is the title"
        font: 0
        width: 90
        addText: "Enter new font number:"
        addEdit: @temp0 6 0 24
        addButton: 0 "A button!" 0 12
        init:
)

Properties¶

Inherited from Object:

Property Description
name  

Defined in Print:

Property Description
dialog  
window  
title The dialog title.
mode Default alignment: alLEFT, alCENTER or alRIGHT.
font  
width  
x  
y  
ticks  
caller  
retValue  
modeless  
first  
saveCursor  

Methods¶

init([theCaller text])

Calls showSelf() to show the dialog.

Parameters:
  • theCaller (heapPtr) – An optional object with a cue method.
  • text (string) – Optional text that is added to the dialog.
Returns:

If a button was pressed, returns the value of that button.

doit()
dispose()
showSelf()

Shows the dialog. Generally, you should use the init() method to show the dialog.

addButton(theValue noun verb cond seq [x y modNum])
addButton(theValue text [x y])

Adds a button to the dialog, either with the supplied text or a message resource.

Parameters:
  • theValue (number) – A numerical value associated with the button. This value will be returned by the dialog if the button is pressed.
  • text (string) – The button text.
  • x (number) – The button x offset from the upper left of the dialog.
  • y (number) – The button y offset from the upper left of the dialog.
  • noun (number) – The noun of the message to show.
  • verb (number) – The verb of the message to show.
  • cond (number) – The condition of the message to show.
  • seq (number) – The sequence of the message to show, or 0.
  • modNum (number) – Optional room number of the message to show (if not specified, the current room is used).
addColorButton(theValue noun verb cond seq [x y modNum normalForeColor highlightForeColor selectedForeColor normalBackColor highlightBackColor selectedBackColor])
addColorButton(theValue text [x y normalForeColor highlightForeColor selectedForeColor normalBackColor highlightBackColor selectedBackColor])

This is similar to addButton, but lets you specify up to 6 color indices for various parts and states of the button.

Parameters:
  • theValue (number) – A numerical value associated with the button. This value will be returned by the dialog if the button is pressed.
  • text (string) – The button text.
  • x (number) – The button x offset from the upper left of the dialog.
  • y (number) – The button y offset from the upper left of the dialog.
  • noun (number) – The noun of the message to show.
  • verb (number) – The verb of the message to show.
  • cond (number) – The condition of the message to show.
  • seq (number) – The sequence of the message to show, or 0.
  • modNum (number) – Optional room number of the message to show (if not specified, the current room is used).
addEdit(buffer maxLength [x y initialText])

Adds an edit control to the dialog.

Parameters:
  • buffer (string) – The buffer that will receive the text.
  • maxLength (number) – The length of the buffer.
  • x (number) – The edit control x offset from the upper left of the dialog.
  • y (number) – The edit control y offset from the upper left of the dialog.
  • initialText (string) – Text to initialize the edit control.
addIcon(view loop cel [x y])

Adds an icon to the dialog.

addText(noun verb cond seq [x y modNum])
addText(text [x y])

Adds text to the dialog, either with the supplied string or a message resource.

Parameters:
  • text (string) – The text.
  • x (number) – The text x offset from the upper left of the dialog.
  • y (number) – The text y offset from the upper left of the dialog.
  • noun (number) – The noun of the message to show.
  • verb (number) – The verb of the message to show.
  • cond (number) – The condition of the message to show.
  • seq (number) – The sequence of the message to show, or 0.
  • modNum (number) – Optional room number of the message to show (if not specified, the current room is used).
addTextF(params)

Adds formatted text to the dialog. There are no options for positioning or getting the text from a message resource.

addTitle(noun verb cond seq [modNum])
addTitle(text)

Adds a title to the dialog, either with the supplied string or a message resource.

Parameters:
  • text (string) – The title text.
  • noun (number) – The noun of the message to show.
  • verb (number) – The verb of the message to show.
  • cond (number) – The condition of the message to show.
  • seq (number) – The sequence of the message to show, or 0.
  • modNum (number) – Optional room number of the message to show (if not specified, the current room is used).
posn(theX theY)

Positions the dialog on screen.

handleEvent(pEvent)
cue()
Next Previous

© Copyright 2015, Phil Fortier.

Built with Sphinx using a theme provided by Read the Docs.