(AGK version: 108.24)
Submitted: 2015-02-15 08:22:12
// set window properties
SetWindowTitle( "sprites U V" )
SetWindowSize( 1024, 768, 0 )

// set display properties
SetVirtualResolution( 1024, 768 )

_Blue   = MakeColor(0,0,175)
_Yellow = MakeColor(175,175,0)
_Green  = MakeColor(0,175,0)
_Red    = MakeCOlor(175,0,0)

Render()
DrawBox(0,0,255,63,_Blue, _Blue, _Blue, _Blue, 1) 
DrawBox(0,64,255,127,_Yellow, _Yellow, _Yellow, _Yellow, 1) 
DrawBox(0,128,255,191,_Green, _Green, _Green, _Green, 1)
DrawBox(0,192,255,255,_Red, _Red, _Red, _Red, 1) 

DrawBox(0 + 400,0,63 + 400,255,_Blue, _Blue, _Blue, _Blue, 1) 
DrawBox(63 + 400,0,127 + 400,255,_Yellow, _Yellow, _Yellow, _Yellow, 1) 
DrawBox(127 + 400,0,191 + 400,255,_Green, _Green, _Green, _Green, 1)
DrawBox(191 + 400,0,255 + 400,255,_Red, _Red, _Red, _Red, 1) 

Render()
Horizontal  = GetImage(0,0,256,256)
Vertical    = GetImage(0 + 400,0,256,256)
ClearScreen()

SetImageWrapU(Horizontal, 1) : SetImageWrapV(Horizontal, 1)
SetImageWrapU(Vertical, 1) : SetImageWrapV(Vertical, 1)

_Sprite(Horizontal, Horizontal, 0,450,256, 255,255,255,255)
_Sprite(Vertical, Vertical, 400,450,256, 255,255,255,255)

SetClearColor(75,75,75)

Text1 = CreateText("Original images") : SetTextSize(Text1, 16) : SetTextPosition(Text1, 255, 268)
Text2 = CreateText("Sprite V changes                        Sprite U changes") : SetTextSize(Text2, 16) : SetTextPosition(Text2, 0, 400)



WrapU# = 0
WrapV# = 0

do 		
	DrawBox(0,0,255,63,_Blue, _Blue, _Blue, _Blue, 1) 
	DrawBox(0,64,255,127,_Yellow, _Yellow, _Yellow, _Yellow, 1) 
	DrawBox(0,128,255,191,_Green, _Green, _Green, _Green, 1) 
	DrawBox(0,192,255,255,_Red, _Red, _Red, _Red, 1)
	
	DrawBox(0 + 400,0,63 + 400,255,_Blue, _Blue, _Blue, _Blue, 1) 
	DrawBox(63 + 400,0,127 + 400,255,_Yellow, _Yellow, _Yellow, _Yellow, 1) 
	DrawBox(127 + 400,0,191 + 400,255,_Green, _Green, _Green, _Green, 1)
	DrawBox(191 + 400,0,255 + 400,255,_Red, _Red, _Red, _Red, 1) 
	
	inc WrapU#, -0.007
	inc WrapV#, -0.007
	
	SetSpriteUVOffset(Horizontal, 0, WrapV#)
	SetSpriteUVOffset(Vertical, WrapU#, 0)
	
	Sync()
loop

function _Sprite(num, img, x#, y#, size#,  Cr, Cg, Cb, Ca)
	CreateSprite(num, img)
	SetSpritePosition(num, x#, y#)
	SetSpriteColor(num, Cr, Cg, Cb, Ca)
	setSpriteSize(num, size#, size#)
Endfunction
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.