Merge branch 'main' of ssh://100.127.2.114:3022/josh/gurgle
This commit is contained in:
commit
1f689ceae0
1 changed files with 2 additions and 2 deletions
|
@ -31,7 +31,7 @@ func (c *Camera) Draw(screen *ebiten.Image, opts ebiten.DrawImageOptions) {
|
||||||
zoom = c.zoomBound
|
zoom = c.zoomBound
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the configured centre still puts the camera out of bounds, move it.
|
// If the configured centre puts the camera out of bounds, move it.
|
||||||
centre := c.Centre
|
centre := c.Centre
|
||||||
// Camera frame currently Rectangle{ centre ± (screen/(2*zoom)) }.
|
// Camera frame currently Rectangle{ centre ± (screen/(2*zoom)) }.
|
||||||
sw2, sh2 := float64(c.game.ScreenWidth/2), float64(c.game.ScreenHeight/2)
|
sw2, sh2 := float64(c.game.ScreenWidth/2), float64(c.game.ScreenHeight/2)
|
||||||
|
@ -50,7 +50,7 @@ func (c *Camera) Draw(screen *ebiten.Image, opts ebiten.DrawImageOptions) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply camera controls to geom.
|
// Apply camera controls to geom.
|
||||||
// 1. Move c.Centre to the origin
|
// 1. Move centre to the origin
|
||||||
opts.GeoM.Translate(-float64(centre.X), -float64(centre.Y))
|
opts.GeoM.Translate(-float64(centre.X), -float64(centre.Y))
|
||||||
// 2. Zoom and rotate
|
// 2. Zoom and rotate
|
||||||
opts.GeoM.Scale(zoom, zoom)
|
opts.GeoM.Scale(zoom, zoom)
|
||||||
|
|
Loading…
Reference in a new issue