Home THE HYPERCARD CENTER

HyperTalk Reference
Home » HyperTalk Reference » Functions

Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.

screenRect

the screenRect
Value returned: a rectangle equal to the dimensions of the screen in pixels

If there's more than one monitor, the screenRect returns the dimensions of the monitor displaying the current stack as offsets from the top-left corner of the screen that contains the menu bar.

If the card window appears on more than one monitor, the screenRect returns the dimensions of the screen that shows the most area from the card window.


Examples

get the screenRect
if the mouseLoc is not within it then ...

if the screenRect = "0,0,512,342" then ... -- SE size monitor

Demo Script

on screenRectDemo
   get the screenRect
   put "The dimensions of the monitor displaying this stack are:" &¬
   return & return & "Width:" && (item 3 of it - item 1 of it) &¬
   return & "Height:" && (item 4 of it - item 2 of it) into sayIt
   answer sayIt
 end screenRectDemo

Placeholders

rectangle
An expression that evaluates to a rectangle, in the form of four integers separated by commas (and, in AppleScript, enclosed in brackets).

Items 1 and 2 of a rectangle specify the left and top coordinates; items 3 and 4 specify the right and bottom coordinates (in pixels). For example:

0,0,200,250
the rect of card window
"30,30," & "240,240"
{ 10, 35, 250, 300 } --AppleScript form


Related Topics

« round | HyperTalk Reference | seconds »


Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Modern View

Home
The HyperCard Center
HyperTalk Reference
Home » HyperTalk Reference » Functions

Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.

screenRect

the screenRect
Value returned: a rectangle equal to the dimensions of the screen in pixels

If there's more than one monitor, the screenRect returns the dimensions of the monitor displaying the current stack as offsets from the top-left corner of the screen that contains the menu bar.

If the card window appears on more than one monitor, the screenRect returns the dimensions of the screen that shows the most area from the card window.


Examples

get the screenRect
if the mouseLoc is not within it then ...

if the screenRect = "0,0,512,342" then ... -- SE size monitor

Demo Script

on screenRectDemo
   get the screenRect
   put "The dimensions of the monitor displaying this stack are:" &¬
   return & return & "Width:" && (item 3 of it - item 1 of it) &¬
   return & "Height:" && (item 4 of it - item 2 of it) into sayIt
   answer sayIt
 end screenRectDemo

Placeholders

rectangle
An expression that evaluates to a rectangle, in the form of four integers separated by commas (and, in AppleScript, enclosed in brackets).

Items 1 and 2 of a rectangle specify the left and top coordinates; items 3 and 4 specify the right and bottom coordinates (in pixels). For example:

0,0,200,250
the rect of card window
"30,30," & "240,240"
{ 10, 35, 250, 300 } --AppleScript form


Related Topics

« round | HyperTalk Reference | seconds »

Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Retro View