fix prisms
This commit is contained in:
parent
03e5e7ca49
commit
6fc0725d15
1 changed files with 20 additions and 2 deletions
|
@ -1,11 +1,29 @@
|
|||
package engine
|
||||
|
||||
import (
|
||||
"encoding/gob"
|
||||
"image"
|
||||
|
||||
"github.com/hajimehoshi/ebiten/v2"
|
||||
)
|
||||
|
||||
var (
|
||||
_ interface {
|
||||
Prepper
|
||||
Transformer
|
||||
} = &PrismMap{}
|
||||
|
||||
_ interface {
|
||||
Drawer
|
||||
Transformer
|
||||
} = &Prism{}
|
||||
)
|
||||
|
||||
func init() {
|
||||
gob.Register(&PrismMap{})
|
||||
gob.Register(&Prism{})
|
||||
}
|
||||
|
||||
type PrismMap struct {
|
||||
Map map[Point3]*Prism
|
||||
DrawOrderBias image.Point // dot with (X,Y) = bias
|
||||
|
@ -35,8 +53,8 @@ type Prism struct {
|
|||
pm *PrismMap
|
||||
}
|
||||
|
||||
func (p *Prism) Draw(screen *ebiten.Image, tf *Transform) {
|
||||
screen.DrawImage(p.pm.Sheet.SubImage(p.Cell), &tf.Opts)
|
||||
func (p *Prism) Draw(screen *ebiten.Image, opts *ebiten.DrawImageOptions) {
|
||||
screen.DrawImage(p.pm.Sheet.SubImage(p.Cell), opts)
|
||||
}
|
||||
|
||||
func (p *Prism) DrawOrder() (int, int) {
|
||||
|
|
Loading…
Reference in a new issue