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 / dbDrawSpritesFirst doesn´t draw them at all.

Author
Message
MiR
21
Years of Service
User Offline
Joined: 13th Jul 2003
Location: Spain
Posted: 6th Sep 2005 19:52
I use this command so I can have the framerate etc over the sprites.
I was playing around to see if paste image was faster than sprite and when I went to display my sprite again all there was was a black screen with the frame rate in the left corner. If I move the window around (the games in windowed mode) the screen changes blue and I can see my sprite but the text disapears. Does anyone know what´s going on?

Don´t steal me piccy now!


Thank you for the votez!1!

Attachments

Login to view attachments
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Sep 2005 20:25
Yep, I know what's going on.

When you use dbDrawSpritesFirst, you are instructing the library to draw sprites as the very *last* step within dbSync ... and then the very next instruction you use clears the display.

If you use dbDrawSpritesFirst, then you probably want to enable the backdrop, letting dbSync clear the screen for you, and then *not* use dbCLS.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
MiR
21
Years of Service
User Offline
Joined: 13th Jul 2003
Location: Spain
Posted: 6th Sep 2005 21:18 Edited at: 6th Sep 2005 21:21
Ah. I see. That would explain why it was working before. I didn´t have sleep(1); on before (it tends to crash bittorrent if I give it 100%-thanks for that tip) which meant it was updating fast enough for me to see it-or something like that.
Enabling the backdrop makes it work how I wanted it. No idea what it did though. Without dbCLS and with backdrop enabled it looks like the attacheed image. Very strange.
Thank you for your time and help.


Thank you for the votez!1!

Attachments

Login to view attachments
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th Sep 2005 14:58
If you set your backdrop colour to black (instead of the default blue), that will replicate your CLS.

The white box around your sprite is caused by the lack of transparency around the sprite - use the dbSetImageColorkey function to set the colour to use for transparency, or use an image type that handles it automatically (png or tga).

Both of these together will give you what you seem to be aiming for.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
MiR
21
Years of Service
User Offline
Joined: 13th Jul 2003
Location: Spain
Posted: 7th Sep 2005 16:35
Oops. I made a big mistake. It was running fine when I set the backdrop on because I was using dbPasteImage(). I changed it back to dbSprite() and the character disapeared again. Playing around a bit it seams that setting the backdrop on causes the same problem as having dbCLS in the loop. So that leaves me with 3 choises. Either I don`t use CLS or the backdrop (I probably don´t need them as I´ll be putting a background image of the black) or not to use sprites.
Quote: "The white box around your sprite is caused by the lack of transparency around the sprite - use the dbSetImageColorkey function to set the colour to use for transparency, or use an image type that handles it automatically (png or tga)."

mmmm. I haven´t added transparency yet. I´m not sure it´s the finished image so I haven´t got round to it. Though thanks for the tip.
Anyay. Thanks for your help with this problem. I`m now going to move CLS aroud a bit to see if it´ll work as I want.


Thank you for the votez!1!
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 7th Sep 2005 23:26
clear the screen before you draw anything, thats the best way to use it
MiR
21
Years of Service
User Offline
Joined: 13th Jul 2003
Location: Spain
Posted: 8th Sep 2005 16:03
Quote: " clear the screen before you draw anything, thats the best way to use it"

Thanks. I tried a few other positions and nothing changed well once everthing disapeared but that was a pretty dumb place to put it. I guess I`ll just remove CLS, the backdrop and drawspritesfirst. I´m going to be covering the screen with an image anyway. So none of that is any use. Infact I might not use sprites either has BatVink has given me a great idea of using memblocks and drawing them directly to the backbuffer. Enven considering the fact that the images change often it should still be very fast and I have the added bonus of having virtually free pixel perfect collision. Eciting stuff!


Thank you for the votez!1!
Drew Cameron
20
Years of Service
User Offline
Joined: 30th Jan 2004
Location: Scotland
Posted: 8th Sep 2005 17:58
Quote: "Thanks. I tried a few other positions and nothing changed well once everthing disapeared but that was a pretty dumb place to put it."


Try reading that out of context.

Katie Holmes is back!
MiR
21
Years of Service
User Offline
Joined: 13th Jul 2003
Location: Spain
Posted: 8th Sep 2005 18:30
Quote: "Try reading that out of context"

I think you´ve been looking at your Katie Homes sig too much....


Thank you for the votez!1!

Login to post a reply

Server time is: 2024-11-19 01:22:46
Your offset time is: 2024-11-19 01:22:46