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! / Run time error blues...

Author
Message
Graiskye
18
Years of Service
User Offline
Joined: 29th Jul 2006
Location:
Posted: 4th Aug 2006 11:04
Well this is driving me nuts, very simple bit of code, out of a programming book on DB, and as far as I can tell it should work but it doesnt get a runttime error at line 12(IIRC), the first load image cmd.


Now I have the media in the project file, I am using my own media, really stumped. Such a simple thing but I cannot get it too work.
Appreciate any help offered.
Graiskye
18
Years of Service
User Offline
Joined: 29th Jul 2006
Location:
Posted: 4th Aug 2006 11:35
Okay sorry about this but..alas I cant edit my posts yet. If you notice theres one misnamed .bmp, well so did I , only it was right after I posted !
BUT I fixed it in the code, thinking for sure this is the problem, and still nothing ? Just to be sure here is the corrected code...

My apologies to the post mod... I'll try not to repeat.
wildbill
19
Years of Service
User Offline
Joined: 14th Apr 2006
Location:
Posted: 4th Aug 2006 17:09
This line "load image "testbkgrdBmp664_596.bmp",0" may be the problem. You are assigning image number as zero. I think you need to assign something higher than zero. If you load bitmap instead of image and assign as zero it will make it the screen.
Zergei
20
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 4th Aug 2006 17:50 Edited at: 4th Aug 2006 17:54
Well, your loading images, not bitmaps, so, the "get image" command returns nothing but a blank screen. "Get image", grabs a section of the "Current bitmap" (wich is also a command), wich you can set with "Set current bitmap" command. Bitmap 0 is screen. Hope that helps, and just in case, here's the code:


or

Graiskye
18
Years of Service
User Offline
Joined: 29th Jul 2006
Location:
Posted: 4th Aug 2006 21:00
Thanks again Zergei. Now I have managed to get it to work, somewhat.
I can get the background to show up, if I rem out the second load, otherwise it only flashes the background and then shows thef15 sprite on a blue screen background ?
As you can gather this is a straight copy and paste from a Ebook I found, the syntax got changed slighlty in my quest to try to get it working, the book is written for DarkBasic, and I am using DBPro so I thought maybe that was the prob, the documentation with DBPro leaves a LOT too be desired, aside from a lot of examples of code that I have no idea what they mean, and an index that, well its an index, so Im forced to scour the web for examples and such that I can learn from...
Anyways long story short, I thought there might be a differnce in the code, thus I modified it slightly exchanging the load bitmap, with load image, because I could not find any refeerence to load bitmap in the documentation provided.
What I thought would happen , and what I am trying to get is for the background to be drawn, then the sprit drawn over the background.
Rather than post in two different threads, I'll just mention that in the other proigram I am toying with, the tile based map, I have managed to get the map to appear, but it just flashes quickly on the screen, then it is gone ?
How can I make the image, in this case the completed map, or the background image above, how do I make it stay on the screen, rather than flashing and then black, or blue screen.
Thanks again, appreciate the life line,lol.

Login to post a reply

Server time is: 2025-05-15 14:26:39
Your offset time is: 2025-05-15 14:26:39