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.

2D All the way! / 7 line program not working, I feel stupid

Author
Message
veritas
18
Years of Service
User Offline
Joined: 4th Mar 2007
Location:
Posted: 8th Oct 2007 02:04 Edited at: 8th Oct 2007 03:40



This code does nothing.

The file is in the same folder.



Am I not doing this right? I feel really stupid.


edit: I'm using Dark Basic Profession v1.066
Zergei
20
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 8th Oct 2007 06:33
The problem is that your loading the bitmap on the bitmap 1, while the screen is bitmap 0.



Further on my stuff at...
TurboSquid.com
The3dStudio.com
veritas
18
Years of Service
User Offline
Joined: 4th Mar 2007
Location:
Posted: 8th Oct 2007 06:36
whats this for:

set current bitmap

the book I'm reading didn't explain it to me yet.

"Beginners Guide to DarkBASIC Pro Game Programming"
LBFN
18
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 8th Oct 2007 07:12 Edited at: 8th Oct 2007 07:15
When a bitmap is loaded, it becomes the one the computer will read and write to. Bitmap 0 is always the screen. This is handy because you can load image information without it being seen. However, you need to remember to switch back to bitmap 0 once you are done.

I tried your code in DBC and it worked. In DBP, however, it does not. DBP automatically updates the screen unless you turn the backdrop off. Something like this:


Just for fun, I threw in a sphere. This should work for you.

LB
aluseus GOD
18
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 8th Oct 2007 16:55
Isnt it easier to

Load Image 1,"test.bmp"
Sprite 1,0,0,1
Wait Key?

But you know what Im glad about? Another person is working with 2d!

Not even a strait suit, you, caramel, the recycling bin, uber code, and chuck norris combined can keep me safe from me. Mostly cuz I exist.
Deathead
18
Years of Service
User Offline
Joined: 14th Oct 2006
Location:
Posted: 8th Oct 2007 17:47 Edited at: 8th Oct 2007 17:47
No. Load image "test.bmp",1 Actually.lol I wanted to join in.

-Go onto the forums its nice! Join now!
LBFN
18
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 8th Oct 2007 17:57
Simply loading the image is the easiest way, but you make the assumption that the bitmap pic only contains one image. What if veritas has 20 images on it? True, he is only grabbing one image in his example, but that does not necessarily mean that only one is on it.

LB
veritas
18
Years of Service
User Offline
Joined: 4th Mar 2007
Location:
Posted: 9th Oct 2007 00:52
well, test was only one image.

but the whole sheet has roughly 80.

anyways, I gave up and moved back to DirectX.


but it's still in 2d!!
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 11th Oct 2007 23:04
@windows killer
I don't understand the load image "blah",1,1
Didn't know you could set transparency there and why would you want black to show on a sprite?

Login to post a reply

Server time is: 2025-08-09 02:09:24
Your offset time is: 2025-08-09 02:09:24