Documentation ¶
Index ¶
- Constants
- func LoadPictureData(path string) (data *pixel.PictureData, err error)
- func LoadSprite(path string) (sprite *pixel.Sprite, err error)
- type IDGen
- type Ticker
- func (ticker Ticker) AvgFramerate() float64
- func (ticker Ticker) Deltat() float64
- func (ticker Ticker) Framerate() float64
- func (ticker Ticker) PrevFramerates() []float32
- func (ticker *Ticker) Reset()
- func (ticker *Ticker) SetTargetFPS(target int64)
- func (ticker Ticker) TargetFrametime() time.Duration
- func (ticker *Ticker) Tick() (deltat, framerate float64)
- func (ticker *Ticker) Wait()
- type Voronoi
- type VoronoiCell
- type VoronoiCellMap
Constants ¶
View Source
const (
MAX_PREV_FPS = 500
)
Variables ¶
This section is empty.
Functions ¶
func LoadPictureData ¶
func LoadPictureData(path string) (data *pixel.PictureData, err error)
Helper to load a sprite from a file and make Pixel.PictureData from it
Types ¶
type Ticker ¶
type Ticker struct {
// contains filtered or unexported fields
}
func NewTicker ¶
NewTicker returns a new ticker with the given target fps and 500 stored previous framerates.
func NewTickerV ¶
NewTickerV returns a new ticker with the given target fps and a custom amount of stored previous framerates.
If maxPrevFPS is <= 0, don't store any previous framerates.
func (Ticker) AvgFramerate ¶
Return the average framerate
func (Ticker) PrevFramerates ¶
Return the list of previous framerates
func (*Ticker) SetTargetFPS ¶
SetTargetFPS sets the target ticker rate; will be less than or equal to target.
func (Ticker) TargetFrametime ¶
Return the current target frametime
type Voronoi ¶
type Voronoi struct {
// contains filtered or unexported fields
}
type VoronoiCellMap ¶
type VoronoiCellMap map[interface{}]VoronoiCell
Click to show internal directories.
Click to hide internal directories.