Just a few lines of code that add a bounding box. I've found it useful when designing some programs. Use the F4 key to show the box. The coords and size of the box are shown in the window title.
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
BoundingBoxState = 0
BoundingBoxColor = MakeColor(255,255,255)
BoundingBoxKey = 115
do
if GetRawKeyState(BoundingBoxKey)
if BoundingBoxState = 0
BoundingBoxState = 1
BBX1 = GetRawMouseX()
BBY1 = GetRawMouseY()
BBX2 = BBX1
BBY2 = BBY1
endif
if BoundingBoxState = 1
BBX2 = GetRawMouseX()
BBY2 = GetRawMouseY()
DrawBox(BBX1, BBY1, BBX2, BBY2, BoundingBoxColor, BoundingBoxColor, BoundingBoxColor, BoundingBoxColor, 0)
SetWindowTitle("X1:" + str(BBX1) + " Y1:" + str(BBY1) + " X2:" + str(BBX2) + " Y2:" + str(BBY2) + " W:" + str(BBX2 - BBX1) + " H:" + str(BBY2 - BBY1))
endif
else
BoundingBoxState = 0
endif
Print( ScreenFPS() )
Sync()
loop