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.

DarkBASIC Discussion / 2d and 3d help. No really. BIG Help. Also Book Question

Author
Message
dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 4th Dec 2004 15:08
I need some help with 2d and 3d objects. I just don't get them. I can do everything else EXCEPT putting images (like sprites and BMPS) on the screen. I just can't find a goot tutorial to find one.


Also the really big book that you can buy for DBC, does it come with a software disk with examples and programs for it on it? Or does it only have examples, or what?


Any help would be gratefully appreciated.
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 7th Dec 2004 11:47
Ok, let's start with a simple bitmap image on the screen. First you must load the image into memory using the "load image" command. Then you can use "paste image" to paste the image to the screen. Here's a quick example.



That puts an image at the upper left-hand corner of the screen(0,0)

Sprites are a little different in how they work. Like the paste image command, you must first load in the image with the "load image" command. The interesting with sprites is that you can use a different image for the same sprite number. This comes in handy for doing "animated" sprites. Here's a quick example of sprites. This assumes you have four different pictures that could go together to make an animation. (For example, pac-man opening and closing his mouth)



Note: I didn't actually test this code, but I believe it will work. You'll just need to put some images in the same folder that your source code is in and load them via the "load image" command; and everything should work.


3d is about the same way, except you use the "load object" command, and then you can texture your objects using the images you've loaded with the "load image" command. Sorry I don't have time to do an example of it.

Oh, and as for the book, I really don't know. I don't have it so I can't say. I suggest you do the monster hunt and Binary Moon tutorials that are on this site.

Login to post a reply

Server time is: 2025-05-29 10:33:05
Your offset time is: 2025-05-29 10:33:05