diff --git a/tcell-practice/main.go b/tcell-practice/main.go index fc61946..7962770 100644 --- a/tcell-practice/main.go +++ b/tcell-practice/main.go @@ -18,11 +18,12 @@ func main() { if err := screen.Init(); err != nil { log.Fatalf("%v", err) } + x, y := 0, 0 //defStyle := tcell.StyleDefault.Background defStyle := tcell.StyleDefault.Background(tcell.ColorReset).Foreground(tcell.ColorReset) screen.SetStyle(defStyle) - go Run(screen, defStyle) + go Run(x, y, screen, defStyle) for { switch event := screen.PollEvent().(type) { @@ -39,10 +40,12 @@ func main() { } -func Run(screen tcell.Screen, defStyle tcell.Style) { +func Run(x int, y int, screen tcell.Screen, defStyle tcell.Style) { for { - screen.SetContent(20, 20, 'A', nil, defStyle) + screen.SetContent(x, y, 'A', nil, defStyle) screen.Show() + x++ + y++ time.Sleep(time.Second) } }