package main import ( "fmt" imgui "github.com/gabstv/cimgui-go" ebimgui "github.com/gabstv/ebiten-imgui/v3" "github.com/hajimehoshi/ebiten/v2" "image/color" ) func main() { if err := ebiten.RunGame(&G{}); err != nil { fmt.Printf("%v\n", err) } } type G struct{} func (g *G) Draw(screen *ebiten.Image) { screen.Fill(color.RGBA{1, 1, 1, 1}) ebimgui.Draw(screen) } func (g *G) Update() error { ebimgui.Update(1.0 / 60.0) ebimgui.BeginFrame() defer ebimgui.EndFrame() // Begin creates a new window. imgui.PushItemWidth(100) if imgui.Begin("Sample window") { imgui.Text("foo") imgui.End() } return nil } func (g *G) Layout(outsideWidth, outsideHeight int) (int, int) { ebimgui.SetDisplaySize(float32(outsideWidth), float32(outsideHeight)) return outsideWidth, outsideHeight }