Description

Package sprite provides a 2D scene graph for rendering and animation.

A tree of nodes is drawn by a rendering Engine, provided by another package. The OS-independent Go version based on the image package is:

golang.org/x/mobile/exp/sprite/portable

An Engine draws a screen starting at a root Node. The tree is walked depth-first, with affine transformations applied at each level.

Nodes are rendered relative to their parent.

Typical main loop:

for each frame {
	quantize time.Now() to a clock.Time
	process UI events
	modify the scene's nodes and animations (Arranger values)
	e.Render(scene, t, sz)
}