config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const AssetsPrefix = "/assets/"
View Source
const TextAlignCenter = "center"

Variables

View Source
var CurrentDir string
View Source
var ImgTempDir string

Functions

This section is empty.

Types

type Block

type Block struct {
	X               int    `json:"x"`
	Y               int    `json:"y"`
	Width           int    `json:"width"`
	Height          int    `json:"height"`
	ZIndex          int    `json:"zIndex"`
	BackgroundColor string `json:"backgroundColor"`
	BorderColor     string `json:"borderColor"`
}

func (Block) Draw

func (block Block) Draw(dc *gg.Context)

func (Block) GetZIndex

func (block Block) GetZIndex() int

type DrawQueue

type DrawQueue map[int][]Drawable

type Drawable

type Drawable interface {
	GetZIndex() int
	Draw(dc *gg.Context)
}

type Image

type Image struct {
	X            int    `json:"x"`
	Y            int    `json:"y"`
	Url          string `json:"url"`
	Width        int    `json:"width"`
	Height       int    `json:"height"`
	BorderRadius int    `json:"borderRadius"`
	ZIndex       int    `json:"zIndex"`
}

func (Image) Ax

func (img Image) Ax() float64

func (Image) Ay

func (img Image) Ay() float64

func (Image) Draw

func (img Image) Draw(dc *gg.Context)

func (Image) GetZIndex

func (img Image) GetZIndex() int

type Line

type Line struct {
	StartX float64 `json:"startX"`
	StartY float64 `json:"startY"`
	EndX   float64 `json:"endX"`
	EndY   float64 `json:"endY"`
	ZIndex int     `json:"zIndex"`
	Width  float64 `json:"width"`
	Color  string  `json:"color"`
}

func (Line) Draw

func (line Line) Draw(dc *gg.Context)

func (Line) GetZIndex

func (line Line) GetZIndex() int

type Poster

type Poster struct {
	Width           float64 `json:"width"`
	Height          float64 `json:"height"`
	BackgroundColor string  `json:"backgroundColor"`
	Texts           []Text  `json:"texts"`
	Images          []Image `json:"images"`
	Blocks          []Block `json:"blocks"`
	Lines           []Line  `json:"lines"`
	// contains filtered or unexported fields
}

func (*Poster) Draw

func (poster *Poster) Draw(posterFileName string) error

type Text

type Text struct {
	X          int     `json:"x"`
	Y          int     `json:"y"`
	Text       string  `json:"text"`
	Width      float64 `json:"width"`
	FontSize   int     `json:"fontSize"`
	Color      string  `json:"color"`
	Opacity    int     `json:"opacity"`
	ZIndex     int     `json:"zIndex"`
	LineHeight int     `json:"lineHeight"`
	TextAlign  string  `json:"textAlign"`
}

func (Text) Draw

func (text Text) Draw(dc *gg.Context)

func (*Text) DrawX

func (t *Text) DrawX(w float64) float64

func (Text) GetZIndex

func (text Text) GetZIndex() int

Jump to

Keyboard shortcuts

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