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 / Help with Transparency "window" Bitmap, Image or Large Sprite ?

Author
Message
DemonHill
18
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 1st Jun 2014 17:17 Edited at: 1st Jun 2014 17:51
A picture says a thousand words. Please see the attached image and I will explain what I am trying to do.

The Green area will be transparent looking on to a race track.

The Car is a sprite (PNG image with transparency) so happy with that.
But can't figure out if I need to make a background a png with transparency as an image or a large sprite.

I will be displaying text on the monitors, so not sure I can have the background including them actually a sprite.

Guidance needed please as I have tried reading numerous posts but can't quite get what I need. This is purely a 2D game as you can probably see.

Help appreciated.
VisualProg
17
Years of Service
User Offline
Joined: 31st Mar 2009
Location: RussianFederation, Smolensk
Posted: 3rd Jun 2014 16:36 Edited at: 3rd Jun 2014 16:42
Sketched. (see in attach)

Split large image to the several small, and draw this in sequence.
If i true understand question ...

oh, sorry, replace "_crlf" in "chr$(13)+chr$(10)", i not noticed

MZh[NUL] <---

gamerboots
17
Years of Service
User Offline
Joined: 8th Dec 2008
Location: USA
Posted: 7th Jun 2014 15:01 Edited at: 7th Jun 2014 15:01
Actually, If I understand you correctly, the answer would be that you have the option to use transparency flags when pasting sprites and images to the screen. This specifies whether or not black parts are drawn to the screen. The color not drawn to the screen can be changed using the colorkey command if I'm not mistaken.

they will never know what bit them until its too late...
tiffer
20
Years of Service
User Offline
Joined: 6th Apr 2006
Location: Scotland
Posted: 7th Jun 2014 18:41
I think I get you. You mean the grean area is to act like a window through the whole picture? Just split it up into 3. The top part and bottom part as normal and the middle would realistically have to be a sprite. if I remember correctly by default any pitch black areas in a sprite are by default transparent.
gamerboots
17
Years of Service
User Offline
Joined: 8th Dec 2008
Location: USA
Posted: 8th Jun 2014 09:00
Quote: "if I remember correctly by default any pitch black areas in a sprite are by default transparent. "

correct, unless you turn transparency off, or set the transparency to a different color.
Quote: "Just split it up into 3. The top part and bottom part as normal and the middle would realistically have to be a sprite"

You can alternately make one image changing all parts you want transparent to black, and then when you paste the image to the screen you can use the optional transparency flag.

they will never know what bit them until its too late...

Login to post a reply

Server time is: 2026-07-05 22:59:51
Your offset time is: 2026-07-05 22:59:51