ebitenkit

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package ebitenkit contains utilities specific to github.com/hajimehoshi/ebiten/v2 library

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	*sprite.Collection
	// contains filtered or unexported fields
}

Collection is a wrapper around sprite.Collection, keeping track of ebiten images for the corresponding sprites.

func NewCollection

func NewCollection(col *sprite.Collection, logFunc func(msg string)) (*Collection, error)

NewCollection creates new collection, initializing frame images.

func (*Collection) Draw

func (c *Collection) Draw(dest *ebiten.Image, do *sprite.DrawOpts)

Draw draws the sprite frame on dest image with given offset, scale and rotation.

func (*Collection) FrameImage

func (c *Collection) FrameImage(name string, frame int) (*ebiten.Image, float64, float64, float64, float64)

FrameImage returns frame image for the sprite name and frame number. May return nil if such sprite is not in collection or frame number is invalid. Also retuerns sprite origins.

Jump to

Keyboard shortcuts

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