/kamera

Camera package for Ebitengine v2

Primary LanguageGoCreative Commons Zero v1.0 UniversalCC0-1.0

GoDoc

Kamera

Camera package for Ebitengine.

import "github.com/setanarut/kamera/v2"

Features

  • Camera shake effect with fastnoise library noise types.
  • Lerp motion
  • Rotate/Zoom

Example

Run example on your local machine

go run github.com/setanarut/kamera/v2/examples/demo@latest

Usage

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.