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 / How can I make part of an object transparent?

Author
Message
thinkdigital
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 22nd Aug 2004 05:07
I'm working on a game, and I'm making a sun by using my sun texture and pasting it onto a 3D plain. I'm trying to make it so that the sun part (the non-black part) of my texture image shows up on the plain, but the black part of the texture is a transparent spot on the plain that cannot be seen. If possible, I'd like to use this method for a few other things, too. But I can't get the black part of the texture to appear transparent when it's applied to the plain. Does anybody know how I can get that done?


2.3 Gigs. 1993 MHz. 256 MB Ram. Home Sweet Home.
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Aug 2004 12:09
set object obj,,,,,

"eureka" - Archimedes
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 24th Aug 2004 06:07
Phaelax has answered your question.

To elaborate, lets assume you are using a *.bmp image with a yellow star shape surrounded by black. One way of making the black transparent is using the set image colorkey command followed by the set object command.

If you are using a *.png image then the set image colorkey method doesn't work. Here you need to make sure the black part of the image is transparent by using, say, Paint Shop Pro. Then what you do is just call the set object command.

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P3.2ghz / 1 gig / GeForce FX 5900 128meg / WinXP home

Login to post a reply

Server time is: 2025-05-25 10:22:36
Your offset time is: 2025-05-25 10:22:36