getScreenHeight

getScreenHeight()

Returns the height of the screen, in pixels.

This height is a fixed height. If the player is resized, then the contents is automatically scaled, and so this height is unaffected.

// An advanced example, which uses getScreenHeight.
// It draws gradients across and down the screen.
onEachFrame() do
    fill( :white )
    
    width  = getScreenWidth()
    height = getScreenHeight()
    
    setColor( :blue, 1 )
    width.times() do |x|
        setAlpha( x / width )
        drawLine( x, 0, x, height )
    end
    
    setColor( :green, 1 )
    height.times() do |y|
        setAlpha( y / height )
        drawLine( 0, y, width, y )
    end
end