Dial_CenterPointOfRect | 
The function returns the center point of the input rectangle.
Syntax
Dial_CenterPointOfRect( switches ; rectangle  |  left ; top ; width ;
                        height )
Parameters
| switches | not used, reserved for future use. Leave blank or put "-Unused" | 
| rectangle | the rectangle you want to find the center coordinates of, formatted as a list: "left¶top¶width¶height" | 
| or: | |
| left | the left coordinate of the rectangle | 
| top | the top coordinate of the rectangle | 
| width | the width of the rectangle | 
| height | the height of the rectangle | 
Returned Result
Data type returned
Text
Result
Returns the x and y coordinates of the center point as a list of 2 values separated by a return character, for example:
  “42
   345”
Originated in
Troi Dialog Plug-in 12.0
Compatibility
FileMaker Pro 17 to FileMaker Pro 21 (2024)
Considerations
The input rectangle can be given formatted in 2 ways:
As a list parameter “left¶top¶width¶height”, for example:
  “42
   345
   1560
   720”
Alternatively you can supply four input parameters:  left ; top ; width ; height.
Example
Set Variable [ $Rectangle ;  "0¶0¶2560¶1440" ]
Set Variable [ $CenterPoint ; Dial_CenterPointOfRect( "-Unused" ; $Rectangle ) ]
This will return the center point, in this case “1280¶720”.
You can also supply four input parameters, left ; top ; width ; height, like this:
Set Variable [ $CenterPoint ; Dial_CenterPointOfRect( "-Unused" ; 0 ; 0 ; 2560 ; 1440) ]
This will also return the center point: “1280¶720”.
Used in example file
Position.fmp12
Related functions
| Dial_GetGlobalScreenPosition | 
| Dial_SetPosition | 
Related topics
Troi Dialog Plug-in online help (overview)