pecel

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 3 Imported by: 0

README

Pecel

Pecel is extensions for Ebitengine.

Features

  • SceneManager
  • Scene
  • Camera
  • Vector2
  • Transform

Examples

Visit this page

Installation

go get github.com/andreecy/pecel

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Camera

type Camera struct {
	Width, Height float64
	Viewport      Vec2
	Position      Vec2
	Rotation      int
	ZoomFactor    int
}

func CreateCamera

func CreateCamera(width, height float64) *Camera

func (*Camera) Render

func (c *Camera) Render(world, screen *ebiten.Image)

func (*Camera) Reset

func (c *Camera) Reset()

func (*Camera) ScreenToWorld

func (c *Camera) ScreenToWorld(pos Vec2) Vec2

func (*Camera) String

func (c *Camera) String() string

type GameState

type GameState struct {
	SceneManager *SceneManager
}

type Scene

type Scene interface {
	Update(state *GameState) error
	Draw(screen *ebiten.Image)
}

type SceneManager

type SceneManager struct {
	// contains filtered or unexported fields
}

func (*SceneManager) Draw

func (s *SceneManager) Draw(r *ebiten.Image)

draw current active scene

func (*SceneManager) LoadScene

func (s *SceneManager) LoadScene(scene Scene)

load a scene

func (*SceneManager) Update

func (s *SceneManager) Update() error

do update current active scene

type Transform

type Transform struct {
	Position Vec2
	Scale    Vec2
	Rotation int
}

type Vec2

type Vec2 struct {
	X float64
	Y float64
}

func NewVec2

func NewVec2(x, y int) Vec2

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL