Difference between revisions of "SCI Kernel Documentation/Window and Text Functions"
(Created page with "Official SCI Documentation<br /> <div align="center"> Chapter: 1 | 2 | SCI...") |
|||
(8 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
[[SCI Kernel Documentation/String Functions|6]] | | [[SCI Kernel Documentation/String Functions|6]] | | ||
[[SCI Kernel Documentation/Picture Functions|7]] | | [[SCI Kernel Documentation/Picture Functions|7]] | | ||
− | [[SCI Kernel Documentation/Save | + | [[SCI Kernel Documentation/Save-Restore Game Functions|8]] | |
[[SCI Kernel Documentation/Animation Functions|9]] | | [[SCI Kernel Documentation/Animation Functions|9]] | | ||
[[SCI Kernel Documentation/Graphic Screen Functions|10]] | | [[SCI Kernel Documentation/Graphic Screen Functions|10]] | | ||
Line 23: | Line 23: | ||
</div><br /> | </div><br /> | ||
− | <div align="center"><span style="font-size: 22pt"></span><br /> | + | <div align="center"><span style="font-size: 22pt">Window and Text Functions</span><br /> |
''Author: [[Jeff Stephenson]]''<br /> | ''Author: [[Jeff Stephenson]]''<br /> | ||
''Revision by: David Slayback''</div> | ''Revision by: David Slayback''</div> | ||
Line 29: | Line 29: | ||
| | ||
− | + | ==<br /> Window and Text Functions == | |
+ | |||
+ | These functions deal with the main picture window, dialog windows, and writing text to those windows. | ||
+ | |||
+ | ===<br /> (GetPort) === | ||
+ | |||
+ | <blockquote> | ||
+ | Returns the current grafPort. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (SetPort grafPort) === | ||
+ | |||
+ | <blockquote> | ||
+ | Sets the current grafPort to grafPort. If grafPort=0, then the port is set to the window manager port, which is the full screen picture with (0,0) right below the menu bar. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (NewWindow top left bottom right title type priority color back) === | ||
+ | |||
+ | <blockquote> | ||
+ | Opens a window with the given coordinates, and returns a handle to the new window. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (DisposeWindow window) === | ||
+ | |||
+ | <blockquote> | ||
+ | Close the given window. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (Display text [at: x y] [font: f] [color: c] [back: b] [style: s] [width: w]) === | ||
+ | |||
+ | <blockquote> | ||
+ | Writes text to the current grafPort. The optional parameters are: | ||
+ | |||
+ | <blockquote> | ||
+ | {| valign="top" | ||
+ | |p_at: x y||Position the upper left corner of the first character of text at coordinates x, y in the grafPort. | ||
+ | |- valign="top" | ||
+ | |p_font: f||Write the text in font f. | ||
+ | |- valign="top" | ||
+ | |p_color: c||Set the foreground color of the characters to c. The characters will be ORed into the picture unless "back:" (see below) is specified. | ||
+ | |- | ||
+ | |p_back: b||Set the background color of the characters to b. Additionally makes the characters OPAQUE. | ||
+ | |- valign="top" | ||
+ | |p_style: s||Set the style of the characters to s. s may be TPLAIN (plain text), TDIMMED (dimmed text) or TBOLD (bold text). | ||
+ | |- valign="top" | ||
+ | |p_width: w||Sets the width of the displayed line. The text will wrap at the width that you specify. If this parameter is not passed, the text will NOT wrap, and long lines will go off the edge of the screen. | ||
+ | |- valign="top" | ||
+ | |p_mode: j||Set justification of text. Left aligned is default. (teJustLeft, teJustCenter, or teJustRight) | ||
+ | |- valign="top" | ||
+ | |p_save:||Saves the background under the window and returns a value that relates to the saved area. Use (= var (Display "Lots o text" save:) | ||
+ | |- valign="top" | ||
+ | |width= "100"|p_restore: var||Restores the background that was saved. Use (Display "" p_restore: var) | ||
+ | |} | ||
+ | </blockquote> | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (TextSize rectPtr text font width) === | ||
+ | |||
+ | <blockquote> | ||
+ | Fills in the rectangle (an array of four elements) which is pointed to by rectPtr with the bounding coordinates of the box which will hold text printed in the font font. If width is non-zero, it is the maximum width of the rectangle. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (DrawControl item) === | ||
+ | |||
+ | <blockquote> | ||
+ | Draw a control object within the given port item can be dSelector, dButton, dText, dIcon, or dEdit | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (HiLiteControl item) === | ||
+ | |||
+ | <blockquote> | ||
+ | Hilight the control item if not selected, or unhilight the item if selected. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (EditControl item event) === | ||
+ | |||
+ | <blockquote> | ||
+ | Bring up an edit box for a the item object that has type=dEdit, and store the message passed through to event. | ||
+ | </blockquote> | ||
| | ||
Line 42: | Line 120: | ||
| | ||
− | <span style="float: left">[[SCI Kernel Documentation/|< Previous: ]]</span><span style="float: right">[[SCI Kernel Documentation/|Next: | + | <span style="float: left">[[SCI Kernel Documentation/Menu Functions|< Previous: Menu Functions]]</span> |
+ | <span style="float: right">[[SCI Kernel Documentation/Sound Functions|Next: Sound Functions >]]</span> | ||
| | ||
[[Category:SCI Documentation]] | [[Category:SCI Documentation]] | ||
− | |||
[[Category:Kernel Functions]] | [[Category:Kernel Functions]] | ||
+ | [[Category:Window]] | ||
+ | [[Category:Text Resources]] | ||
+ | [[Category:Text Functions]] |
Latest revision as of 14:11, 3 December 2015
Window and Text Functions
These functions deal with the main picture window, dialog windows, and writing text to those windows.
(GetPort)
Returns the current grafPort.
(SetPort grafPort)
Sets the current grafPort to grafPort. If grafPort=0, then the port is set to the window manager port, which is the full screen picture with (0,0) right below the menu bar.
(NewWindow top left bottom right title type priority color back)
Opens a window with the given coordinates, and returns a handle to the new window.
(DisposeWindow window)
Close the given window.
(Display text [at: x y] [font: f] [color: c] [back: b] [style: s] [width: w])
Writes text to the current grafPort. The optional parameters are:
p_at: x y Position the upper left corner of the first character of text at coordinates x, y in the grafPort. p_font: f Write the text in font f. p_color: c Set the foreground color of the characters to c. The characters will be ORed into the picture unless "back:" (see below) is specified. p_back: b Set the background color of the characters to b. Additionally makes the characters OPAQUE. p_style: s Set the style of the characters to s. s may be TPLAIN (plain text), TDIMMED (dimmed text) or TBOLD (bold text). p_width: w Sets the width of the displayed line. The text will wrap at the width that you specify. If this parameter is not passed, the text will NOT wrap, and long lines will go off the edge of the screen. p_mode: j Set justification of text. Left aligned is default. (teJustLeft, teJustCenter, or teJustRight) p_save: Saves the background under the window and returns a value that relates to the saved area. Use (= var (Display "Lots o text" save:) p_restore: var Restores the background that was saved. Use (Display "" p_restore: var)
(TextSize rectPtr text font width)
Fills in the rectangle (an array of four elements) which is pointed to by rectPtr with the bounding coordinates of the box which will hold text printed in the font font. If width is non-zero, it is the maximum width of the rectangle.
(DrawControl item)
Draw a control object within the given port item can be dSelector, dButton, dText, dIcon, or dEdit
(HiLiteControl item)
Hilight the control item if not selected, or unhilight the item if selected.
(EditControl item event)
Bring up an edit box for a the item object that has type=dEdit, and store the message passed through to event.
- Notes
< Previous: Menu Functions Next: Sound Functions >