Heres an example that updates a sprite image
SetWindowTitle( "Progress Bar" )
SetWindowSize( 1024, 768 , 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 0, 0, 1, 1 ) // allow only landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
radialTextureID=CreateProgressRadial()
radialTextureID2=CreateProgressRadial()
CreateSprite(1,radialTextureID)
CreateSprite(2,radialTextureID2)
SetSpritePosition(1,0,0)
SetSpritePosition(2,0,0)
SetSpriteVisible(1,0)
angle#=0
repeat
angle#=angle#+1
if angle#<=360
SetSpriteAngle(1,angle#)
//SetSpriteColor(1,random(1,255),random(1,255),random(1,255),255)
tempImg=progressRadial()
DeleteImage(radialTextureID2)
CopyImage(radialTextureID2,tempImg,0,0,255,255)
SetSpriteimage(2,radialTextureID2)
else
Print ("you have progressed")
endif
sync()
until GetRawKeyPressed(27)
function createProgressRadial()
SetClearColor(0,0,0)
ClearScreen()
DrawLine( 126, 0, 126,126,255,255,255 )
DrawLine( 125, 0, 125,126,255,255,255 )
DrawLine( 127, 0, 127,126,255,255,255 )
Render()
img = getimage(0,0,255,255)
SetImageTransparentColor( img,0,0,0 )
Swap()
endfunction img
function progressRadial()
SetSpriteVisible(1,1)
SetClearColor(0,0,0)
ClearScreen()
drawSprite(1)
drawSprite(2)
Render()
img = getimage(0,0,255,255)
SetImageTransparentColor( img,0,0,0 )
Swap()
SetSpriteVisible(1,0)
endfunction img
there is also another way with rendering to an image (there may need to be render calls etc added)
CreateRenderImage ( width, height, format, mipmap )
SetRenderToImage ( colorImage, depthImage )
DrawSprite()
SetRenderToScreen ()
The first method is a great method for most uses but when a full screen sized rendering is required the second method might be better.
Also the first method you have to redraw everything before the grab, the second method you render it to your image on screen a liitle
trickier to use but it may be what you want to do, there is some good examples in the help files
fubar