EngoEngine / engo

Engo is an open-source 2D game engine written in Go.
https://engoengine.github.io
MIT License
1.75k stars 136 forks source link

Question: Can you draw upon a transparent window/canvas? #787

Closed niko-dunixi closed 1 year ago

niko-dunixi commented 2 years ago

Hello, I was wondering if there was an equivalent to the ebiten example that draws on a transparent window giving the effect of drawing upon the desktop? The relevant relevant code they have is in their mascot example:

$ go run -tags=example github.com/hajimehoshi/ebiten/v2/examples/mascot@latest

I tried setting my canvas background color but this doesn't seem to be enough, because the background still shows up as black.

common.SetBackground(color.Transparent)

Is there a way to manage the window's settings/configuration to do the same thing? Is there a way to signal this to the glfw library underneath?

Noofbiz commented 2 years ago

Hello,

You can access the underlying window with engo.Window, and should be able to use the glfw package as you normally would. However, if you want to compile using a different backend, such as SDL, web, Android, etc. then you'll need to use those respective packages instead of glfw

Hope this helps!