Documentation ¶
Index ¶
- Variables
- func BaseRender(JsonResultData ChunData, ctx *rei.Ctx) image.Image
- func BreakWords(getSongName string, breakerCount float64) string
- func ChunRender(ctx *rei.Ctx, israw bool)
- func DownloadImage(url string) (image.Image, error)
- func DrawBorderString(page *gg.Context, s string, size int, x float64, y float64, ax float64, ...)
- func GetCover(id string) (image.Image, error)
- func LevelIndexCount(count int) string
- func LoadFontFace(filePath string, size float64) font.Face
- func QueryChunDataFromUserName(userName string) (playerdata []byte, err error)
- func RenderCardChun(data UserDataInner, renderCount int) image.Image
- func Resize(image image.Image, w int, h int) image.Image
- func SaveImage(img image.Image, path string)
- type ChunData
- type DivingFishB50
- type UserDataInner
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Root = engine.DataFolder() Texture = engine.DataFolder() + "texture/" )
Functions ¶
func BreakWords ¶
BreakWords Reduce the length of strings, if out of range, use ".." instead.
func ChunRender ¶
func DownloadImage ¶
DownloadImage Simple Downloader.
func DrawBorderString ¶
func DrawBorderString(page *gg.Context, s string, size int, x float64, y float64, ax float64, ay float64, inlineRGB color.Color, outlineRGB color.Color)
DrawBorderString GG Package Not support The string render, so I write this (^^)
func LevelIndexCount ¶
func LoadFontFace ¶
LoadFontFace load font face once before running, to work it quickly and save memory.
func QueryChunDataFromUserName ¶
QueryChunDataFromUserName Query Chun Data.
func RenderCardChun ¶
func RenderCardChun(data UserDataInner, renderCount int) image.Image
Types ¶
type ChunData ¶
type ChunData struct { Nickname string `json:"nickname"` Rating float64 `json:"rating"` Records struct { B30 []struct { Cid int `json:"cid"` Ds float64 `json:"ds"` Fc string `json:"fc"` Level string `json:"level"` LevelIndex int `json:"level_index"` LevelLabel string `json:"level_label"` Mid int `json:"mid"` Ra float64 `json:"ra"` Score int `json:"score"` Title string `json:"title"` } `json:"b30"` R10 []struct { Cid int `json:"cid"` Ds float64 `json:"ds"` Fc string `json:"fc"` Level string `json:"level"` LevelIndex int `json:"level_index"` LevelLabel string `json:"level_label"` Mid int `json:"mid"` Ra float64 `json:"ra"` Score int `json:"score"` Title string `json:"title"` } `json:"r10"` } `json:"records"` Username string `json:"username"` }
ChunData Struct.
type DivingFishB50 ¶
type UserDataInner ¶
type UserDataInner []struct { Cid int `json:"cid"` Ds float64 `json:"ds"` Fc string `json:"fc"` Level string `json:"level"` LevelIndex int `json:"level_index"` LevelLabel string `json:"level_label"` Mid int `json:"mid"` Ra float64 `json:"ra"` Score int `json:"score"` Title string `json:"title"` }
UserDataInner CardBase
Click to show internal directories.
Click to hide internal directories.