draw

package
v0.0.0-...-94e82ac Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compositor

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

func NewCompositor

func NewCompositor(rect image.Rectangle, numLayers int) *Compositor

func (*Compositor) Bounds

func (c *Compositor) Bounds() image.Rectangle

func (*Compositor) Clear

func (c *Compositor) Clear()

func (*Compositor) Draw

func (c *Compositor) Draw(screen *ebiten.Image, opts *ebiten.DrawImageOptions)

type ImageNode

type ImageNode struct {
	Image *ebiten.Image
}

func (*ImageNode) Draw

func (n *ImageNode) Draw(compositor *Compositor, opts *ebiten.DrawImageOptions)

type Node

type Node interface {
	Draw(compositor *Compositor, opts *ebiten.DrawImageOptions)
}

func ImageWithAnimation

func ImageWithAnimation(img *ebiten.Image, animation *pngsheet.Animation, t int) Node

func ImageWithFrame

func ImageWithFrame(img *ebiten.Image, frame *pngsheet.Frame) Node

func ImageWithOrigin

func ImageWithOrigin(img *ebiten.Image, origin image.Point) Node

type OptionsNode

type OptionsNode struct {
	Opts     ebiten.DrawImageOptions
	Layer    int
	Children []Node
}

func (*OptionsNode) Draw

func (n *OptionsNode) Draw(compositor *Compositor, opts *ebiten.DrawImageOptions)

type TextAnchor

type TextAnchor int
const (
	TextAnchorLeft   TextAnchor = 0b0000
	TextAnchorCenter TextAnchor = 0b0001
	TextAnchorRight  TextAnchor = 0b0010
	TextAnchorTop    TextAnchor = 0b1000
	TextAnchorMiddle TextAnchor = 0b0100
	TextAnchorBottom TextAnchor = 0b0000
)

type TextNode

type TextNode struct {
	Anchor TextAnchor
	Face   font.Face
	Text   string
}

func (*TextNode) Draw

func (n *TextNode) Draw(compositor *Compositor, opts *ebiten.DrawImageOptions)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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