raf

package
v0.0.0-...-6d3478e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelAnimationFrame

func CancelAnimationFrame(id int, f ...func())

CancelAnimationFrame provides a cover for RAF using the js api cancelAnimationFrame.

func RequestAnimationFrame

func RequestAnimationFrame(r Mux, f ...func()) int

RequestAnimationFrame provides a cover for RAF using the js api for requestAnimationFrame.

Types

type Clock

type Clock struct {
	// contains filtered or unexported fields
}

Clock defines an interface which exposes methods which allow a timeloop run.

func New

func New(m Mux) *Clock

New returns a new instance pointer of the Clock type.

func (*Clock) Pause

func (c *Clock) Pause()

Pause disabbles the clocks ticking if it has been paused.

func (*Clock) Resume

func (c *Clock) Resume()

Resume enables the clocks ticking if it has been paused.

func (*Clock) Start

func (c *Clock) Start(f ...func())

Start registers the clock with the animation call loop. Calls all passed in functions once the clock has being successfully registered.

func (*Clock) Stop

func (c *Clock) Stop(f ...func())

Stop deregisters the clock and stops all loop calls and calls the passed in functions.

func (*Clock) Tick

func (c *Clock) Tick(f float64)

Tick enables the clocks ticking if it has been paused.

func (*Clock) Toggle

func (c *Clock) Toggle()

Toggle switches the state of the clock from paused to resume and vise versa.

type Mux

type Mux func(float64)

Mux defines a handler for using with RAF.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL