Setting up animationimage

Blitz3D Forums/Blitz3D Beginners Area/Setting up animationimage

AJirenius(Posted 2006) [#1]
I have all these small *.png pictures that I would like to use as a whole animation for textures.

1. Am I right that the only way for me to animate them is to tile them up side by side on a big image?

2. Are there any good software out there that could automatically help me out with that as the animations are more than 50 frames big and I would save lots of time with such a software.


D4NM4N(Posted 2006) [#2]
Wouldnt be hard wo write your own

this is out of my head but should point you in the right place:

tilesize=50

created=createimage(tilesize*10,tilesize*10)

row =1 
column =1

repeat

  loaded=loadimage (could get filenames data file or simple 'data' statements)
  if loaded

     copyrect 0,0,tilesize,tilesize,tilesize*column,tilesize*row,imagebuffer(loaded),imagebuffer(created)

     column=column+1
     if column no=10 then column no=0:row=row+1
   endif
   freeimage loaded

until nomoreimages

savebuffer "out.bmp",imagebuffer(created)



AJirenius(Posted 2006) [#3]
Thanks, I guess ill have to do that :)


AJirenius(Posted 2006) [#4]
Ok, I tried this but it gives me an errormessage on the very last line (where it is supposed to save the image) saying: "IMAGE DOES NOT EXIST"

Can anyone tell me what I am doing wrong?



tilesize=128

created=CreateImage(tilesize*8,tilesize*4)

row =0 
column =0


; Generate the filename correctly.
For n = 0 To 3
	For m = 0 To 7
	If ((n*8)+(m)+2) < 10 Then
		Name$= "Explosion000"+Str((n*8)+(m)+2)+".bmp"
		Else
		Name$= "Explosion00"+Str((n*8)+(m)+2)+".bmp"
	EndIf
	
	Print Name$ ; Just to see if its generated correctly before loading. This works fine.
	
	loaded=LoadImage (Name$)
	
    CopyRect  0,0,tilesize,tilesize,tilesize*column,tilesize*row,ImageBuffer(loaded),ImageBuffer(created)

     column=column+1
     	If column =8 Then 
     		column =0
     		row=row+1
   		EndIf
   FreeImage loaded
	Next 
Next 


SaveBuffer ImageBuffer(created),"c:\out.bmp"




Matty(Posted 2006) [#5]
You need to include the 'graphics' command (not necessarily graphics3d just graphics 800,600,32,2 for example).

In blitzplus your code above works fine, in blitz3d you need to call the graphics command first.


AJirenius(Posted 2006) [#6]
:P

thank you so much!