func (u *UI) NewMap(name string, scene string, shape common.Rectangle, tintColor color.Color, imageName string) (*Map, error) {
	if imageName == "" {
		return nil, ErrImageNotFound
	}
	img, err := u.Image(imageName)
	if err != nil {
		return nil, errors.Wrap(err, imageName)
	}
	s, err := u.Scene(scene)
	if err != nil {
		return nil, ErrSceneNotFound
	}
	newShape := common.Rect(shape.Min.X, shape.Min.Y, shape.Max.X, shape.Max.Y)
	e := &Map{
		name:         name,
		image:        img,
		isEnabled:    true,
		isVisible:    true,
		lerpPosition: &LerpPosition{},
		lerpColor:    &LerpColor{},
		color:        tintColor,
		shape:        &newShape,
		data:         &MapData{},
		path:         common.NewPath(),
	}
	err = s.AddElement(e)
	if err != nil {
		return nil, err
	}
	return e, nil
}
NewMap creates a new map instance
package egui
import (
	"fmt"
	"image"
	"image/color"
	"math"
	"time"
	"github.com/hajimehoshi/ebiten"
	"github.com/hajimehoshi/ebiten/inpututil"
	"github.com/pkg/errors"
	"github.com/xackery/egui/common"
)
type Map struct {
	name            string
	image           *Image
	shape           *common.Rectangle
	text            string
	isEnabled       bool
	isVisible       bool
	isPressed       bool
	onPressed       func(e *Map)
	onPressFunction func()
	renderIndex     int64
	isDestroyed     bool
	lerpPosition    *LerpPosition
	lerpColor       *LerpColor
	color           color.Color
	data            *MapData
	path            *common.Path
}
type MapData struct {
	Source          string `json:"source,omitempty"`
	Width           int64  `json:"width,omitempty"`
	Height          int64  `json:"height,omitempty"`
	TileWidth       int64  `json:"tile_width,omitempty"`
	TileHeight      int64  `json:"tile_height,omitempty"`
	TileCount       int64  `json:"tile_count,omitempty"`
	TileSheetWidth  int64
	TileSheetHeight int64
	TileFrames      []image.Rectangle
	Layers          []MapLayer    `json:"layers,omitempty"`
	Colliders       []MapCollider `json:"colliders,omitempty"`
}
type MapLayer struct {
	Name    string    `json:"name,omitempty"`
	Opacity float32   `json:"opacity,omitempty"`
	Tiles   []MapTile `json:"tiles,omitempty"`
}
type MapCollider struct {
	IsCollider bool    `json:"is_collider,omitempty"`
	Cost       float32 `json:"cost,omitempty"`
}