Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
D2 menu using gui/gfx
This file has been truncated, but you can view the full file.
package main
import (
func main() {
gui.Run(func() {
win, err := gui.Open(gui.Size(800, 600), gui.Decorated(false))
if err != nil {
for event := range win.Events() {
switch event.(type) {
case gui.EventClose, gui.EventMouseLeftDown:
case gui.EventResize:
func drawBytesFunc(b []byte) func(draw.Image) image.Rectangle {
return func(dst draw.Image) image.Rectangle {
src, err := gfx.DecodePNG(bytes.NewReader(b))
if err != nil {
return image.ZR
gfx.Draw(dst, src.Bounds(), src)
return dst.Bounds()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.