chun

package
v0.0.0-...-2bb5782 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Root    = utils.ResLoader("chun")
	Texture = utils.ResLoader("chun") + "texture/"
)

Functions

func BaseRender

func BaseRender(JsonResultData ChunData, ctx *nano.Ctx) image.Image

func GetCover

func GetCover(id string) (image.Image, error)

GetCover Careful The nil data

func LevelIndexCount

func LevelIndexCount(count int) string

func QueryChunDataFromUserName

func QueryChunDataFromUserName(userName string) (playerdata []byte, err error)

QueryChunDataFromUserName Query Chun Data.

func RenderCardChun

func RenderCardChun(data UserDataInner, renderCount int) image.Image

func Resize

func Resize(image image.Image, w int, h int) image.Image

Resize Image width height

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 DivingFishB50 struct {
	Username string `json:"username"`
	B50      bool   `json:"b50"`
}

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

Jump to

Keyboard shortcuts

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