2
0
mirror of synced 2025-02-22 14:28:14 +00:00
mobile/sprite/clock/clock.go
David Symonds 7b659348a5 mobile: add import comments.
Change-Id: I0ff6d42a8e11f49df6fc3066e86be75015b93631
Reviewed-on: https://go-review.googlesource.com/1238
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-10 01:59:04 +00:00

27 lines
931 B
Go

// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package clock provides a clock and time functions for a sprite engine.
package clock // import "golang.org/x/mobile/sprite/clock"
// A Time represents an instant in sprite time.
//
// The application using the sprite engine is responsible for
// determining sprite time.
//
// Typically time 0 is when the app is initialized and time is
// quantized at the intended frame rate. For example, an app may
// record wall time when it is initialized
//
// var start = time.Now()
//
// and then compute the current instant in time for 60 FPS:
//
// now := clock.Time(time.Since(start) * 60 / time.Second)
//
// An application can pause or reset sprite time, but it must be aware
// of any stateful sprite.Arranger instances that expect time to
// continue.
type Time int32