Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Create Animated Sprite???

Author
Message
Shady Simpson
23
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 16th May 2003 23:12
Hi all,

I'm trying to figure out how the create animated sprite and play sprite commands work.

Could someone post a simple example bit of code of how to make a repetitive animation.

I've got all the media, just need to know how it works

Thanx.
ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 17th May 2003 14:39
There may be a small bug in the actual animated sprite command with patch 4, but is fixable for now... But will probably be fixed in the future which might hurt your code...

You take a large image say 300X300 pixels.
This image contains several smaller images 100X100
3 across and 3 down...

123
456
789


create animated sprite 4,"barholder.bmp",3,3,4
"Sprite number, filename, across, down, image number"
the accross and down numbers split the main image into 3x3 parts equally... So Image 1 is 0,0 to 100,100 and image 2 is 100,0 to 200,100 and image 3 is 200,0 to 300,100 etc


This command creates the sprite number and image number, so you do not need to set these first.

If you are using more than one animated sprite, you need to set their default sizes... Presumably the size you created them in the first place. Otherwise DBpro will resize them for you.

The Bug as per say, would take your frame number 1 and make it number 2 and the sprite 9 would make it 10. So you would need to create a 3x4 grid and access "frames" 2-10
ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 17th May 2003 14:42
should read

create animated sprite 4,"barholder.bmp",3,3,4
"Sprite number, filename, across, down, image number"
the accross and down numbers split the main image into 3x3 parts equally... So frame 1 is 0,0 to 100,100 and frame 2 is 100,0 to 200,100 and frame 3 is 200,0 to 300,100 etc
ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 17th May 2003 14:47
I would use a program such as flash and create an animation and export them as bitmaps...
Then make a program from DBpro import each bitmap and export them all as one large bitmap.

This is the easiest way to get them to sit properly in the large image and have a lot of smaller images in it.

You would need the save_bitmap.dll
ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 17th May 2003 14:53
see source above...

This would be a .bmp file below.

Shady Simpson
23
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 18th May 2003 11:42
Thanx for the replies ice, btw do you know where I can get my hands on a free 2D Animator

Thanx.

ICERGB
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 18th May 2003 17:58
You could use a skinning animation technique with almost any graphic program.

find a good default size and keep saving them after you have changed them around a bit. add numbers to the name you saved it under
name01.bmp
name02.bmp
name03.bmp

but no free animators I can think of...

Login to post a reply

Server time is: 2026-07-11 12:39:21
Your offset time is: 2026-07-11 12:39:21