Documentation ¶
Overview ¶
Package camera provides a simple camera system for use with ebiten
Index ¶
- type Camera
- func (c *Camera) Blit(screen *ebiten.Image)
- func (c *Camera) GetCursorCoords() (float64, float64)
- func (c *Camera) GetRotation(ops *ebiten.DrawImageOptions, rot, originX, originY float64) *ebiten.DrawImageOptions
- func (c *Camera) GetScale(ops *ebiten.DrawImageOptions, scaleX, scaleY float64) *ebiten.DrawImageOptions
- func (c *Camera) GetScreenCoords(x, y float64) (float64, float64)
- func (c *Camera) GetSkew(ops *ebiten.DrawImageOptions, skewX, skewY float64) *ebiten.DrawImageOptions
- func (c *Camera) GetTranslation(ops *ebiten.DrawImageOptions, x, y float64) *ebiten.DrawImageOptions
- func (c *Camera) GetWorldCoords(x, y float64) (float64, float64)
- func (c *Camera) MovePosition(x, y float64) *Camera
- func (c *Camera) Resize(w, h int) *Camera
- func (c *Camera) Rotate(phi float64) *Camera
- func (c *Camera) SetPosition(x, y float64) *Camera
- func (c *Camera) SetRotation(rot float64) *Camera
- func (c *Camera) SetZoom(zoom float64) *Camera
- func (c *Camera) Zoom(mul float64) *Camera
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Camera ¶
Camera can look at positions, zoom and rotate.
func (*Camera) Blit ¶
func (c *Camera) Blit(screen *ebiten.Image)
Blit draws the camera's surface to the screen and applies zoom
func (*Camera) GetCursorCoords ¶
GetCursorCoords converts cursor/screen coords into world coords
func (*Camera) GetRotation ¶
func (c *Camera) GetRotation(ops *ebiten.DrawImageOptions, rot, originX, originY float64) *ebiten.DrawImageOptions
GetRotation alters the provided *ebiten.DrawImageOptions' rotation using the provided originX and originY args
func (*Camera) GetScale ¶
func (c *Camera) GetScale(ops *ebiten.DrawImageOptions, scaleX, scaleY float64) *ebiten.DrawImageOptions
GetScale alters the provided *ebiten.DrawImageOptions' scale
func (*Camera) GetScreenCoords ¶
GetScreenCoords converts world coords into screen coords
func (*Camera) GetSkew ¶
func (c *Camera) GetSkew(ops *ebiten.DrawImageOptions, skewX, skewY float64) *ebiten.DrawImageOptions
GetSkew alters the provided *ebiten.DrawImageOptions' skew
func (*Camera) GetTranslation ¶
func (c *Camera) GetTranslation(ops *ebiten.DrawImageOptions, x, y float64) *ebiten.DrawImageOptions
GetTranslation alters the provided *ebiten.DrawImageOptions' translation based on the given x,y offset and the camera's position
func (*Camera) GetWorldCoords ¶
GetWorldCoords converts screen coords into world coords
func (*Camera) MovePosition ¶
MovePosition moves the Camera by x and y. Use SetPosition if you want to set the position
func (*Camera) SetPosition ¶
SetPosition looks at a position
func (*Camera) SetRotation ¶
SetRotation sets the rotation to rot