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 Animated Sprite

Author
Message
StevetS
20
Years of Service
User Offline
Joined: 19th May 2004
Location:
Posted: 14th Sep 2005 22:51
Hi,

At the risk of being uber flamed! I've been searching the forums and can't find a solution to my sprite problem.

I'm trying to create an animated sprite using a bitmap which is 35 pixels wide x 15 pixels high (to make a 3 stage sprite of 35 wide by 5 high) and display it animating on the screen.

My code is....



The code displays a sliver of the image on the screen (not the whole sprite) and doesn't animate it.

I've also been through the manual for the command and checked the Jessticular help but neither are particularly clear.

The create animate sprite command has 5 variables:

Sprite No - the animated sprite I'm creating
Filename - filename of the image I'm pulling the 3 sprites from
Across - the width of each sprite in the image (35 for my example)
down - the depth of each sprite in the image (5x3 for my example)
image number - is this the image to which the 'sprlink.bmp' file is saved in memory?

Any help as to what I'm doing wrong would be appreciated.

Attachments

Login to view attachments
StevetS
20
Years of Service
User Offline
Joined: 19th May 2004
Location:
Posted: 14th Sep 2005 23:51
Oki, found a solution in a code snippet (after 3 hours total searching time getting nowhere!).

Thank you 'How Do'! (3rd June 2005)

In case anyone's wondering, the Create Animated Sprite command isn't too clear in what is 'across' and what is 'down' (either that or I missed it explained somewhere else).

Anyways, across and down refer to images (e.g 2 images wide by 3 images down) and not as pixels as I thought. The command must subdivide the image rather than the user specifying the size. (could cause problem with odd sized images?)

So my Create Animated Sprite command above should have read...


...as my sprlink file is 1 image wide by 3 images tall.

Login to post a reply

Server time is: 2024-11-27 18:32:28
Your offset time is: 2024-11-27 18:32:28