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 / A second strange problem

Author
Message
Penfold
21
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 5th Apr 2004 23:10 Edited at: 6th Apr 2004 00:09
Ok now I don't know if its 'cuz DB doesn't liking 3D and 2D commands or not but heres teh strange thing..

Firstly I load a .bmp to use later to overlay the screen
load bitmap "textures/items.bmp",2

And I want text displayed over the screen during the main part of my program for debugging tools etc.
text 20,40,"fps: "+STR$(screen fps())

Later on in a subroutine I use my loaded .bmp to overlay the screen
copy bitmap 2,0

the problem is because I loaded the image using load bitmap the text won't display for debugging. but I need the image loaded as a bitmap otherwise I can't overlay onto the screen.. Its a bit mish mashed.. and it took me a few mins to realise what was causing the dbugg tools to disapear.

anyone else seen this problem....?

*EDITED*

I'm finding more problems as I go along.. If my program even mentions a bitmap it turns off my debug tools.

I have a snippit of code in my program that blurs a bitmap and then displays it. my debug tools run fine up until this happens then they switch off.. Kinda freaky..lol

'Ooh 'eck chief'...'crumbs'
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 5th Apr 2004 23:13
Did you try to put the text command after the copy bitmap command? That might cause it to be pasted over the bitmap making it visible.

Its not a bug, its a feature!
Penfold
21
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 5th Apr 2004 23:22
the txt command is the last thing in my main loop before it restarts..

so it has the best chance to overlay.

if I turn the command that loads the bitmap into a rem statement it displays fine.

'Ooh 'eck chief'...'crumbs'
Night Giant
21
Years of Service
User Offline
Joined: 26th Jul 2003
Location:
Posted: 6th Apr 2004 07:52
why can't you use load image to paste the bitmap? i am assuming you are using for a hud of sorts?

oh, wow. insignificantpunks.cjb.net. we like orange treble clef notes, just for future reference.

no: website for progs yet.
Penfold
21
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 6th Apr 2004 20:33
If I use load image instead of load bitmap it won't let me display straight on to the screen using the copy bitmap command.

'Ooh 'eck chief'...'crumbs'
Night Giant
21
Years of Service
User Offline
Joined: 26th Jul 2003
Location:
Posted: 7th Apr 2004 06:15
right, but can't you just use "paste image num,x,y,alpha"?

oh, wow. insignificantpunks.cjb.net. we like orange treble clef notes, just for future reference.

no: website for progs yet.
Penfold
21
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 7th Apr 2004 23:58
not If I waqnt to fade the pic first

'Ooh 'eck chief'...'crumbs'
Penfold
21
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 8th Apr 2004 22:42 Edited at: 8th Apr 2004 22:42
I've adapted my code and removed the fade effect and this is the code that happens if the menu is started,

paste image 2,0,0,1
sync
wait 100
do
if returnkey()=1
wait 100
return
endif

the image pasted (image 2) is flashed up on the screen for a second and then removed. It does this even withought the sync command. How do I make it so that the image is perminant and I can paste other images over the top?
loop

'Ooh 'eck chief'...'crumbs'
Night Giant
21
Years of Service
User Offline
Joined: 26th Jul 2003
Location:
Posted: 10th Apr 2004 06:59
for some reason the paste image command is not permanent, you have to put in your main loop, it shouldn't effect speed or anything, it hasn't mine. and to put stuff in front of it, just put them after the paste image command. DB draws 2d things in descending order.

oh, wow. insignificantpunks.cjb.net. we like orange treble clef notes, just for future reference.

no: website for progs yet.
Penfold
21
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 10th Apr 2004 12:55
So theoretically if I change my code to:


do
paste image 2,0,0,1
if returnkey()=1
wait 100
return
endif


it should print the image repeatedley until the mini loop is finished witht the returnkey as it is a nested loop?

'Ooh 'eck chief'...'crumbs'
Penfold
21
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 10th Apr 2004 13:05 Edited at: 10th Apr 2004 13:13
Ok this seems to work for the most part but as I use the return key to activate this code I have a problem with it jumping to the return statement too quickly (i.e. the return key is still being pressed and so exits the loop)

I've tried putting a wait command after paste image but this makes the image wobble in and out of existence on the screen (I'm gonna use that later for a special FX)

I've also tried putting a wait command in front of the do command to give me a split second to take my finger off the key but the computer seems to lock and I have to use the windows key to get out of it.
*EDITED*- Ok I've just realised after leaving it for a few seconds it takes that long for the image to become displayed and then it takes a few seconds before the loop can be exited. While its between these two phases the computer seems to lock up

Any ideas anyone....(and if your answer is asign the exit key to a different key don't bother cuz I need the menu enter and exit on the return key for a reason).

thanx in advance.

Trevor AKA Penfold

'Ooh 'eck chief'...'crumbs'
Penfold
21
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 10th Apr 2004 13:24
Ok I somehow managed to sort half the problem out on my own...I can't remember ever using a sync command while using pure 2D but there you go.. the only problem is now because of the sync command my 3d character in the background is still moving..Everything else ahs stopped but this is still going... Ok the new code as it stands.

wait 100
do
paste image 2,0,0,1
sync
if returnkey()=1
wait 100
return
endif
loop


'Ooh 'eck chief'...'crumbs'

Login to post a reply

Server time is: 2025-05-23 06:18:32
Your offset time is: 2025-05-23 06:18:32