Documentation
¶
Index ¶
- type Camera
- func (camera *Camera) Draw(draw func(l, t, w, h float32))
- func (camera *Camera) GetVisible() (l, t, w, h float32)
- func (camera *Camera) LookAt(x, y float32)
- func (camera *Camera) Move(dx, dy float32)
- func (camera *Camera) Rotate(phi float32)
- func (camera *Camera) RotateTo(phi float32)
- func (camera *Camera) Shake(intensity float32)
- func (camera *Camera) Update(dt float32)
- func (camera *Camera) Zoom(mul float32)
- func (camera *Camera) ZoomTo(zoom float32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Camera ¶
type Camera struct {
// contains filtered or unexported fields
}
Camera is the main object to handle all camera operations
func (*Camera) Draw ¶
Draw is the function to scope all your draw calls to be transformed to the camera veiw. Pass in a function that takes the extents of the camera to be called for drawing the scene within the camera view.
func (*Camera) GetVisible ¶
GetVisible returns the extents of the visible area that the camera can see. The top left x, y and the width and height of the frame.
func (*Camera) Rotate ¶
Rotate will rotate the view of the camera around the center coords that the camera is looking at
func (*Camera) Shake ¶
Shake will cause the camera to jump around making it seem like the whole view is shaking. If you want to use this function then you will need to call Update in your global update function.
func (*Camera) Update ¶
Update will update the shake functionality. This method is only needed if Shake is used.