diff --git a/Main.go b/Main.go index 2f90cda..09b4297 100644 --- a/Main.go +++ b/Main.go @@ -67,6 +67,23 @@ func centeredText(s string, x, y, width int, scr tcell.Screen, style tcell.Style } } +func wrappedText(s string, scr tcell.Screen, style tcell.Style) { + x := 0 + y := 0 + w, h := scr.Size() + for _, char := range s { + if x >= w { + if y >= h { + break; + } + x = 0 + y++ + } + scr.SetContent(x, y, char, nil, style) + x++ + } +} + func drawMonth(m time.Month, x, y int) { centeredText(months[m], x, y, monthWidth, wall, defStyle)