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 / Loading a basic sprite

Author
Message
Bazza
20
Years of Service
User Offline
Joined: 24th Jul 2004
Location:
Posted: 25th Jul 2004 05:58
Hi there

I am brand new to Darkbasic pro and need some help with the following code, I have copied this straight from a manual and for some reason the sprite will not display, All I get is a black screen, the screen is also in a window for some reason.

Please help, thanks
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th Jul 2004 06:10
Just insert the following instruction immediately after the GET IMAGE command:

SET CURRENT BITMAP 0

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Bazza
20
Years of Service
User Offline
Joined: 24th Jul 2004
Location:
Posted: 25th Jul 2004 07:02
Hi there, thanks for the quick reply, I tried placing the "SET CURRENT BITMAP 0"

but I still get a blank screen. The cd that the project comes from also has a dark basic clasic version of the load sprite and this seems to work ok on my machine. i have posted this code in also

any idea's?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th Jul 2004 07:07
Nope, coz it worked for everyone else I suggested it to.



*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Bazza
20
Years of Service
User Offline
Joined: 24th Jul 2004
Location:
Posted: 25th Jul 2004 07:11
hi there

I just copied the code and created a new project in a differnt folder and recopied the f15.bmp file and all seems to work ok now.

hmmm funny one.

Thanks for your help.
Bazza
20
Years of Service
User Offline
Joined: 24th Jul 2004
Location:
Posted: 25th Jul 2004 07:15
do you know how i get rid of the blue background?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th Jul 2004 08:22
Just before the WAIT KEY command, put this

SET SPRITE 1, 0, 1


Check out the sprite tutorial here : http://developer.thegamecreators.com/?f=dbpro_tutorials

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Sir Spaghetti Code
20
Years of Service
User Offline
Joined: 12th Jul 2004
Location: Just left of Hell
Posted: 25th Jul 2004 09:34
Lol!! I made the same post the other day. Not saying you shouldn't have posted, all I am saying is that the book must contain an error due to both of us having the same poroblem at the same time, with the same example. I have had similar issues with having to copy and paste my code form one project to another to get it to work. A possible bug?

My post on the subject:
http://forum.thegamecreators.com/?m=forum_view&t=35735&b=7
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th Jul 2004 11:30
It's not really an error. The book was written specifically for DBC and works. There is just a little difference in how DBC and DBPro treat sprites.

DBC always renders sprites to the display bitmap, while DBPro renders sprites to the current bitmap. Simple

The issue with creating a new project seems to occur when you set a title to your project. Don't do it, and you'll be fine.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk

Login to post a reply

Server time is: 2024-11-27 02:44:08
Your offset time is: 2024-11-27 02:44:08