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 / Drawing Animated Sprites the Easy Way

Author
Message
ashino
15
Years of Service
User Offline
Joined: 12th Nov 2010
Location:
Posted: 28th Mar 2011 17:49
Hello,

I wanted to know how does the following command work:
create animated sprite 1, "ogreattack.bmp", 13, 8, 5

it suppose to make it easy to animate the sprites but
when i run the code i get an error "LOAD IMAGE ogreattack.bmp,1,5"
so what do the numbers "13, 8, 5" and "1,5" stands for???

please help,
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 28th Mar 2011 18:05
In "CREATE ANIMATED SPRITE 1,"ogreattack.bmp",13,8,5".

1 = The sprite number you want to create
13 = The number of frames across
8 = The number of frames down
5 = The image number you want that sprite to use

It's made for sprite sheets where there are multiple images on one image arranged right next to each other so it's easy to grab each frame properly.



The above code snip uses CREATE ANIMATED SPRITE but because there are less frames in the image (attached) the numbers are a bit different. The image has only 10 frames across and 1 frame down.

What's probably happening is that image (ogreattack.bmp) needs to be in the same directory as your code for it to be able to load the file.

ashino
15
Years of Service
User Offline
Joined: 12th Nov 2010
Location:
Posted: 28th Mar 2011 18:40
Thanks for the information they really helped, and you were right i put the sprite sheet in the wrong folder
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 30th Mar 2011 07:15
This is in the help file if you looked

The Internet: Where men are men, women are men, and children are federal agents
ashino
15
Years of Service
User Offline
Joined: 12th Nov 2010
Location:
Posted: 2nd Apr 2011 17:42
So where i can find this help file? i really need it
ashino
15
Years of Service
User Offline
Joined: 12th Nov 2010
Location:
Posted: 2nd Apr 2011 17:46
LOL never mind i found them
Zubby1970
AGK Backer
18
Years of Service
User Offline
Joined: 22nd May 2008
Playing: AGK Studio Always
Posted: 26th Apr 2011 22:36
it is in the help file yes but its also a little obscure to what down and accross actually mean i read it as the size of the image, in pixels, so thanks for the little extra help here.

There can only be one
Hodgey
16
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 27th Apr 2011 13:54
I'd just like to point out that the error when loading your image could be due to the lack of quotes around the file name.

It should be LOAD IMAGE "ogreattack.bmp",1,5 instead of LOAD IMAGE ogreattack.bmp,1,5

A clever person solves a problem, a wise person avoids it - Albert Einstein
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 27th Apr 2011 18:47
@ Hodgey:

This was an old thread... he found the solution back in March 28... 31 days ago.


@ Zubby1970:

I just looked and you're right. It actually does sound like it's the size of the whole image. It's also a bit off because under Down it says the image number used to store the image not what it really is (they skipped talking about FILENAME so it's all off).

Login to post a reply

Server time is: 2026-07-11 12:20:46
Your offset time is: 2026-07-11 12:20:46