Quote: "I noticed people talking about the across and down, Is that how many images are in a file? I saw a post saying how many images it was and not pixels. Does that mean DBpro knows when or how many images are in a file?"
Yes, it's by images but it can only determine how many images there are by the across and down numbers you tell it. What Darkbasic does is takes the horizontal size of the image and divides it by the number of images you say are across to determine how many pixels to grab for the horizontal to grab each image. It does the same for vertical (takes the vertical size and divides by the number of down images).
So with the attached image there are 14 across and 1 down. The horizontal size is 435... 435 / 14 = 31. The vertical size is 32... 32 / 1 = 32. So Darkbasic knows to grab 14x1=14 images at 31x32 pixels for the animated sprite. If your images are lined up properly it'll work perfectly.
Quote: "With this it leads to another question. Let's say i put a walk cycle of 5 different frames into one single file across. Would [Create Animated Sprite 1, "filename.bmp", 1, 5, X <<<<<] be correct? and what do i put for that X? Did i have to [Load Image] image first?"
No it would be "CREATE ANIMATED SPRITE 1,"filename.bmp",5,1,X" the 5 and 1 are switched because it's 5 across and 1 down. The X is the image number you want to use to save the whole animation. TGC made it simple for us and put everything we need for grabbing images for animation in one command instead of us having to grab the images ourselves with multiple lines of code using multiple small images.
Quote: "Does this make the image automatically move when i make my images set to certain keys or will it animate even if it stood in one place?"
No that requires another command called PLAY SPRITE which you tell which frame number to start on, which to end with, and how much of a delay you want. Without the code seeing PLAY SPRITE the image wouldn't animate and stay on a single frame.
Those commands really just makes it easier on us to make animated sprites... there is always the old way:
sync rate 0
sync on
hide mouse
load bitmap "MouseAnimation.bmp",1
x=0:y=0
for t=100 to 113
get image t,x,y,x+31,y+31,1
inc x,31
next t
set current bitmap 0
ma=100:tim=timer()
do
sprite 1,mousex(),mousey(),ma
if timer()>tim+100
inc ma
tim=timer()
endif
if ma=114 then ma=100
sync
loop
But the new way is so much easier, does exactly the same thing, and takes a lot less code:
sync rate 0
sync on
hide mouse
create animated sprite 1,"MouseAnimation.bmp",14,1,1
do
play sprite 1,1,14,100
sprite 1,mousex(),mousey(),1
sync
loop