render

package
v0.0.0-...-2a48cba Latest Latest
Warning

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

Go to latest
Published: May 23, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedOrientation = errors.New("tiled/render: unsupported orientation")
	ErrUnsupportedRenderOrder = errors.New("tiled/render: unsupported render order")
)

Functions

This section is empty.

Types

type OrthogonalRendererEngine

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

func (*OrthogonalRendererEngine) GetFinalImageSize

func (e *OrthogonalRendererEngine) GetFinalImageSize() image.Rectangle

func (*OrthogonalRendererEngine) GetTilePosition

func (e *OrthogonalRendererEngine) GetTilePosition(x, y int) image.Rectangle

func (*OrthogonalRendererEngine) Init

func (e *OrthogonalRendererEngine) Init(m *tiled.Map)

func (*OrthogonalRendererEngine) RotateTileImage

func (e *OrthogonalRendererEngine) RotateTileImage(tile *tiled.LayerTile, img image.Image) image.Image

type Renderer

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

func NewRenderer

func NewRenderer(m *tiled.Map) (*Renderer, error)

func (*Renderer) RenderLayer

func (r *Renderer) RenderLayer(index int) error

func (*Renderer) RenderVisibleLayers

func (r *Renderer) RenderVisibleLayers() error

func (*Renderer) SaveAsGif

func (r *Renderer) SaveAsGif(w io.Writer, options *gif.Options) error

func (*Renderer) SaveAsJpeg

func (r *Renderer) SaveAsJpeg(w io.Writer, options *jpeg.Options) error

func (*Renderer) SaveAsPng

func (r *Renderer) SaveAsPng(w io.Writer) error

type RendererEngine

type RendererEngine interface {
	Init(m *tiled.Map)
	GetFinalImageSize() image.Rectangle
	RotateTileImage(tile *tiled.LayerTile, img image.Image) image.Image
	GetTilePosition(x, y int) image.Rectangle
}

Jump to

Keyboard shortcuts

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