(AGK version: 108.15)
Submitted: 2013-07-11 14:48:31
Setvirtualresolution(640,480)
ResetTimer()
//Create an example image
id=_CreateImage(55,0,255,0)
//Create and display a Backdrop
Swap()
For x=0 to 1024 Step 10
    DrawLine(0,0,x,600,Random(0,255),Random(0,255),Random(0,255))
    Update(0)
    Render()
Next x
GetImage(1,0,0,640,480)
//Create background sprite
CreateSprite(1,1)
//Create test sprite
CreateSprite(2,id)

FixSpriteToScreen(2,1)
//FixSpriteToScreen(2,0)

//Move the screen viewport to see the effect on the Sprite
Repeat
    For s=1 to 10 step 2
        SetViewOffset(0,s)
        Sleep(500)
        Sync()
    Next s
    Sync()
Until Timer()>16
End

Function _CreateImage(size,r,g,b)
    swap()
    Drawline(0,0,size,size,r,g,b)
    Update(0)
    Render()
    Drawline(0,size,size,0,r,g,b)
    Update(0)
    Render()
    giid=GetImage(0,0,size,size)
EndFunction giid
(AGK version: 108.15)
Submitted: 2013-07-11 15:19:42
Setvirtualresolution(640,480)
ResetTimer()

//Create and display a Backdrop
Swap()
For x=0 to 1024 Step 10
    DrawLine(0,0,x,600,Random(0,255),Random(0,255),Random(0,255))
    Update(0)
    Render()
Next x
GetImage(1,0,0,640,480)
//Create background sprite
CreateSprite(1,1)
//Create test sprite cube
CreateSprite(2,0)
SetSpriteColor(2,0,255,0,255)
SetSpriteSize(2,25,25)

FixSpriteToScreen(2,0)
//FixSpriteToScreen(2,0)

//Move the screen viewport to see the effect on the Sprite
Repeat
    For s=1 to 10 step 2
        SetViewOffset(0,s)
        Sleep(500)
        Sync()
    Next s
    Sync()
Until Timer()>16
End
Help make AGK better by submitting an example for this command!
(All examples are subject to approval)
Login to post an example of your own.