Home

Awesome

GoDoc

Kamera

Camera package for Ebitengine.

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

Features

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)
 }
func (g *Game) Draw(screen *ebiten.Image) {
    // Apply all world-space `DrawImageOptions.GeoM` transformations before `Camera.Draw()`
    g.MainCamera.Draw(playerImage, playerDrawImageOptions, screen)
 }

See the ./examples/demo/main.go for a real working code example.