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 / Semi transparent sprite ?

Author
Message
DemonHill
17
Years of Service
User Offline
Joined: 20th Mar 2008
Location:
Posted: 22nd Jun 2008 18:21
I have a sprite which is a menu and I want to make it semi transparent so I can see the back ground behind, any ideas what commands to use ? thats.
BMacZero
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 22nd Jun 2008 19:06 Edited at: 22nd Jun 2008 19:06
SET SPRITE ALPHA SpriteNumber,AlphaValue

The alpha value controls the sprite transparency - 255 being completely solid, 0 being completely invisible.

Edit: Oops, thought this was the DBP Newcomer's board - but I think this will still work in DB Classic?

Los Mineros are back in progress!
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 22nd Jun 2008 19:55 Edited at: 22nd Jun 2008 19:59
@bmaczero
No, that command isn't in DBC.

@demonhill
What you could do is put black points throughout the picture and turn transparency on, that way it would kind of look transparent. An easy way to do this is to write some code to put dots randomly on the image the do a GET IMAGE to get the new one.

Another idea, though I haven't tested this one, is to use a bitmap. As I recall there is a bitmap fade command. What you could do is display the sprite, then basically make a bitmap of the screen, delete the sprite, and display the bitmap over everything else. Since the parts that shouldn't be transparent are still solid underneath the bitmap, they would show through and look completely solid. The Menu, however, would be transparent since the sprite was deleted.

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 22nd Jun 2008 21:27
You could also use a textured plain instead of a sprite. You can use a combination of fade object, ghost object, and ambient light to control the depth of the transparency.

Enjoy your day.

Login to post a reply

Server time is: 2025-06-05 23:56:55
Your offset time is: 2025-06-05 23:56:55