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 / How do you set bitmaps as objects

Author
Message
data 98junkiee
20
Years of Service
User Offline
Joined: 19th Jan 2005
Location: England
Posted: 5th Mar 2005 03:29
How do you set bitmaps as objects when I try to set bitmaps as objects it just says only x files are recognised as objects.

http://www.nintendo-europe.com/NOE/en/GB/register/index.jsp?m=l&a=tommyvercetti9
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 5th Mar 2005 06:23 Edited at: 5th Mar 2005 06:34
Well, I think I know what your trying to do. I'm guessing that you want to make a object and then TEXTURE it with an image. The reason why your getting that error is because your trying to make a object out of a image. Images are 2d like a drawing on a piece of paper, and an object is 3d like a human or a gun in real life. A image only has one way that you can view it which is directly on top of it, on the other hand a object you can rotate and look at it from different angles.

If you want to TEXTURE a object with an image you can. A texture is just a image that is wrapped around an object.

The code below will simply load up your image, make a sphere object, and then texture the object with the image. However, make sure you replace the "FileName.bmp" part with the filename of your image that you want to use, but make sure it's in quotes.



I think that's what you want to do, but I'm not sure.

If you really want to see what that code above does then run the code below, but just remember to replace the "FileName.bmp" part with the filename of your image that you want to use, but make sure it's in quotes. And if you don't understand the code below, don't worry about it because you don't really need to yet, it's just so you can see what the code I posted above is doing.

The controls:

-Right\Left Keys - Side Step
-Down\Up Keys - Move backward and forward
-Mouse - Looks Around



I hope I've helped, but if you have any questions or thats not what you want to do then just say so .

Ollivier
20
Years of Service
User Offline
Joined: 27th Feb 2005
Location:
Posted: 5th Mar 2005 07:57
This function allows you to load a bitmap from the disk. Then it's displayed in the screen like a 3d object.

Syntax: Object_Number = Object From Image("C:\Image.BMP")

Ollivier
20
Years of Service
User Offline
Joined: 27th Feb 2005
Location:
Posted: 5th Mar 2005 11:49


*Input String is the name of the bitmap file you want to load.

*If the returned value is:
positive : object containing the image is ready. The returned value is the object number the function found to load bitmap.
negative : Error
-1 = File not found
-2 = No bitmap available
-3 = No image available
-5 = No object available

*Rem : Image and bitmap used by the function are automatically erased.
data 98junkiee
20
Years of Service
User Offline
Joined: 19th Jan 2005
Location: England
Posted: 7th Mar 2005 16:57
No i was trying to make a 2d game without 3d objects for example pong or pacman the one i am try ing to make is a grand theft auto remake

Assistance
To help you understand what each element means ;¬)
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 7th Mar 2005 17:59
What you're after, are "Sprites", not objects

Jess.

PS - There's a whole section in the help dedicated to this


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 7th Mar 2005 19:55
Grand theft auto used 3D... though very basic 3D. Most of the detail was done on the textures.


"Lets migrate like bricks" - Me
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 8th Mar 2005 00:03 Edited at: 8th Mar 2005 00:07
Ya, your probably looking for sprites. A sprite is basically just an image that restores the background when it is moved.

BEFORE running this you have to save the attachment, "Loading.bmp" and put it in the same directory as the code. Or you could just your own image .

Here's The Code:


If you run this you will see that the sprite restores the backdrop image as it moves. Also anypart that is completely black on the sprites image becomes transparent. These are the basic reasons why sprites are so important in 2d games.

Hope this helps .

Attachments

Login to view attachments

Login to post a reply

Server time is: 2025-05-23 19:31:50
Your offset time is: 2025-05-23 19:31:50