Tiles has Transform

This commit is contained in:
Josh Deprez 2021-07-30 15:18:36 +10:00 committed by Josh Deprez
parent ed5092cc3e
commit 540eab9a0f

View file

@ -7,14 +7,16 @@ import (
) )
type Tilemap struct { type Tilemap struct {
Map [][]Tile Map [][]Tile
Src *ebiten.Image // must be a horizontal tile set Src *ebiten.Image // must be a horizontal tile set
TileSize int TileSize int
Transform ebiten.GeoM
ZPos ZPos
} }
func (t *Tilemap) Draw(screen *ebiten.Image, geom ebiten.GeoM) { func (t *Tilemap) Draw(screen *ebiten.Image, geom ebiten.GeoM) {
geom.Concat(t.Transform)
for j, row := range t.Map { for j, row := range t.Map {
for i, tile := range row { for i, tile := range row {
var op ebiten.DrawImageOptions var op ebiten.DrawImageOptions