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 Professional Discussion / Create bitmap makes program choke

Author
Message
Cybermind
Valued Member
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 12th Dec 2012 12:10
I have attached some code. When I running this code, press "New monster" then "Choose bitmap", at this point the program creates a new bitmap and this halts the program. The same happens if I place Create bitmap at the very start of the code Any ideas anyone?

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 12th Dec 2012 12:47 Edited at: 12th Dec 2012 12:47
Looks like current_ui$ is to blame... and I do not know why but whenever I try to edit that line, DBP gets weird on me

Cybermind
Valued Member
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 12th Dec 2012 12:58
This little piece does the same as the first code.



How does DBP get weird? The long version of the code needs that line to run properly. It tells the program which UI is active, or rather which part of the program is active, I just call them UI's

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 12th Dec 2012 13:13
I dunno, might be something running from another app but when I try to rename that name, it get's weird, cannot explain it aside from saying it deletes the character one prior and not the one I intended...

Maybe it is because it is a registered function?

Not the first time I came across this just dunno...

But yeah it crashes on me because of that line...

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 12th Dec 2012 13:23
One thing - When you create a bitmap, that bitmap becomes the current bitmap so the 2D commands apply to that bitmap, but once you've done with the 2D commands, you have to set the current bitmap again, back to 0 so it updates the screen:

SET CURRENT BITMAP 0

So you should create your bitmap 2, do all the drawing etc, grab the image if that's what your doing, but then always set the current bitmap to 0, otherwise the screen won't update.

I got a fever, and the only prescription, is more memes.
Cybermind
Valued Member
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 12th Dec 2012 13:35
Oh, yeah, right :-P Thanks Van B Helped a lot!

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 12th Dec 2012 19:35
Quote: " it get's weird, cannot explain it aside from saying it deletes the character one prior and not the one I intended..."

it's error in text formating. JUst select all the code then cut and paste it and it should work properly

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 12th Dec 2012 19:37
Thanks Brendy boy - Will try that next time

Login to post a reply

Server time is: 2026-07-07 05:39:46
Your offset time is: 2026-07-07 05:39:46