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.

Dark GDK / Sprite behind other sprites

Author
Message
Isocadia
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 12th Jan 2010 18:08
Well, I replaced my cursor with a sprite, the only problem is that it is always behind my menu sprites. This is the order in which I load them and draw them to the screen:



As far as my knowlege goes, the last called sprite command is the one rendered on top, and I think I use my cursor at the last but of every command.

Hope you guys can help me.

Isocadia

Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 12th Jan 2010 18:39
Have you looked at dbSetSpritePriority() ??

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Isocadia
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 12th Jan 2010 19:50
Well yeah, but when I put the cursor at 2 and the rest at 1 it is still behind the other sprites.

Isocadia

Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 12th Jan 2010 20:19 Edited at: 15th Jan 2010 05:23
I could never get dbSetSpritePriority to work it may be broken. Though come to think of it i always did it at the beginning it may work at the end of the loop after all the sprites are already created.

I solved the problem by simply putting the cursor code (or whatever images you want in front) after the rest of them in your loop.

So create your cursor last and display it last. It will now showup before everything else.

www.touchofdeathproductions.com
Isocadia
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 13th Jan 2010 12:05
Well, I am loading it last, and showing it last. Its just that it is still behind my other sprites. Isn't there a command like sprite to front or something so that it is always infront of other sprites?

Isocadia

Aldur
17
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 13th Jan 2010 12:28
Have you tried just recreating the sprite instead of pasting it?
Just a thought.

Isocadia
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 13th Jan 2010 16:36
Thanks, that did it. But isn't that a bit slow or something, and do I need to delete te sprite to remake it?

Isocadia

Aldur
17
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 13th Jan 2010 16:55
I haven't tested speeds of pasting compared to recreating but in my experience it doesn't seem any slower and I've never suffer fps loss due to it.
I don't think you need to delete it first, it may make it slower or it may make it faster, I will do some tests for you later on and report back

Isocadia
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 13th Jan 2010 17:02
k, thanks.

Isocadia

Login to post a reply

Server time is: 2024-11-20 07:38:56
Your offset time is: 2024-11-20 07:38:56