draw

package
v0.0.0-...-6fbc30b Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Cover

func Cover(top image.Image, bg image.Image, x0 int, y0 int, offsetX int, offsetY int) *image.RGBA

Cover 能将一张图覆盖到另一张的指定位置

func CoveyImage

func CoveyImage(image image.Image, startX float64, startY float64, height float64, ctx *gg.Context)

CoveyImage draw one image onto another with resize

func Cut

func Cut(fileName string, x0 int, y0 int, x1 int, y1 int) (image.Image, error)

func GetFontFace

func GetFontFace(fontSize float64, dpi float64) (font.Face, error)

func Inventory

func Inventory(invPath string, skinPath string, scale int) (image.Image, error)

func LoadFont

func LoadFont(path string) error

func NewImageWithBackground

func NewImageWithBackground(width float64, height float64, color color.Color, face font.Face) *gg.Context

NewImageWithBackground create image with background color

func PrintChar

func PrintChar(startX float64, startY float64, c *component.Component, ctx *gg.Context, options *Options) (float64, float64)

PrintChar print chars to image with options

func Resize

func Resize(img image.Image, width int, height int) image.Image

Resize 等比例变化

func WithFontFace

func WithFontFace(fontSize float64, dpi float64, invoke func(face font.Face)) error

Types

type Assets

type Assets struct {
	Name string
	Path string
	Size int64
}

type Options

type Options struct {
	ShadowOffset float64
	BoldOffset   float64
	OffsetY      float64
}

type Skin

type Skin struct {
	File *image.NRGBA
	Slim bool
}

func NewSkin

func NewSkin(filePath string, slim bool) (*Skin, error)

func (*Skin) GetFace

func (s *Skin) GetFace() *image.NRGBA

GetFace 1 scale for 8 px

Jump to

Keyboard shortcuts

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