Transparent Overlay

Anything about development not directly related to libgdx, e.g. OpenGL, Android APIs etc.

Transparent Overlay

Postby dddfff » Fri Apr 21, 2017 5:11 am

I have been trying to make a transparent overlay in libgdx for a few days now. I have seen people using glClearColor, and DwmEnableBlurBehindWindow. Neither have worked for me, I'm guessing DwmEnableBlurBehindWindow isn't supported on Windows 10, or at least I don't know how to make it, since there is no aero themes or anything. How would I go about making a transparent overlay, that I can still draw text onto?
dddfff
 
Posts: 1
Joined: Fri Apr 21, 2017 5:08 am

Re: Transparent Overlay

Postby maosk21 » Sun Aug 13, 2017 9:52 pm

So you want an transparent "background" applied to the screen?

Easiest way of doing so is by creating a sprite of your desired resolution(ppl might say this is very CPU intense but i say no).

Then just draw the sprite to the screen:

Code: Select all

batch.begin();

yoursprite.setposition(x,y);
yoursprite.draw(batch, transparency)

batch.end();

// Transparency can be 0 to 1 where 1 is fully transparent



I've done it this many times & older phones can handle it very well, with no noticeable fps drops.

/ Martin
maosk21
 
Posts: 7
Joined: Sun Jun 11, 2017 1:24 pm

Re: Transparent Overlay

Postby maosk21 » Sun Aug 13, 2017 9:54 pm

Also, whats good with this way is that you can create another method that changes the transparency. So it looks like an smooth animation.
maosk21
 
Posts: 7
Joined: Sun Jun 11, 2017 1:24 pm

Re: Transparent Overlay

Postby raeleus » Mon Aug 14, 2017 3:10 am

I'm pretty sure they were looking to make the window transparent in Windows 10. See search results on "DwmEnableBlurBehindWindow". Making a sprite transparent is trivial.
Play Forward Gunner!
Create skins visually with Skin Composer.
raeleus
 
Posts: 388
Joined: Wed Aug 07, 2013 10:57 pm

Re: Transparent Overlay

Postby maosk21 » Wed Aug 16, 2017 7:09 pm

Ye, haha you're prob right...
maosk21
 
Posts: 7
Joined: Sun Jun 11, 2017 1:24 pm


Return to General Development

Who is online

Users browsing this forum: No registered users and 1 guest