strategy_board

package module
v0.0.0-...-93fcaaf Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: AGPL-3.0 Imports: 21 Imported by: 0

README

Golang FF14 Strategy Board Viewer

Golang library for parsing Final Fantasy XIV strategy board data and rendering it as an image.

This is more or less a Golang port of this Typescript strategy board viewer: https://github.com/Ennea/ffxiv-strategy-board-viewer

CLI Usage

Basic Usage:

echo "STRATEGY BOARD SHARE CODE" | go run cli/main.go > out.png

The included CLI takes a strategy board share code through STDIN and will output a PNG image through STDOUT.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MissingInput              = errors.New("missing strategy board input data")
	ParseError                = errors.New("parse error: invalid strategy board")
	SectionParseError         = errors.New("parse error: read unexpected section number")
	ObjectCountParseError     = errors.New("parse error: unexpected number of objects in section")
	DrawUnexpectedObjectError = errors.New("draw error: unexpected object type")
	AssetNotFound             = errors.New("asset not found")
)

Functions

func Draw

func Draw(board Board) (*gg.Context, error)

func Unpack

func Unpack(input string) ([]byte, error)

Unpack board share code to raw bytes.

Types

type Asset

type Asset struct {
	ID    int         `json:"id"`
	Name  string      `json:"name"`
	Scale float64     `json:"scale"`
	Image image.Image `json:"-"`
}

type Board

type Board struct {
	Name       string   `json:"name"`
	Background int      `json:"background"`
	Objects    []Object `json:"object"`
}

func Load

func Load(input string) (Board, error)

func Parse

func Parse(data []byte) (Board, error)

Parse strategy board data

func (Board) Assets

func (b Board) Assets() ([]Asset, error)

Load assets needed by given strategy board

type BoardObjectFlag

type BoardObjectFlag uint8
const (
	Visible BoardObjectFlag = 1 << iota
	FlipHorizontal
	FlipVertical
	Locked
)

type Object

type Object struct {
	TypeID         int         `json:"type_id"`
	Text           string      `json:"text"`
	Visible        bool        `json:"visible"`
	FlipHorizontal bool        `json:"flip_horizontal"`
	FlipVertical   bool        `json:"flip_vertical"`
	X              int         `json:"x"`
	Y              int         `json:"y"`
	Angle          int         `json:"angle"`
	Color          color.NRGBA `json:"color"`
	Scale          int         `json:"scale"`
	Params         []int       `json:"params"`
}

func (Object) ScaleFactor

func (o Object) ScaleFactor(factor float64) (float64, float64)

Directories

Path Synopsis
tools
asset_compiler command

Jump to

Keyboard shortcuts

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