Documentation
¶
Index ¶
- Variables
- func CoveyImage(image image.Image, startX float64, startY float64, height float64, ...)
- func GetFontFace(fontSize float64, dpi float64) (font.Face, error)
- func Inventory(name string, inv image.Image, skin image.Image) (image.Image, error)
- func LoadFont(path string) error
- func NewImageWithBackground(width float64, height float64, color color.Color, face font.Face) *gg.Context
- func PrintChar(startX float64, startY float64, c *component.Component, ctx *gg.Context, ...) (float64, float64)
- func WithFontFace(fontSize float64, dpi float64, invoke func(face font.Face)) error
- type Assets
- type FontOptions
- type Skin
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// 背包大小:352 x 332
InvWidth, InvHeight = 352, 332
// 人物框大小:100 x 140
PlayerWidth, PlayerHeight = 100, 140
// 人物框起点 (52, 16)
PlayerStartX, PlayerStartY = 52, 16
BackgroundColor = &color.RGBA{R: 184, G: 184, B: 184, A: 255}
)
View Source
var Font *opentype.Font
Functions ¶
func CoveyImage ¶
CoveyImage draw one image onto another with resize
func NewImageWithBackground ¶
func NewImageWithBackground(width float64, height float64, color color.Color, face font.Face) *gg.Context
NewImageWithBackground create image with background color
Types ¶
type FontOptions ¶
type FontOptions struct { // ShadowOffset 阴影偏移 ShadowOffset float64 // BoldOffset 加粗偏移 BoldOffset float64 OffsetY float64 }
func DefaultFontOptions ¶
func DefaultFontOptions(fontSize int, offsetY float64) *FontOptions
Click to show internal directories.
Click to hide internal directories.