Tiles has Transform
This commit is contained in:
parent
ed5092cc3e
commit
540eab9a0f
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue