Documentation
¶
Overview ¶
Package shapes contains various drawable shapes
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Get = gets{ Box: func(e *goecs.Entity) Box { return e.Get(TYPE.Box).(Box) }, SolidBox: func(e *goecs.Entity) SolidBox { return e.Get(TYPE.SolidBox).(SolidBox) }, Line: func(e *goecs.Entity) Line { return e.Get(TYPE.Line).(Line) }, }
Get a geometry component
View Source
var TYPE = types{ Box: goecs.NewComponentType(), SolidBox: goecs.NewComponentType(), Line: goecs.NewComponentType(), }
TYPE hold the goecs.ComponentType for our shapes components
Functions ¶
This section is empty.
Types ¶
type Box ¶
type Box struct { Size geometry.Size // The box size Scale float32 // The box scale Thickness int32 // Thickness of the line }
Box is a rectangular outline that we could draw in a geometry.Point with a color.Solid
func (Box) GetReactAt ¶ added in v0.1.13
GetReactAt return return a geometry.Rect at a given point
func (Box) Type ¶ added in v0.3.0
func (b Box) Type() goecs.ComponentType
Type return this goecs.ComponentType
type Line ¶ added in v0.1.6
type Line struct { To geometry.Point // To where the line goes Thickness float32 // Thickness of the line }
Line is a component that represent a line
func (Line) Type ¶ added in v0.3.0
func (l Line) Type() goecs.ComponentType
Type return this goecs.ComponentType
type SolidBox ¶ added in v0.1.8
SolidBox is a rectangular shape that we could draw in a geometry.Point with a color.Solid or color.Gradient
func (SolidBox) Contains ¶ added in v0.1.8
Contains return if a box at a geometry.Point contains a point
func (SolidBox) Type ¶ added in v0.3.0
func (b SolidBox) Type() goecs.ComponentType
Type return this goecs.ComponentType
Click to show internal directories.
Click to hide internal directories.