< GeeXLab Reference Guide />
> Back to Reference Guide Index
gh_window library
Description
gh_window is the module that manages the current window.
Number of functions: 5
- gh_window.getsize ()
- gh_window.set_alpha ()
- gh_window.timer_get_milliseconds ()
- gh_window.timer_get_seconds ()
- gh_window.timer_reset ()
getsize
Description
Returns the size of the window.
Syntax
width, height = gh_window.getsize(
win_id
)
Languages
Parameters
- win_id [ID]: identifier of the window. 0 is the current window.
Return Values
- width, height [INTEGER]: size of the window
Code sample
width, height = gh_window.getsize(0)
set_alpha
Description
Sets the alpha value of the window (Windows only).
Syntax
gh_window.set_alpha(
win_id,
alpha
)
Languages
Parameters
- win_id [ID]: identifier of the window. 0 is the current window.
- alpha [REAL]: alpha value from 0.0 to 1.0
Return Values
This function has no return value(s).
Code sample
gh_window.set_alpha(0, 0.8)
timer_get_milliseconds
Description
Returns the number of milliseconds since the last reset.
Syntax
elapsed_time = gh_window.timer_get_milliseconds(
win_id
)
Languages
Parameters
- win_id [ID]: identifier of the window. 0 is the current window.
Return Values
- elapsed_time [REAL]: elapsed time in milliseconds
Code sample
elapsed_time = gh_window.timer_get_milliseconds(0)
timer_get_seconds
Description
Returns the number of seconds since the last reset.
Syntax
elapsed_time = gh_window.timer_get_seconds(
win_id
)
Languages
Parameters
- win_id [ID]: identifier of the window. 0 is the current window.
Return Values
- elapsed_time [REAL]: elapsed time in seconds
Code sample
elapsed_time = gh_window.timer_get_seconds(0)
timer_reset
Description
Resets the timer of the window.
Syntax
gh_window.timer_reset(
win_id
)
Languages
Parameters
- win_id [ID]: identifier of the window. 0 is the current window.
Return Values
This function has no return value(s).
Code sample
gh_window.timer_reset(0)
| |