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 / sprite (book: begginers guide to darkbasic)

Author
Message
mike anime
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location:
Posted: 11th Apr 2004 07:24
on page 323 i have typed this code into dbpro and the f15 will not show, but the background will show.

i have even loaded the dbpro version of this program from the books cd and it does the same thing.

and thoughts????????????
Zone Chicken
20
Years of Service
User Offline
Joined: 25th Jan 2004
Location: `~-..-~`~-..-~`
Posted: 11th Apr 2004 08:44 Edited at: 11th Apr 2004 09:29
I don't have the answer to this, the thing i see pointless about this ( but i very well may be missing something they are trying to do ) is why would anyone need to load up a bitmap to convert it to a image, to get a sprite. Why wouldn't you just load the bitmap as a image to begin with and make it a sprite. But to answer your question i don't have one cause i have tried using the tutorial as well and it will not get a image from the bitmap thats loaded.



this is how i would do it.
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 11th Apr 2004 12:17
how I would do it

`Initialize the program
hide mouse
cls
SYNC ON:SYNC RATE 0
`load background bitmap
load bitmap "background.bmp", 0

`load the source bitmap file
load bitmap "f15.bmp", 1

`grab image 1 from bitmap
get image 1,0,0,300,300

`draw the sprite
DO
sprite 1,170,90,1
SYNC
LOOP

then just press esc to exit, should work (not tried it though), screen updates with default autosync often don`t happen.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, ATI radeon 9800 pro gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.
Zone Chicken
20
Years of Service
User Offline
Joined: 25th Jan 2004
Location: `~-..-~`~-..-~`
Posted: 11th Apr 2004 19:30
Nope your way is a no go either, the background loads but the sprite will not show up.
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 11th Apr 2004 20:06 Edited at: 11th Apr 2004 20:07
The screen is bitmap 0 and to see anything the current bitmap need to be 0.
When you load to a bitmap the current bitmap is set to the number of the bitmap you loaded.
To get the code to work you can.

delete the bitmap after you have got the image from it.



Change the active bitmap to 0(screen) after get image.


Since you are not breaking the image up into seperate images there is no point loading as a bitmap in the first place. Use load image instead.


you ain't the cops
mike anime
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location:
Posted: 11th Apr 2004 21:53
zone chicken's code worked and i see what you mean. there is no reason to make a image when it is already an image.

i've tried everyone elses code and it does not work but i see where you'll are going with it

thank you all for the help

Login to post a reply

Server time is: 2024-09-22 04:38:49
Your offset time is: 2024-09-22 04:38:49