Function fltk::app::screen_size

source ยท
pub fn screen_size() -> (f64, f64)
Expand description

Returns a pair of the width and height of the screen

Examples found in repository?
examples/editor.rs (line 84)
82
83
84
85
86
87
pub fn center() -> (i32, i32) {
    (
        (app::screen_size().0 / 2.0) as i32,
        (app::screen_size().1 / 2.0) as i32,
    )
}
More examples
Hide additional examples
examples/editor2.rs (line 32)
30
31
32
33
34
35
pub fn center() -> (i32, i32) {
    (
        (app::screen_size().0 / 2.0) as i32,
        (app::screen_size().1 / 2.0) as i32,
    )
}