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 / make a 2D box drawn with the "Box" command transparent?

Author
Message
HellsDevilDog
15
Years of Service
User Offline
Joined: 18th Mar 2011
Location: Ohio
Posted: 21st Sep 2011 10:30
I'm looking to make the box I've got drawn to the screen half transparent.



The code is a graphical representation of what units you're about to select, I just need to make the box transparent rather than solid white so users can see what they're selecting.
Andrew_Neale
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: The Normandy SR-2
Posted: 21st Sep 2011 10:46 Edited at: 21st Sep 2011 10:48
I'm afraid you will most likely need a plugin such as this.
Cloggy's D3D plugin

Even if you specify a colour with an alpha value, (e.g. 'ink 0x99ffffff, 0xff000000' which would specify a semi-transparent white value using hex) I don't think DB will natively handle it.

Using a plugin such as Cloggy's is far more useful anyway, and far quicker at rendering than the native commands.

[Edit]Out of curiosity I gave it a shot natively. Whilst setting the 'ink' value with alpha doesn't work, setting the colour of the box does. E.g. 'box 0, 0, 64, 64, 0x99ffffff' will render a semi transparent white box. Just in case this is useful![/Edit]

HellsDevilDog
15
Years of Service
User Offline
Joined: 18th Mar 2011
Location: Ohio
Posted: 21st Sep 2011 11:06 Edited at: 21st Sep 2011 11:14
@Andrew_Neale: Ah, that's perfect! Many thanks!



^That's the new box code I'm using based off your help, Thanks again!

Though I'm still interested in this plugin, Think i'll check that out too, Thanks!
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Sep 2011 14:12
@Andrew_Neale

Hi, long time no see.

I didn't know it was as easy as that either. Thanks.
Andrew_Neale
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: The Normandy SR-2
Posted: 21st Sep 2011 17:50
@HellsDevilDog - No worries, glad I could help. The plugin has many useful features so I'm sure you'll find some benefits from it when you get the time.

@Green Gandalf - Indeed! I do so miss the days of not having to work and having the time to be creative all day! Slowly clawing enough time back to start making a presence here again. Hope all is well!

Login to post a reply

Server time is: 2026-07-10 08:27:37
Your offset time is: 2026-07-10 08:27:37