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.

/ Sprite Display Problem

Author
Message
Avien Langley
21
Years of Service
User Offline
Joined: 29th Jan 2004
Location: State of Denial
Posted: 29th Jan 2004 09:04
Hi. I've been using DarkBASIC for well over a year (don't remember exactly how long) and I've programmed a lot of small sample games with it. So I'm fairly experienced with DarkBASIC. But there's a problem I've never figured out so I decided to try the forum.

Being that I don't have any 3D modeling skills or a decent 3D modeler, but I have excellent 2D graphics skills and plenty of 2D graphic editing programs, I like to program 2D games rather than 3D games. For the most part my efforts have been fairly successful but there's a problem that's plagued me forever. Could someone please help me with this?

Basically, my problem is sprite display priority. By that I mean, how do you get DarkBASIC to know when to display one sprite on top of another? There seems to be some kind of pattern to this but I can't seem to figure it out; it definitely doesn't seem to have any relation to the sprite's identification number. So whenever I have two sprites overlap in my programs, I never have any idea which one DarkBASIC is going to display on top - it might as well just be completely random. For months I've tried to work around this problem but it's reached the point where it's a very serious detriment to my programs, and I have no idea how to force DarkBASIC to display one sprite over another.

Could someone please help me with this? How do I tell DarkBASIC that I want Sprite A to be displayed over Sprite B, but under Sprite C, and so forth? Thanks very much in advance.
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Jan 2004 11:12
I think it has to do with the order that they are created.

Avien Langley
21
Years of Service
User Offline
Joined: 29th Jan 2004
Location: State of Denial
Posted: 29th Jan 2004 19:09
If you're correct that the sprite display priority is based on when the sprite is created, that could be a serious problem for me. There are many instances where I create sprites in a separate order than I'd like them displayed, and it would be extremely difficult if not impossible to create them in order of display priority. Does anyone know for certain if this is the case? If the display priority IS based on when the sprite was created, does anyone know a way around this?

And while I'm at it, as a related problem, DarkBASIC always seems to display sprites over text that's printed to the screen. This too has become a serious problem in my programs, as there are many instances where I'd like to be able to just print text that stays visible at all times, and doesn't get tucked under sprites. Any thoughts on this problem as well? Once again I appreciate any help.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 29th Jan 2004 21:00
Everyone should have this site bookmarked : http://www.underwaredesign.com/

There is code there that allows you to prioritise DB sprites.

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
Avien Langley
21
Years of Service
User Offline
Joined: 29th Jan 2004
Location: State of Denial
Posted: 29th Jan 2004 21:41
Many thanks, IanM. That is exactly what I needed. This is going to be of immeasurable help in my 2D programming ventures.

Thanks again!

Login to post a reply

Server time is: 2025-06-30 15:26:42
Your offset time is: 2025-06-30 15:26:42