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.

Newcomers DBPro Corner / Create Aniimated Sprite

Author
Message
tonycrew
14
Years of Service
User Offline
Joined: 8th Jan 2010
Location:
Posted: 23rd Mar 2010 02:49
If the Create Animated Sprite Command is
Quote: "CREATE ANIMATED SPRITE Sprite Number, Filename, Across, Down, Image Number
"

Then why does it give an error for
Quote: "create animated sprite 1,"Ogre_Attack.png",1,128,128,1
"

parameter for 'Create Animated Sprite' does not match sprite number, filename,down,across, image number..?

But
Quote: "create animated sprite 1,"Ogre_Attack.png",1,4,1"


Works but wont show the full 128x128 image

FPS Creator Updated 116,Vista 32Bit UpTo Date, nVidea 8500 1Gig Graphics Card, 4 Gig DDR2 Ram, Intel Duel Core 3GHZ CPU
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 23rd Mar 2010 03:30
I have attached a little demo I made which shows the proper use of create animated sprite and sprite sheets.

Hope it helps.

My apologies to the dbp community concerning, my choice of sprites.

Attachments

Login to view attachments
jfroco
14
Years of Service
User Offline
Joined: 1st Dec 2009
Location: Chile
Posted: 23rd Mar 2010 06:17
Hello,

Quote: "Then why does it give an error for
Quote: "create animated sprite 1,"Ogre_Attack.png",1,128,128,1
"
parameter for 'Create Animated Sprite' does not match sprite number, filename,down,across, image number..?"


Because the number of parameters is not correct. You are giving 6 parameters to the "create animated sprite" command but it only needs 5:

Sprite Number=1
Filename="Ogre attack.png"
Across=1
Down=128
Image Number=128
?????=1

Quote: "But
Quote: "create animated sprite 1,"Ogre_Attack.png",1,4,1"

Works but wont show the full 128x128 image
"


Again:
Sprite Number=1
Filename="Ogre attack.png"
Across=1
Down=4
Image Number=1

This should work with if image 1 is composed by 4 images vertically. Why are you expecting the full 128x128 image?

Best regards

JF
tonycrew
14
Years of Service
User Offline
Joined: 8th Jan 2010
Location:
Posted: 23rd Mar 2010 10:58
Ah i see i thought "create animated sprite 1,"Ogre_Attack.png",1,4,1"
was creating sprite 1 using frames 1-4 sprite 1

in the example code that comes in the HTML help of dbpro it says

CREATE ANIMATED SPRITE Sprite Number, Filename, Across, Down, Image Number


Quote: "create animated sprite 1,"manwalking.bmp",1,16,16,1
cls
sprite 1,100,100,1
play sprite 1,0,10,100
print "sprite frame ",sprite frame(1)
do
loop
end

"


FPS Creator Updated 116,Vista 32Bit UpTo Date, nVidea 8500 1Gig Graphics Card, 4 Gig DDR2 Ram, Intel Duel Core 3GHZ CPU
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 26th Mar 2010 22:14
Yes, the help for CREATE ANIMATED SPRITE is wrong and the example code is wrong as well, since you can't play frame zero. Perhaps one day the help files will be put right.

luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 30th Mar 2010 13:10
@Rich Dersheimer
If i remember well in previous versions of the editor the 0 frame was the start frame.And the example was working back then.Help files and examples need to be updated from time to time.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 3rd Apr 2010 17:43 Edited at: 3rd Apr 2010 17:45
@luskos - I wasn't aware that it ever worked that way. But the example has more problems than just starting from frame zero. I think, instead of updating help and examples from time to time, they should be updated when the commands are changed. But that's just my opinion, I could be wrong.

Login to post a reply

Server time is: 2024-11-24 18:29:50
Your offset time is: 2024-11-24 18:29:50