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 / DBPro / DB bitmap focus

Author
Message
roswell
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location: United States
Posted: 28th Feb 2003 05:09
I just bought the book "The Beginners Guide to DarkBASIC Programming", and I'm troubled by a strange discrepancy. In the chapter on sprite properties, they include a simple sample program to show how load bitmap, get image, and sprite work together. Here's what's in the book:



When I run this in DBPro, all I get is the background image. This makes sense to me, because even I created a sprite with the get image and sprite commands, I still haven't used paste sprite to actually draw the sprite to the screen, so perhaps this was a typo in the book. However, when I add the paste sprite command (paste sprite 1,0,0), I still don't see the F15 sprite in DBPro, but when I run the above code with the paste sprite command in DB Classic I see the F15. What is the difference between DBPro and DB Classic here? Does the load bitmap command in DB Classic automatically make the bitmap loaded the "current bitmap"? The reason I ask is that the get image command doesn't have an attribute to specify which bitmap to take the section from, so I'm assuming it takes the section from the current bitmap. Would someone mind clarifying the relationship between these 3 commands for me?
/* You are not expected to understand this. */
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Feb 2003 10:53
Creating or loading a bitmap makes the new bitmap the current one for all drawing operations, and GET IMAGE/PASTE IMAGE/PASTE SPRITE all draw to the current bitmap.

Just use 'SET CURRENT BITMAP 0' after the 'GET IMAGE' and it should work.
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 28th Feb 2003 11:47
Yup do as IanM said - however, I'm shocked that code made it into the book! (or did you change it somehow?)

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
The Game
21
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United States
Posted: 28th Feb 2003 16:15
The code that roswell showed is the one in the book...The funny thing is it was the exact thing I was looking at last night....also the compiled version on the cd does not work because they commented out the sprite command with this "`" when I looked at the source for it on the CD. It does have the paste sprite command in the source but no Set Current Bimap command.

I am the game and I want to play.
roswell
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location: United States
Posted: 1st Mar 2003 01:04
Thanks guys. That helped!

/* You are not expected to understand this. */

Login to post a reply

Server time is: 2024-09-19 22:27:28
Your offset time is: 2024-09-19 22:27:28