Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Making the GUI semi-transparent (already fullscreened and moved about)


Kemerd
 Share

Recommended Posts

This is stock EO 3.0.

Hello there, and it's me, Kemerd! With yet another question. (Yes, yes. Another one.) I've been wondering… How would I go about making my GUI and other things transparent? Here's a look at what I'm looking to make transparent.

>! ![](http://img255.imageshack.us/img255/9651/finishedgui.png)

I'm trying to make the .jpeg files transparent. Meaning, that I'd rather not render the WHOLE system over,(meaning the positioning and rendering the actual .png file, and since everything is already connected to the picturebox, there would be almost a total rewrite) just actually load the .jpeg files, and then make them at, let's say 50% transparency. (I'm going to probably loading a picture behind those two pictureboxes so that's not really the problem.)

Also, can I make chat semi-transparent, maybe loading another .jpeg as the backround and making that semi-transparent? Or could I make the backcolor semi-transparent?

Thanks, again.

~Kemerd
Link to comment
Share on other sites

I'm not trying to re-render everything as a .png, or render the pictureboxes all over again. I'm still trying to use .jpeg, but make them semi-transparent using the Dx8 engine. There still would be some rendering and such, but how would I go about doing that?
Link to comment
Share on other sites

When I render, could I dim the name of the thing I'm rendering picInventory.

Example: Let's say I'm rendering the Inventory. Could I make the name of that new inventory named "picInventory" so I wouldn't have to mess with the other stuff?
Link to comment
Share on other sites

No, what I'm saying NOW, (in my last post), that if I'm rendering the GUI (as a .png) could I somehow make the name of the now new rendered GUI to picInventory, etc. So I wouldn't have to modify all the other things everywhere.
Link to comment
Share on other sites

You need dx8 for the transparency… I think there is some way to do it with dx7, but it requires heavy edits that I forget how to do now...

And no Kermerd, you cannot simple make a rendered graphic act like a picturebox by naming it something....
Link to comment
Share on other sites

No, you'd have to change all of those to work with it being based on a rendered graphic and not a picturebox anymore…

If you wanted to make the GUI transparent without switching to dx8, you have to remove all the pictureboxes and make them rendered like any other graphic would be. You have to make the parts that you want transparent to all be one color on that image that isn't anywhere else on the image (like the bright pink the sprites and other graphics use in EO). Then you make that color of pixel not rendered to it appears transparent...

It's going to require a lot of edits for you to change all of the GUI over to this format, and I've been away from vb6 and dx7 for far to long to show the code needed...
Link to comment
Share on other sites

You can put each picture box and text box in a separate form then make the whole form translucent.

On form load just type.

```
Transparent Me, 150
```

And then In any module paste this.

```

' Form Translucency Stuff

Public Const GWL_EXSTYLE = (-20)

Public Const WS_EX_LAYERED = &H80000

Public Const WS_EX_TRANSPARENT = &H20&

Public Const LWA_ALPHA = &H2&

Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Public Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crey As Byte, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

Public Function Transparent(Form As Form, Layout As Byte) As Boolean

SetWindowLong Form.hwnd, GWL_EXSTYLE, WS_EX_LAYERED

SetLayeredWindowAttributes Form.hwnd, 0, Layout, LWA_ALPHA

Transparent = Err.LastDllError = 0

End Function
```

You will get a result similar to the image attached. You will of course have to change the location of each picture box to the new form within your code so that everything works properly again.Then you will need to play around with the forum settings set the border style to none if you want. And add drag and drop code to it.

But since you already have DX8 I would recommend using the features it has once you get used to it it will be a piece of cake to work with. I just think if you want to do something do it right.
Link to comment
Share on other sites

> I thought you needed dx8 to make things transparent in Eclipse.. o.o;

Well depends on what you want do do and how you want to do it. There are always different ways to achieve similar effects. I also have an example here.

http://www.touchofdeathforums.com/community/index.php?/topic/129475-use-alpha-blending-in-directdraw-dx7/

Now of course there are always pros and cons with one method over the other.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...