krampus19/gut/console.go
Sander Schobers b85ac17d8a Added sprites & tried out splash animation.
Moveds fonts to separate directory & added corresponding license texts.
Moved console & fps to separte gut (game utility) package.
Added console (view only).
2019-12-20 21:05:23 +01:00

22 lines
316 B
Go

package gut
import (
"bytes"
"io"
)
var _ io.Writer = &Console{}
type Console struct {
messages []string
}
func (c *Console) Write(p []byte) (int, error) {
c.messages = append(c.messages, string(bytes.TrimRight(p, "\r\n")))
return len(p), nil
}
func (c *Console) Messages() []string {
return c.messages
}