I want to draw concentric blue rectangles with a delay between drawing each one and not have the screen erase after drawing each one,
so that all the blue rectangles will eventually be on the screen at the end before the screen is erased.
// Project: Test Project-1
// Created: 2016-07-06
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "Test Project-1" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
LineColorRed=0
LineColorGreen=0
LineColorBlue=255
do
sw=1024
sh=768
for i=2 to 300 step 15
x1=i
y1=i
x2=sw-i
y2=sh-i
DrawLine( x1, y1, x2, y1, LineColorRed, LineColorGreen, LineColorBlue)
DrawLine( x2, y1, x2, y2, LineColorRed, LineColorGreen, LineColorBlue)
DrawLine( x2, y2, x1, y2, LineColorRed, LineColorGreen, LineColorBlue)
DrawLine( x1, y2, x1, y1, LineColorRed, LineColorGreen, LineColorBlue)
sleep(50)
sync()
next i
Print( "All Done")
Sync()
Sleep(500)
ClearScreen()
loop
Windows 8.1
On my system, only one rectangle is drawn, then the screen is erased before the next rectangle is drawn.
Why is the screen being erased?
Does Sync() erase the screen? The Docs don't say this.
What if I want to show things drawing in a sequence on the screen and it keeps erasing the screen?
Thanks for your help in this matter.