func NewEbitenRenderer(loader TilesetLoader) *EbitenRenderer {
	return &EbitenRenderer{
		Tilesets:       map[string]*ebiten.Image{},
		RenderedLayers: []*RenderedLayer{},
		Loader:         loader,
	}
}
NewEbitenRenderer creates a new Renderer instance. TilesetLoader should be an instance of a struct designed to return *ebiten.Images for each Tileset requested (by path relative to the LDtk project file).
package ebitenrenderer
import (
	"image"
	"path/filepath"
	"sort"
	"github.com/hajimehoshi/ebiten/v2"
	"github.com/hajimehoshi/ebiten/v2/ebitenutil"
	"github.com/solarlune/ldtkgo"
	_ "image/png"  
)
type TilesetLoader interface {
	LoadTileset(string) *ebiten.Image
}
type DiskLoader struct {
	BasePath string
	Filter   ebiten.Filter
}
func NewDiskLoader(basePath string) *DiskLoader {
	return &DiskLoader{
		BasePath: basePath,
		Filter:   ebiten.FilterNearest,
	}
}
func (d *DiskLoader) LoadTileset(tilesetPath string) *ebiten.Image {
	if img, _, err := ebitenutil.NewImageFromFile(filepath.Join(d.BasePath, tilesetPath)); err == nil {
		return img
	}
	return nil
}
type RenderedLayer struct {
	Image *ebiten.Image  
	Layer *ldtkgo.Layer  
}
type EbitenRenderer struct {
	Tilesets       map[string]*ebiten.Image
	CurrentTileset string
	RenderedLayers []*RenderedLayer
	Loader         TilesetLoader  
}