Documentation
¶
Index ¶
- func QueueFunc(renderFunc func(screen *ebiten.Image, camera *Camera), layer int)
- func QueueRender(op *DrawOp, mode RenderMode, layer int)
- func RenderTo(screen *ebiten.Image, camera *Camera)
- type Camera
- func (c *Camera) Center() (float64, float64)
- func (c *Camera) GetCursorCoords() (float64, float64)
- func (c *Camera) GetScreenCoords(x, y float64) (float64, float64)
- 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) SetPosition(x, y float64) *Camera
- func (c *Camera) SetZoom(zoom float64) *Camera
- func (c *Camera) WorldMatrix(ops *ebiten.DrawImageOptions)
- func (c *Camera) Zoom(mul float64) *Camera
- type DrawOp
- func (d *DrawOp) CenterOrigin() *DrawOp
- func (d *DrawOp) Filter(filter ebiten.Filter) *DrawOp
- func (d *DrawOp) Mode(mode RenderMode) *DrawOp
- func (d *DrawOp) Origin(originX, originY float64) *DrawOp
- func (d *DrawOp) Position(posX, posY float64) *DrawOp
- func (d *DrawOp) Queue()
- func (d *DrawOp) Rotation(rotation float32) *DrawOp
- func (d *DrawOp) Scale(scale float64) *DrawOp
- func (d *DrawOp) Skew(skewX, skewY float64) *DrawOp
- type RenderMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QueueFunc ¶ added in v0.0.4
QueueFunc is used to queue an arbitrary screen aware function to run.
func QueueRender ¶ added in v0.0.4
func QueueRender(op *DrawOp, mode RenderMode, layer int)
QueueRender adds a draw operation to the render queue. The `mode` argument specifies whether the draw operation is executed on the world space layer or the canvas layer.
Types ¶
type Camera ¶
Camera can look at positions, zoom and rotate. The Camera implementation is a modified https://github.com/MelonFunction/ebiten-camera.
func (*Camera) Center ¶
Center returns the center point of the camera, based on its Width and Height.
func (*Camera) GetCursorCoords ¶
GetCursorCoords converts cursor/screen coords into world coords
func (*Camera) GetScreenCoords ¶
GetScreenCoords converts world coords into screen coords
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) WorldMatrix ¶
func (c *Camera) WorldMatrix(ops *ebiten.DrawImageOptions)
WorldMatrix modifies the `ops` parameter to be world relative.
type DrawOp ¶
type DrawOp struct {
// contains filtered or unexported fields
}
func Draw ¶
func Draw(image *ebiten.Image, mode RenderMode, layer int) *DrawOp
Draw returns a new DrawOp which can be used to customize how the image is rendered. By using Draw instead of manual ebiten drawing, you get automatic handling of rotations and sprite origins. DrawOp makes sure the draw operations are performed in the correct order. Call QueueRender() to draw onto the render pass.
func (*DrawOp) CenterOrigin ¶
CenterOrigin sets the origin of the sprite to its center.
func (*DrawOp) Mode ¶ added in v0.0.4
func (d *DrawOp) Mode(mode RenderMode) *DrawOp
func (*DrawOp) Queue ¶ added in v0.0.4
func (d *DrawOp) Queue()
Queue adds the draw op to the rendering queue.
type RenderMode ¶ added in v0.0.4
type RenderMode uint
RenderMode represents the type of rendering that will be done. RenderModeCanvas is used for screen space rendering. RenderModeWorld is used for world space rendering.
const ( RenderModeCanvas RenderMode = iota + 1 RenderModeWorld )