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.

2D All the way! / Sprites & placement

Author
Message
EightYearRecoil
21
Years of Service
User Offline
Joined: 7th Apr 2003
Location: United States
Posted: 11th Apr 2003 11:46
I was wondering if anyone could tell me a way to draw a sprite on top of another one. I have a sprite 1, that i would like to have in front of a sprite 1000. But sprite 1000 is always on top. I tried a draw to front, and drawing sprite 1 after sprite 100, but it doesn't work. Any help would be greatly appreciated. Thanks.

Eight Year Recoil
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 11th Apr 2003 13:29
okay if you want sprite 1 to appear on top of sprite 1000 do:

set sprite priority 1000,1
set sprite priority 1,2
EightYearRecoil
21
Years of Service
User Offline
Joined: 7th Apr 2003
Location: United States
Posted: 11th Apr 2003 17:57
I'm sorry, I forgot to mention that I have DB Classic, not Pro. I don't think Classic has that command (I just tried it and it didn't work.

Eight Year Recoil

DangYankee
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location: United States
Posted: 11th Apr 2003 22:28 Edited at: 11th Apr 2003 22:32
You probally want to see both sprites but if it didn't matter:
You could trick it by hiding one of the sprites:
hide sprite 1 or hide sprite 1000
and then if you move the other do a:
show sprite 1 or 1000

but I just thought of something it might have to do with the creation order try swapping the order of the objects so sprite 1000 is created first.
After that I got nothing....
But Iam just learning this DB and DBP too so maybe someone else has the answer hopfully.

It's not the size of your code but how efficiently you use it!
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Apr 2003 01:27
DB Classic displays sprites in a fixed order based on the sprite number, and there's no way to *directly* control the display sequence.

If you go here (http://underwaredesign.com/products.php) you'll find the DSprite library that will give you what you want.
EightYearRecoil
21
Years of Service
User Offline
Joined: 7th Apr 2003
Location: United States
Posted: 12th Apr 2003 04:18
That seems to be exactly what I need (the Dsprite library). Thanks IanM.

Eight Year Recoil

EightYearRecoil
21
Years of Service
User Offline
Joined: 7th Apr 2003
Location: United States
Posted: 14th Apr 2003 09:33
Well, I downloaded the library that you told me about, but before trying it out, I figured out a way to control my sprite placement without the library. All I had to do was have 2 sprites for my main character. One created before the object sprites and one created after. Then, when my character ran into an object, I check to see if it should be in front of or behind it, and change it's sprite accordingly. I hope that may be able to help someone else. Thanks again IanM, I always appreciate help and ideas when I can get them.

Eight Year Recoil
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Apr 2003 16:16
Hey, that's a neat and fast solution

Login to post a reply

Server time is: 2024-04-20 05:26:29
Your offset time is: 2024-04-20 05:26:29