We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Im trying to create a layered (fully transparent Window) on Windows and I'm facing two issues:
Is there maybe something already build in to draw on a transparent Window?
package main import ( "github.com/Sann0/w32" "github.com/faiface/pixel" "github.com/faiface/pixel/pixelgl" "golang.org/x/image/colornames" "syscall" ) var ( moduser32 = syscall.NewLazyDLL("user32.dll") procSetLayeredWindowAttributes = moduser32.NewProc("SetLayeredWindowAttributes") ) func SetLayeredAttributes(hwnd w32.HWND, cr w32.COLORREF, alpha byte, flags uint32) bool { r0, _, _ := syscall.Syscall6(procSetLayeredWindowAttributes.Addr(), 4, uintptr(hwnd), uintptr(cr), uintptr(alpha), uintptr(flags), 0, 0) return r0 != 0 } func initWindow() { cfg := pixelgl.WindowConfig{ Title: "Pixel", Bounds: pixel.R(0, 0, 1024, 768), VSync: true, // Undecorated: true, // AlwaysOnTop: true, } win, err := pixelgl.NewWindow(cfg) if err != nil { panic(err) } // win.SetCursorDisabled() /* result := w32.SetWindowLong(w32.HWND(handle), w32.GWL_EXSTYLE, uint32(w32.GetWindowLong(w32.HWND(handle), w32.GWL_EXSTYLE)) | 0x00080000) fmt.Println(result) // (135, 206, 345) colornames.Skyblue result2 := SetLayeredAttributes(w32.HWND(handle), w32.COLORREF(uint32(135) | uint32(206) | uint32(235)), 0, 0x00000001) fmt.Println(result2) */ mainLoop(win) } func mainLoop(win *pixelgl.Window) { for !win.Closed() { win.Clear(colornames.Skyblue) win.Update() } } func main() { pixelgl.Run(initWindow) } Original issue: https://github.com/faiface/pixel/issues/232
The text was updated successfully, but these errors were encountered:
You want a transparent window? Just set TransparentFramebuffer to true in the window config
TransparentFramebuffer
true
Sorry, something went wrong.
No branches or pull requests
Im trying to create a layered (fully transparent Window) on Windows and I'm facing two issues:
Is there maybe something already build in to draw on a transparent Window?
The text was updated successfully, but these errors were encountered: