Documentation ¶
Overview ¶
kamera is a camera package for ebitengine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Camera ¶
type Camera struct {
/* (X, Y) is the top left corner of the camera viewport.
Use the `Camera.LookAt()` function to align the center of the camera to the target.
(W, H) is the width and height of the camera viewport.
it's recommended that the size is the same as the game and window size. */
X, Y, W, H, Rotation, ZoomFactor float64
// contains filtered or unexported fields
}
Camera object
func (*Camera) Render ¶
func (cam *Camera) Render(worldObject *ebiten.Image, worldObjectOps *ebiten.DrawImageOptions, screen *ebiten.Image)
Render applies the Camera's geometric transformation then draws the object on the screen with drawing options.
func (*Camera) ScreenToWorld ¶
ScreenToWorld converts screen-space coordinates to world-space
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
topdown
| Key | Action | | ----- | -------------------------- | | WASD | Move camera | | E | Zoom in | | Q | Zoom out | | Space | Reset camera | | Key 1 | look at the random object.
|
| Key | Action | | ----- | -------------------------- | | WASD | Move camera | | E | Zoom in | | Q | Zoom out | | Space | Reset camera | | Key 1 | look at the random object. |
Click to show internal directories.
Click to hide internal directories.