Media-sounds, textures etc

Blitz3D Forums/Blitz3D Beginners Area/Media-sounds, textures etc

The Thick Brummy(Posted 2007) [#1]
I've looked at lots of threads and found no questions like mine which must make me the stupidest person on the planet. How do I get my textures sounds etc into my code. I've tried to put a texture that I've referred to in my prog but I just cannot. And the second thing is: can I load my media from within the ide? when you've all stopped laughing, I would really appreciate knowing how to do it.


b32(Posted 2007) [#2]
You can import certain media in the IDE. It will give a preview of the imported media. Use the Open dialog and enter for instance *.bmp as a filename, then press Enter.
This will show all bitmaps in the current directory.
Select one and press "Open" to preview it. Same goes for .x. I haven't tried any other media.
To import textures in your code, the easiest way is to copy all the files in the same folder as the .BB program itself.
Say you have an image called "grass.bmp" that you want to load as a texture. Copy it to the folder where you saved your program, and use:
;3d mode must be set for using textures
Graphics3d 800, 600, 0, 2
;load texture
tex = LoadTexture("grass.bmp")
;if tex is not zero, the texture is loaded
Print tex

A bit more complicated is when you want to load an image from antoher folder. Then you should combine the pathname and the texturename. In Windows Explorer, look the file up that you want. Then, from the 'adres' bar, copy the path.
Note that this works only for 'real' folders, not My Documents, because it is a virtual folder. Only folders starting with A:,B:,C:,D: etc are real. The real Documents folder is C:\Documents and Settings\Brummy\My Documents.
In Blitz3D, enter the pathname, followed by the filename.
For instance:
The same picture "grass.bmp" is located in the folder C:\My Documents and Settings\Brummy\
Use:
tex = LoadTexture("C:\My Documents and Settings\Brummy\grass.bmp")

Notice that there is another "\" between the path/directory/folder and the filename itself.
The pathnames orgin from the DOS area, so people with DOS experience find it much more easier to deal with pathnames.
Another way to get the complete filename is right-clicking the file, and select Properties. In this window, the full pathname is shown. However, when the path+filename are too long, it is shortened, so the other method is more suitable.
I hope this helps.


The Thick Brummy(Posted 2007) [#3]
Thanks for taking the time to write all that. I've finally done it. Not a big deal for most people but i've finally got my first (pathetic) program finished.


IPete2(Posted 2007) [#4]
cool,

Welcome and well done mate!

IPete2.


_PJ_(Posted 2007) [#5]
Been here about 5 years (maybe more) - I still havent gotten ANYTHING finished :D

Welcome!


Adam Novagen(Posted 2007) [#6]
The Thick Brummy (And everyone else):

Here at BB.com, there is NO SUCH THING as a stupid question. Well... I mean, yeah, there is... But no one will condemn you for it. Even the best of us, at times, make an absolutely idiotic mistake, then ask others to help us with the problem which, on any other day of the week, we'd be able to correct in a second. Believe me, I KNOW, and I certainly don't even fall under the "best of us" category.