wip I guess
This commit is contained in:
29
common/elements/v1/base/config.go
Normal file
29
common/elements/v1/base/config.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package base
|
||||
|
||||
import (
|
||||
"image/color"
|
||||
|
||||
"git.vezzani.net/ben/games/common/elements/v1"
|
||||
)
|
||||
|
||||
type OptFunc func(*Element)
|
||||
|
||||
func Children(children ...elements.Element) OptFunc {
|
||||
return func(c *Element) {
|
||||
c.children = children
|
||||
}
|
||||
}
|
||||
|
||||
func Name(name string) OptFunc {
|
||||
return func(s *Element) {
|
||||
s.name = name
|
||||
}
|
||||
}
|
||||
|
||||
func (b elements.Builder) BackgroundColor(c color.Color) elements.Builder {
|
||||
return func() elements.Element {
|
||||
ce := b().(*Element)
|
||||
ce.backgroundColor = c
|
||||
return ce
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user