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.

Dark GDK / Box transparant

Author
Message
Bjorn
14
Years of Service
User Offline
Joined: 20th Mar 2010
Location:
Posted: 5th Apr 2010 14:42
Doe anyone knows hoe I can make a dbBox transparant in a 3D game?
I still want to see it, but I want that I can see what's behind it
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 5th Apr 2010 17:30
with dbBox, i dont think you can, but you can either draw your own created box ( might be slow, unless you know a faster function than dbDot() ), or simply use a sprite

Bjorn
14
Years of Service
User Offline
Joined: 20th Mar 2010
Location:
Posted: 5th Apr 2010 17:55
And how execly can I make a sprite transparant?
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 5th Apr 2010 19:38 Edited at: 5th Apr 2010 19:39
Think this works for any 3D object:


EDIT: Is dbBox 2D? if so then I have misunderstood, sorry.

Bjorn
14
Years of Service
User Offline
Joined: 20th Mar 2010
Location:
Posted: 5th Apr 2010 19:49 Edited at: 5th Apr 2010 19:53
Yes dbBox is a 2D box that stays on your sreen, I'm using it as an whithe textbox but I want that you can see a litle bit what's behind so it isn't a pure whithe box.
If someone knows how to make this in DarkGDK Than my problem is over
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 5th Apr 2010 20:15
dbSetSpriteAlpha ( ); for sprite transparency

dbSetObjectTransparency(); ( or something like that )
+
dbSetAlphaMappingOn ( );
for 3d alpha

_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 5th Apr 2010 20:22
I haven't tested it but I would do it like this:

1. Draw the box. dbBox
2. Copy this box from the screen to an image used to make a sprite. dbGetImage
3. Create a sprite from this image. dbSprite
4. Change the alpha of this sprite to make it transparent. dbSetSpriteAlpha

Check out the DarkGDK Documentation that came with your installation for more info on the commands.
You could skip steps 1 and 2 if you load the image from a file.

Now the plot thickens, the fps decreases, and the awesomeness goes through the roof.
Bjorn
14
Years of Service
User Offline
Joined: 20th Mar 2010
Location:
Posted: 5th Apr 2010 20:44
I will now just make a sprite from a picture color, and than the dbSetSpriteAlpha worked, so now I'm busy whit resizing becouse its not a nice box anymore,
But thanks for the help!
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 5th Apr 2010 21:20
Try this


dw1 = color of the top/left-Corner.
dw2 = color of the top/right-Corner.
dw3 = color of the bottom/left-Corner.
dw4 = color of the bottom/right-Corner.

Set Dw1, dw2, dw3 and dw4 to this Color '0x80000080' and you have a Box colored dark-blue with 50% transparency. Colorformat is '0xAARRGGBB'

AA = Alpha-Value
RR = Red-Value
GG = Green-Value
BB = Blue-Value



With Computers you can solve Problems that you have never befor.

My English is so BAD ;(
Bjorn
14
Years of Service
User Offline
Joined: 20th Mar 2010
Location:
Posted: 6th Apr 2010 20:43
I'm trying to get a kind of brown.
But than this: 0x 80 160 34 0 or this: 0xA022007E must be brown,
But is still get the blue one, Do you know a nice link/program that can generate the color code?
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 6th Apr 2010 23:09 Edited at: 7th Apr 2010 11:12
Take this Makro in a Include-File or on Top of your Source.



Then you can use this so ...



The Valus's must betwen 0-255.

EDIT: To get the right Color-Value you can use a Paintprogram like "Paint" or "PaintDotNet"(this is my favorite)

With Computers you can solve Problems that you have never befor.

My English is so BAD ;(

Login to post a reply

Server time is: 2024-11-20 01:33:19
Your offset time is: 2024-11-20 01:33:19