2023-02-17 12:47:17 +03:00
|
|
|
package gx
|
|
|
|
|
2023-02-17 23:51:40 +03:00
|
|
|
import (
|
|
|
|
"github.com/hajimehoshi/ebiten/v2"
|
|
|
|
)
|
|
|
|
|
2023-02-17 16:56:15 +03:00
|
|
|
type Sprite struct {
|
2023-02-17 23:51:40 +03:00
|
|
|
*Object
|
|
|
|
*Image
|
2023-02-17 16:56:15 +03:00
|
|
|
}
|
2023-02-17 23:51:40 +03:00
|
|
|
|
|
|
|
func (s *Sprite) Draw(
|
|
|
|
e *Engine,
|
|
|
|
i *Image,
|
|
|
|
) {
|
|
|
|
op := &ebiten.DrawImageOptions{}
|
|
|
|
op.GeoM = s.Object.T.Matrix()
|
|
|
|
|
|
|
|
i.DrawImage(s.Image, op)
|
|
|
|
}
|
|
|
|
|