Quote: "Is it possible to assign a sprite as a texture to an object?"
No, but it is possible to animate a texture directly.
The simplest and slowest way is to have your images loaded separately, and to retexture the object whenever you want your animation updated.
The better way is to use all your animations to make a single texture strip and to scale and scroll the texture of the plain.
I don't have the GDK installed right now, so you'll have to make do with DBPro code:
sync on
sync rate 20
` Generate a simple set of animated images
for i = 0 to 7
cls
line 0, 0, 16, i*2
get image i+1, 0, 0, 16, 16, 1
next
for i = 0 to 7
cls
line 0, 0, 16 - (i * 2), 16
get image i+9, 0, 0, 16, 16, 1
next
` Make them into a single strip
for i = 0 to 15
paste image i+1, i*16, 0
next
get image 1, 0, 0, 16*16, 16, 1
make object plain 1, 1.0, 1.0
scale object texture 1, 1.0 / 16.0, 1.0
texture object 1, 1
set object filter 1, 0
Pos = 0
do
inc Pos
if Pos > 15
scroll object texture 1, -1.0, 0.0
Pos = 0
endif
scroll object texture 1, 1.0 / 16.0, 0.0
sync
loop
I'm afraid that it's a little blocky because I've switched off filtering for the object - if you enable filtering again, make sure that you include a transparent gap between the individual images and rescale to avoid bleeding of the textures between images.