Documentation ¶
Overview ¶
Package ark provides functions to retrieve resources of the game Arknights. This package only do fetching, unzipping, unpacking and decrypting resources. To do other works, such as parsing BSON or JSON tables or processing graphics assets, use the subpackages.
tools/extractor is required.
Index ¶
- Constants
- Variables
- func LanguageCodeUnderscore(s Server) string
- type CharacterArt
- type CharacterArtBodyVariation
- type CharacterArtFaceVariation
- type CharacterArtImage
- type CharacterSprite
- type CharacterSpriteHub
- type CharacterSpriteHubGroup
- type PictureArt
- type PictureArtImage
- type Processor
- type Scanner
- type Server
- type Version
Constants ¶
const PictureArtPath = "assets/torappu/dynamicassets/avg"
Variables ¶
Functions ¶
func LanguageCodeUnderscore ¶
Types ¶
type CharacterArt ¶
type CharacterArt struct { ID string Kind string BodyVariations []CharacterArtBodyVariation }
func (*CharacterArt) BodyPath ¶
func (a *CharacterArt) BodyPath(bodyNum int) string
func (*CharacterArt) BodyPathAlpha ¶
func (a *CharacterArt) BodyPathAlpha(bodyNum int) string
func (*CharacterArt) FacePathAlpha ¶
func (a *CharacterArt) FacePathAlpha(bodyNum int, faceNum int) string
type CharacterArtBodyVariation ¶
type CharacterArtBodyVariation struct { BodySprite string BodySpriteAlpha string FaceRectangle image.Rectangle FaceVariations []CharacterArtFaceVariation }
type CharacterArtImage ¶
type CharacterArtImage struct { Image image.Image Art *CharacterArt BodyNum int FaceNum int }
func (*CharacterArtImage) ID ¶
func (i *CharacterArtImage) ID() string
type CharacterSprite ¶
type CharacterSpriteHub ¶
type CharacterSpriteHub struct { Sprites []CharacterSprite `json:"sprites"` FacePos struct { X float64 `json:"x"` Y float64 `json:"y"` } `json:"FacePos"` FaceSize struct { X float64 `json:"x"` Y float64 `json:"y"` } `json:"FaceSize"` }
type CharacterSpriteHubGroup ¶
type CharacterSpriteHubGroup struct {
SpriteGroups []CharacterSpriteHub `json:"spriteGroups"`
}
type PictureArt ¶
func (*PictureArt) Path ¶
func (a *PictureArt) Path() string
type PictureArtImage ¶
type PictureArtImage struct { Image image.Image Art *PictureArt }
type Processor ¶
type Processor struct {
Root string
}
Processor provides functionalities for processing art. The term "process" here refers to merging color channel and alpha channel of arts together, merging faces variation and bodies of character arts together, etc.
func (*Processor) ProcessCharacterArt ¶
func (p *Processor) ProcessCharacterArt(art *CharacterArt) ([]CharacterArtImage, error)
ProcessCharacterArt process a character art.
Since picture arts are complicated, the process operation consists of:
- Decode all relevant images, including color channel and alpha channel of faces and bodies image.
- For each face or body, merge the alpha channels onto the color channels.
- For each face, merge it onto its corresponding body.
func (*Processor) ProcessPictureArt ¶
func (p *Processor) ProcessPictureArt(art *PictureArt) (*PictureArtImage, error)
ProcessPictureArt process the picture art.
Since picture arts are trivial and different from character arts, the only thing this method does is to read the art image and return it.
type Scanner ¶
type Scanner struct {
Root string
}
func (*Scanner) ScanCharacter ¶
func (scanner *Scanner) ScanCharacter(id string) (*CharacterArt, error)
func (*Scanner) ScanForCharacterArts ¶
func (scanner *Scanner) ScanForCharacterArts() ([]*CharacterArt, error)
func (*Scanner) ScanForPictureArts ¶
func (scanner *Scanner) ScanForPictureArts() ([]*PictureArt, error)
type Server ¶
type Server = string
Server represents different server of the game. E.g., CN and EN.
const ( // CnServer stands for China Server CnServer Server = "CN" // EnServer stands for English Server EnServer Server = "EN" // JpServer stands for Japan Server JpServer Server = "JP" // KrServer stands for Korea Server KrServer Server = "KR" // TwServer stands for Taiwan Server TwServer Server = "TW" )