hatmill/attribute/coords.go

28 lines
422 B
Go

package attribute
import (
"bytes"
"gitlab.codemonkeysoftware.net/b/hatmill"
)
type CoordsList []float32
func (l CoordsList) String() string {
var buf bytes.Buffer
for i, f := range l {
if i > 0 {
buf.WriteRune(',')
}
buf.WriteString(Float(f).String())
}
return buf.String()
}
func Coords(values ...float32) hatmill.Attrib {
return hatmill.Attrib{
Key: "coords",
Value: CoordsList(values),
}
}