setDrawTarget()
Purpose
Sets the target of draw commands
Description
Sets the target of draw commands to be an image or the framebuffer
Syntax
setDrawTarget( target )
Arguments
target handle of an image created with createimage or framebuffer for the screen
Example
w = 200
// Create a tile
img = createImage( w, w, true, image_rgb )
setDrawTarget( img )
box( 0, 0, w, w, red, 0 )
box( 0, w/2, w - 1, w / 2, white, 1 )
line( { w / 2 }, { w / 2, w / 2 }, white )
// draw tiles on the screen
setDrawTarget( frameBuffer )
for y = 1 to gHeight() step w loop
for x = 1 to gWidth() step w loop
drawImage( img, x, y, 1 )
update()
sleep( 0.2 )
repeat
repeat
sleep( 3 )
Associated Commands
clear(), gHeight(), gWidth(), getDrawTarget(), setMode(), update()