loader

package
v1.225.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

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

主な責務:

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

使い分け:

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

使用例:

rw, err := loader.LoadRaws()
sprites, err := loader.LoadSpriteSheets(rw)
uir, err := loader.LoadUIResources()

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadRaws added in v1.158.2

func LoadRaws() (oapi.Raws, error)

LoadRaws はRawデータを読み込む

func LoadSpriteSheetFromAseprite

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

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

func LoadSpriteSheets added in v1.158.2

func LoadSpriteSheets(raws oapi.Raws) (map[string]components.SpriteSheet, error)

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

func LoadUIResources added in v1.161.2

func LoadUIResources() (resources.UIResources, error)

LoadUIResources はフォントを読み込んで UI リソースを初期化する。 フォント読み込みと font source 構築をまとめて1つのロック下で行う。

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