Version: v0.0.0-...-a02e23d Latest Latest

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

Go to latest
Published: Dec 20, 2018 License: MIT Imports: 13 Imported by: 0




View Source
const (
	TileLayerDrawer = iota

Drawer Types


This section is empty.


This section is empty.


type Camera

type Camera struct {
	DT time.Duration
	// contains filtered or unexported fields

func NewCamera

func NewCamera() *Camera

func (*Camera) Draw

func (c *Camera) Draw(src, dest *ebiten.Image) error

func (*Camera) Pan

func (c *Camera) Pan(dir float64, rate float64)

func (*Camera) StartUpdate

func (c *Camera) StartUpdate(now time.Time)

func (*Camera) String

func (c *Camera) String() string

type Drawer

type Drawer interface {
	Type() int
	Info() *LayerInfo
	Update() error
	Draw(image *ebiten.Image) error
	Image() *ebiten.Image

func NewDrawer

func NewDrawer(resources *Resources, parent Drawer, layer *tmx.Layer) (Drawer, error)

NewDrawer creates a Drawer which will render the layer and recursively draw all child layers.

func NewRootDrawer

func NewRootDrawer(resources *Resources, mapData *tmx.Map) (Drawer, error)

NewRootDrawer will create a special Drawer that will recursively draw the entire tmx map.

type LayerInfo

type LayerInfo struct {
	// contains filtered or unexported fields

LayerInfo provides drawing information for the layer, it holds the recursively calculated offset, visibility, and color information, as well as a reference to the base map data. It prevides easy methods translating between tmx and pixel world coordinates.

func (*LayerInfo) TileRect

func (li *LayerInfo) TileRect(cell int) (image.Rectangle, error)

TileRect returns the pixel.Rect of a TMX map tile in pixel world coordinates.

type Resources

type Resources struct {
	// contains filtered or unexported fields

func LoadResources

func LoadResources(mapData *tmx.Map, path string) (*Resources, error)

LoadResources searches through the tmx map tree and loads any resources found. If the resources are located somewhere other than the current working directory, the location should be supplied in the path string.


Path Synopsis

Jump to

Keyboard shortcuts

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