loader

package
v1.158.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package loader はゲームリソースの読み込み機能を提供する。

主な責務:

  • TOMLファイルからのメタデータ読み込み
  • フォント、スプライトシート、Rawデータの読み込み

使い分け:

  • loader: 純粋なリソース読み込み処理
  • resources: ゲーム固有のリソース管理

使用例:

rw, err := loader.LoadRaws()
sprites, err := loader.LoadSpriteSheets(rw)
fonts, err := loader.LoadFonts()

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadFonts added in v1.158.2

func LoadFonts() (map[string]resources.Font, error)

LoadFonts はフォントリソースを読み込む

func LoadRaws added in v1.158.2

func LoadRaws() (raw.Master, error)

LoadRaws はRawデータを読み込む

func LoadSpriteSheetFromAseprite

func LoadSpriteSheetFromAseprite(jsonPath string) (components.SpriteSheet, error)

LoadSpriteSheetFromAseprite は Aseprite JSON フォーマットからスプライトシートを読み込む

func LoadSpriteSheets added in v1.158.2

func LoadSpriteSheets(rawMaster raw.Master) (map[string]components.SpriteSheet, error)

LoadSpriteSheets はraw.MasterのSpriteSheet定義に基づいてスプライトシートを読み込む

Types

type AsepriteFrame

type AsepriteFrame struct {
	Filename         string       `json:"filename"`
	Frame            AsepriteRect `json:"frame"`
	Rotated          bool         `json:"rotated"`
	Trimmed          bool         `json:"trimmed"`
	SpriteSourceSize AsepriteRect `json:"spriteSourceSize"`
	SourceSize       AsepriteSize `json:"sourceSize"`
	Duration         int          `json:"duration"`
}

AsepriteFrame は1つのスプライトフレーム情報

type AsepriteJSON

type AsepriteJSON struct {
	Frames []AsepriteFrame `json:"frames"`
	Meta   AsepriteMeta    `json:"meta"`
}

AsepriteJSON は Aseprite が生成する JSON スプライトシートフォーマット

type AsepriteMeta

type AsepriteMeta struct {
	App     string       `json:"app"`
	Version string       `json:"version"`
	Image   string       `json:"image"`
	Format  string       `json:"format"`
	Size    AsepriteSize `json:"size"`
	Scale   string       `json:"scale"`
}

AsepriteMeta はメタデータ

type AsepriteRect

type AsepriteRect struct {
	X int `json:"x"`
	Y int `json:"y"`
	W int `json:"w"`
	H int `json:"h"`
}

AsepriteRect は矩形の位置とサイズ

type AsepriteSize

type AsepriteSize struct {
	W int `json:"w"`
	H int `json:"h"`
}

AsepriteSize はサイズ

Jump to

Keyboard shortcuts

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