Where to put images and sound?

BlitzPlus Forums/BlitzPlus Beginners Area/Where to put images and sound?

Piggy(Posted 2014) [#1]
What folder should I put my images and sound files in? My program is located in C: > Game. Please help!


GfK(Posted 2014) [#2]
C:/Game/graphics
C:/Game/sounds


Piggy(Posted 2014) [#3]
thanks!


GaryV(Posted 2014) [#4]
Just do not hardcode the locations, or you will run into issues.


Makis(Posted 2014) [#5]
Can you please explain the "Hardcode" thing?


okee(Posted 2014) [#6]
If you save your images in a folder called

c:\game\graphics

then you can access them by doing

mysprite = LoadImage("graphics\thesprite.png")

Thats the recommended way

hardcoding would be using the full path

mysprite = LoadImage("c:\game\graphics\thesprite.png")

which is not recommended because if the player moved the folder to
the d:\ drive it won't find the graphics


GaryV(Posted 2014) [#7]
^what he said^

GfK's answer was correct to the specific question asked, but you want to load them as okee has shown to avoid any issues on your end users system.


Piggy(Posted 2014) [#8]
Won't work, keeps returning "Invalid Image Handle". I have the image done as LoadImage("Graphics/image.jpg").


Piggy(Posted 2014) [#9]
Debug log highlights my DrawImage(image,100,100), not the LoadImage


Piggy(Posted 2014) [#10]
Now its just blank


GfK(Posted 2014) [#11]
If you're getting that error on DrawImage, then LoadImage failed to load the image. In other words, the image is not where you're telling the program it is.

You should have a folder called "Graphics" alongside your .bb file (or is it .bp for Blitzplus?), with image.jpg inside it.


Makis(Posted 2014) [#12]
Thanks for the clarification!


Piggy(Posted 2014) [#13]
I do, but the screen stays blank


Matty(Posted 2014) [#14]
Post some code. Most likely you have forgotten to flip the backbuffer into view.


Piggy(Posted 2014) [#15]
i fixed it