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 / Sprite/Image Number

Author
Message
king koder
16
Years of Service
User Offline
Joined: 31st Dec 2007
Location:
Posted: 21st Apr 2008 12:23
Now that I can handle sprite transparency pretty well, I will need to know more about how to correctly display the correct images at the right time.

What is sprite number? What is image number?

I've looked at the lib...


Then I ended up making something like this:


I assumed that the image number is the total number of images in the animation, so I listed 4 in 'create animated sprite' (1 across, 4down). Now say I wanted to see image3 of that animation, so I placed 3 in 'sprite'.

It displays image1 of the animation. Can someone describe to me what these two augments are and how they are used?

Thanks in advance! ^^
king koder
16
Years of Service
User Offline
Joined: 31st Dec 2007
Location:
Posted: 21st Apr 2008 23:16
So the sprite number is the object ID used in the executable? Okay, great. That might raise a few questions later.

Is the image number the same thing? Is it an ID?

Seems pretty strange to me, creating an animated sprite requiring two IDs.
king koder
16
Years of Service
User Offline
Joined: 31st Dec 2007
Location:
Posted: 22nd Apr 2008 00:08
I've run into a problem, I think that both the sprite and image ID have to be set to different numbers so I tried this...



This is a simple simulation of two animated sprites playing next to each other. When I load them both into the exe simulatnously, one image is substantially larger then the other.

The animated sprite with sprite/image ID of 1, is about four times taller then it should be. The second animated sprite (with sprite/image ID of 2) is displayed the correct size.

I decided to turn the code around...



With this code, the animated sprite with sprite/image ID 1 now animates properly at it's correct size. However, the second one now is much larger, approxametly 12 times longer and four times taller then it should be. Are these codes linked in order?

Is this a glitch? Or am I supposed to create the new sprite animation every time I want to use it?
king koder
16
Years of Service
User Offline
Joined: 31st Dec 2007
Location:
Posted: 22nd Apr 2008 03:10 Edited at: 22nd Apr 2008 03:11
Okay, I've tried another simulation to confirm my previous question/glitch on DBPro. This time, I tried to load the same image under two different IDs. (1 and 2 respectively)



Again, this causes the second sprite to appear pretty normal, if not at its exact size. (I think when I make an exe, that the sprites are automatically doubled in dimensions, but thats just a guess) However, the first sprite, with sprite/image ID of 1, the image is massive.

I think that if I try to create two consecutive animated sprites, the most recently created one is displayed correctly, but the one created before will be scaled by the across.x, and down.y.

(For example, I think the first created animated sprite was 12 across, 4 down. So, that means the first sprite was 12x longer and 4x taller).

I can provide a demo describing exactly what I am going through if it helps find a solution. I'd like to know if I am doing something I shouldn't (or should).
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 22nd Apr 2008 13:26
Attach your spritesheet here.

Attachment:
king koder
16
Years of Service
User Offline
Joined: 31st Dec 2007
Location:
Posted: 22nd Apr 2008 19:51
Here you go! I don't know what to attach, so I attached everything(which isnt much).


You'll need to unzip the file.

I made the sprites so please don't use the sprites yourself... T.T

Attachments

Login to view attachments
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 22nd Apr 2008 20:05 Edited at: 22nd Apr 2008 20:34
I compiled it.
There is no problem.
I am ver.67.
king koder
16
Years of Service
User Offline
Joined: 31st Dec 2007
Location:
Posted: 22nd Apr 2008 20:10
That's strange, I bought and downloaded the DBPro like 2 days ago.

It's still hugely scaled for me.
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 22nd Apr 2008 20:19
king koder
16
Years of Service
User Offline
Joined: 31st Dec 2007
Location:
Posted: 22nd Apr 2008 20:31
Fantastic! It works now ^^

Thank you (x2) for the solution and link pcRaider and WindowsKiller! (and the mysterious googlebot)

Login to post a reply

Server time is: 2024-11-15 18:01:57
Your offset time is: 2024-11-15 18:01:57