tuile

package module
v0.0.0-...-905e004 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 6 Imported by: 0

README

Tuile

Tuile (French for tile) is a 2D graphics engine inspired from old hardware and based on layers, tiles sets, tile maps and sprites. Its scanline rendering pipeline makes it perfect for raster effects.

Just a rendering pipeline

Tuile rendering pipeline outputs everything to a framebuffer. You can therefore use your favorite game engine to display the resulting frames. Note that this repository uses Ebiten for all the samples.

Samples

You can check the available samples in the samples directory. For instance, you can run the curvature sample using the following commands:

cd samples/curvature
go run .
Web Assembly Sample

Check the instructions provided in the README to run this sample.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IM = Matrix{1, 0, 0, 1, 0, 0}

Functions

This section is empty.

Types

type Engine

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

Engine structure

func NewEngine

func NewEngine(width, height int) *Engine

NewEngine instantiates a new tuile engine

func (*Engine) AddLayer

func (t *Engine) AddLayer(layer ...*Layer)

func (*Engine) Render

func (t *Engine) Render() []byte

func (*Engine) SetBackgroundColor

func (t *Engine) SetBackgroundColor(color color.Color)

func (*Engine) SetHBlank

func (t *Engine) SetHBlank(hBlank HBlank)

type HBlank

type HBlank func(line int)

type Layer

type Layer struct {
	Image *image.Paletted
	// contains filtered or unexported fields
}

Layer structure

func NewLayer

func NewLayer(tileMap *tmxmap.Map) (*Layer, error)

NewLayer instantiates a new layer

func NewLayerWithReader

func NewLayerWithReader(tileMap *tmxmap.Map, reader io.Reader) (*Layer, error)

func (*Layer) Disable

func (l *Layer) Disable()

func (*Layer) Enable

func (l *Layer) Enable()

func (*Layer) SetOrigin

func (l *Layer) SetOrigin(x int, y int)

func (*Layer) SetRepeat

func (l *Layer) SetRepeat(repeat bool)

func (*Layer) SetRotation

func (l *Layer) SetRotation(angle float64)

func (*Layer) SetScale

func (l *Layer) SetScale(sx, sy float64)

func (*Layer) SetTranslation

func (l *Layer) SetTranslation(dx, dy float64)

type Matrix

type Matrix [6]float64

func (Matrix) Mul

func (m Matrix) Mul(mul Matrix) Matrix

func (Matrix) Rotate

func (m Matrix) Rotate(angle float64) Matrix

func (Matrix) Scale

func (m Matrix) Scale(s Vector) Matrix

func (Matrix) Translate

func (m Matrix) Translate(d Vector) Matrix

type Vector

type Vector struct {
	X, Y float64
}

func NewVector

func NewVector(x, y float64) Vector

func (Vector) Mul

func (v Vector) Mul(m Matrix) Vector

Directories

Path Synopsis
samples

Jump to

Keyboard shortcuts

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