I would personally use the DrawBox command. Attached is a day / night cycle system I just wrote for you as an example. It is just the sky colour for now, it draws a gradient onto an image that is used on a sprite. It would be pretty easy to add stars and clouds in front of this image for a basic sky. All of the colours and speed the day cycles can be adjusted in the init_sky subroutine. Might use it myself some time...
// Project: Sky
// Created: 2014-11-20
// set window properties
SetWindowTitle( "Sky" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetPrintSize(16)
// initialise sky
gosub init_sky
// test how fast it is
SetSyncRate(10000, 0)
do
Print( str(ScreenFPS(), 0) )
Print("Time factor: " + str(sky.time))
UpdateSky()
Sync()
loop
type skyType
spr as integer
image as integer
time as float
timeFactor as float
topColor as integer
botColor as integer
rt1 as float
gt1 as float
bt1 as float
rt2 as float
gt2 as float
bt2 as float
rb1 as float
gb1 as float
bb1 as float
rb2 as float
gb2 as float
bb2 as float
endtype
init_sky:
global sky as skyType
sky.time = 0.5
sky.timeFactor = 0.05
sky.image = GetImage(0, 0, 1, 4)
sky.spr = CreateSprite(sky.image)
SetSpriteSize(sky.spr, GetDeviceWidth(), GetDeviceHeight())
FixSpriteToScreen(sky.spr, 1)
SetSpriteDepth(sky.spr, 9999)
sky.rt1 = 0
sky.gt1 = 175
sky.bt1 = 255
sky.rt2 = 50
sky.gt2 = 35
sky.bt2 = 80
sky.rb1 = 200
sky.gb1 = 240
sky.bb1 = 255
sky.rb2 = 75
sky.gb2 = 50
sky.bb2 = 120
return
function UpdateSky()
SetRenderToImage(sky.image, 0)
sky.time = sky.time + sky.timeFactor * GetFrameTime()
while sky.time>1.0
sky.time = sky.time - 1.0
endwhile
t# = abs(sky.time - 0.5)/0.5
sky.topColor = MakeColor(interpolate(sky.rt1, sky.rt2, t#), interpolate(sky.gt1, sky.gt2, t#), interpolate(sky.bt1, sky.bt2, t#))
sky.botColor = MakeColor(interpolate(sky.rb1, sky.rb2, t#), interpolate(sky.gb1, sky.gb2, t#), interpolate(sky.bb1, sky.bb2, t#))
DrawBox(0, 0, GetDeviceWidth(), GetDeviceHeight(), sky.topColor, sky.topColor, sky.botColor, sky.botColor, 1)
SetRenderToScreen()
endfunction
function interpolate(v1#, v2#, f#)
v# = v1# + (v2# - v1#)*f#
endfunction v#
EDIT: For clarity it's only rendering to a 1x4 image which is enough for a nice gradient and super quick
If you want to manually adjust the time set sky.timeFactor to zero and edit sky.time 0.0 is night, 0.5 is midday and 1.0 is night again.