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.

Newcomers DBPro Corner / DarkBASIC newb with queries...

Author
Message
RyokuMas
19
Years of Service
User Offline
Joined: 5th Jul 2005
Location:
Posted: 8th Jul 2005 20:01
Just picked up DBPro... reminds me of my old STOS days!

I'm writing a few "exercise" programs in 2D to get the feel for the language before making the big jump into 3D. Generally, I'm doing okay, but a couple of things have come up:

Is there any way to copy chunks of bitmap around with a transparent colour cerother than loading the image into a thumping great sprite?

Is there any way to change the transparent colour of sprites from black to something else?

Thanks,
RyokuMas

"It's not the great who are strong - it's the strong who are great"
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th Jul 2005 02:21
Quote: "Is there any way to copy chunks of bitmap around with a transparent colour cerother than loading the image into a thumping great sprite?"


You can use PASTE IMAGE, but sprites are easier to use. It depends on what exactly you are doing.

Quote: "Is there any way to change the transparent colour of sprites from black to something else?"


You can use PNG and TGA files, which have true transparency in the form of an alpha channel. Your images can then have varying degrees of transparency (255 levels).

You can also use SET IMAGE COLORKEY to change the transparent colour in a bitmap

BatVink
RyokuMas
19
Years of Service
User Offline
Joined: 5th Jul 2005
Location:
Posted: 11th Jul 2005 00:34
Thanks, will take a look.

Another couple of things: I'm writing a very simple horizontal scrolling shoot-em-up as an intro exercise, using DOT commands to draw a multi-level star field, and LINE to draw "mountains" at the bottom of the playing field. The rest of the graphics are handled as sprites.

1) Sometimes, I need to get the first available element in an array from a given offset point. Normally I'd use something like this:

GetNextAvailable(nStartPoint)
nNext = nOffset+1
nFoundAt = 0
WHILE (nFoundAt < 1) AND (nNext <> nOffset)
IF aArray(nNext) = 0
nFoundAt = nNext
ENDIF
IF nNext < MAX_ARRAY_SIZE
nNext = 1
ELSE
INC nNext
ENDIF
ENDWHILE

However, whenever I use any kind of looping construct other than a FOR-NEXT loop, my background washes over blue - the sprites are still visible, but everything else is lost.

2) I create my sprites in PaintShop Pro and save in .BMP format. When they're displayed on screen, they often do not appear quite correctly - the images seem grainy, as if they are being re-sized badly, even though the dimensions used are the same as those specified in PSP - I've even tried using SIZE SPRITE to ensure the dimensions are correct, but the images still appear slightly corrupted on screen when my program is running.

Any clues?

"It's not the great who are strong - it's the strong who are great"

Login to post a reply

Server time is: 2024-09-23 23:27:25
Your offset time is: 2024-09-23 23:27:25