Sunday, September 20, 2015

Monkey-X - Beginners - DeviceWidth and DeviceHeight - Example


DeviceWidth() and DeviceHeight hold the width and the height of your screen.

Import mojo

Class MyGame Extends App
    Method OnRender()
        Cls 0,0,0 
        SetColor 255,255,255        
        DrawText "Monkey-X Beginner Example",10,10
        DrawText "DeviceWidth and DeviceHeight...",10,20
        DrawText "DeviceWidth() = "+DeviceWidth(),100,100
        DrawText "DeviceHeight() = "+DeviceHeight(),100,200        
    End Method
End Class

Function Main()
    New MyGame()
End Function

No comments:

Post a Comment