Documentation ¶
Index ¶
- type Canvas
- func (c *Canvas) AppendElement()
- func (c *Canvas) Background()
- func (c *Canvas) Clear()
- func (c *Canvas) Draw()
- func (c *Canvas) DrawConnection(p1, p2 *particles.Particle)
- func (c *Canvas) DrawParticle(particle *particles.Particle)
- func (c *Canvas) Fullscreen()
- func (c *Canvas) ListenEvents()
- func (c *Canvas) Render()
- func (c *Canvas) Size(width, height int)
- func (c *Canvas) Start()
- func (c *Canvas) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Canvas ¶
type Canvas struct {
// contains filtered or unexported fields
}
Canvas element and data
func NewCanvas ¶
func NewCanvas(id string, fps time.Duration, background string, maxparticles int, particleConfig particles.Config) *Canvas
NewCanvas initializes a Canvas element
func (*Canvas) AppendElement ¶
func (c *Canvas) AppendElement()
AppendElement append the canvas element to the body
func (*Canvas) Background ¶
func (c *Canvas) Background()
Background fills the background with color
func (*Canvas) DrawConnection ¶
DrawConnection draws a line between two vectors
func (*Canvas) DrawParticle ¶
DrawParticle draws elements in the canvas
func (*Canvas) Fullscreen ¶
func (c *Canvas) Fullscreen()
Fullscreen set the size of the canvas as the size of the window
func (*Canvas) ListenEvents ¶
func (c *Canvas) ListenEvents()
ListenEvents add events listener, such as: resize
Click to show internal directories.
Click to hide internal directories.