GetViewportSize
The GetViewportSize function returns the width and height of the interior of the main Mira window.
w, h = GetViewportSize()
w and h are the width and height of the Mira window, measured in screen pixels.
The script below shows how to create a text output window having a specified width and height. The CreateTextWindowfunction accepts relative dimensions rather than absolute ones. For example, it takes a Window rectangle like (0.1, 0.7, 0.1, 0.6) relative to the size of the main Mira window. To create a Text Editor window that is 600 pixels wide x 400 pixels tall, anchored at the upper left corner, we would do the following:
|
-- make a function to do this |
|
-- maximum width and height |
|
-- create a CRect object |
|
-- scale to the viewport |
|
-- format the string |
|
-- no longer needed. |
|
-- return the window reference |
|
|
|
|
|
-- is returned the window pointer T |
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.