Camera package for Ebitengine.
import "github.com/setanarut/kamera/v2"
- Camera shake effect with fastnoise library noise types.
- Lerp motion
- Rotate/Zoom
Run example on your local machine
go run github.com/setanarut/kamera/v2/examples/demo@latest
A pseudo code:
func (g *Game) Update() error {
g.MainCamera.LookAt(player.X, player.Y)
// Apply all world-space `playerDrawImageOptions.GeoM{}` transform here
}
func (g *Game) Draw(screen *ebiten.Image) {
g.MainCamera.Draw(playerImage, playerDrawImageOptions, screen)
}
See the ./examples/demo/main.go for a real working code example.