gdi

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawLines

func DrawLines(target *ebiten.Image, f Font, x, y int, width int, text string, clr color.Color, mode int)

DrawLines draws multiline text.

func DrawText

func DrawText(target *ebiten.Image, f Font, x, y int, text string, clr color.Color, mode int)

DrawText draws input text.

func Touching

func Touching(sp1 *Sprite, pt1 image.Point, sp2 *Sprite, pt2 image.Point) bool

Touching func.

func TouchingColor

func TouchingColor(sp1 *Sprite, pt1 image.Point, sp2 *Sprite, pt2 image.Point, clr color.RGBA) bool

TouchingColor func.

func TouchingPoint

func TouchingPoint(sp *Sprite, pt image.Point, x, y int) bool

TouchingPoint func.

func TouchingRect

func TouchingRect(sp *Sprite, pt image.Point, x1, y1, x2, y2 int) bool

TouchingRect func.

func TouchingRectangle

func TouchingRectangle(sp1 *Sprite, pt1 image.Point, rect2 image.Rectangle) bool

TouchingRectangle func.

Types

type Canvas

type Canvas struct {
	*svgo.SVG
	Target *ebiten.Image
}

Canvas represents a gdi object.

func Start

func Start(target *ebiten.Image) Canvas

Start creates a canvas object.

func (Canvas) End

func (p Canvas) End()

End draws canvas data onto the target image.

type Font

type Font = font.Face

type Image

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

func NewImageFrom

func NewImageFrom(img image.Image) Image

func NewImageSize

func NewImageSize(width, height int) Image

func (Image) Bounds

func (i Image) Bounds() image.Rectangle

func (Image) Ebiten

func (i Image) Ebiten() *ebiten.Image

func (Image) IsValid

func (i Image) IsValid() bool

func (Image) Origin

func (i Image) Origin() *image.RGBA

func (Image) Size

func (i Image) Size() (width, height int)

func (Image) SubImage

func (i Image) SubImage(rect image.Rectangle) Image

type SVG

type SVG struct {
	*svgo.SVG
}

func NewSVG

func NewSVG(cx, cy int) SVG

func (SVG) ToImage

func (p SVG) ToImage() (image.Image, error)

type Sprite

type Sprite image.RGBA

Sprite type.

func NewSprite

func NewSprite(screen *ebiten.Image, rect image.Rectangle) *Sprite

NewSprite func.

func NewSpriteFromRect

func NewSpriteFromRect(x1, y1, x2, y2 int) *Sprite

NewSpriteFromRect func.

func NewSpriteFromRectangle

func NewSpriteFromRectangle(rect image.Rectangle) *Sprite

NewSpriteFromRectangle func.

func NewSpriteFromScreen

func NewSpriteFromScreen(screen *ebiten.Image) *Sprite

NewSpriteFromScreen func.

func (*Sprite) GetTrackPos

func (p *Sprite) GetTrackPos() image.Point

GetTrackPos func.

func (*Sprite) Image

func (p *Sprite) Image() *image.RGBA

Image func.

type TextRender

type TextRender struct {
	*text.Render
}

TextRender represents a text rendering engine.

func NewTextRender

func NewTextRender(face Font, width int, dy int) TextRender

NewTextRender creates a text rendering engine.

func (TextRender) Draw

func (p TextRender) Draw(target *ebiten.Image, x, y int, clr color.Color, mode int)

Draw draws rendered text.

func (TextRender) Size

func (p TextRender) Size() (int, int)

Size returns width and height of rendered text.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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