data

package
v0.0.0-...-9fc0885 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-2.0 Imports: 26 Imported by: 0

Documentation

Overview

data package contains functions for loading graphic and audio data.

data package contains functions for loading graphic and audio data.

Index

Constants

View Source
const (
	HUDDir     = "hud"
	HUDFileExt = ".xml"
	ErrorIcon  = "unknown.png"
)

Variables

View Source
var (
	EffectGraphicsFileExt = ".graphic"
)

Functions

func DefaultAvatarData

func DefaultAvatarData(char *character.Character) res.AvatarData

DefaultAvatarData creates default avatar data for specified character.

func DefaultObjectGraphicData

func DefaultObjectGraphicData(char *character.Character) res.ObjectGraphicData

DefaultObjectGraphicData returns default object graphic data.

func DirFiles

func DirFiles(path, pattern string) ([]string, error)

DirFiles returns names of all files matching specified file name pattern in directory with specified path.

func ExportAvatars

func ExportAvatars(path string, avatars ...res.AvatarData) error

ExportAvatars exports specified avatars to the new avatar data file with specified path.

func ExportHUD

func ExportHUD(hud res.HUDData, path string) error

ExportHUD exports HUD data to file with specified name in directory with specified path.

func ImportAvatars

func ImportAvatars(path string) ([]res.AvatarData, error)

ImportAvatars imports all avatars data for specified characters from avatar file with specified path.

func ImportAvatarsDir

func ImportAvatarsDir(dirPath string) ([]res.AvatarData, error)

ImportAvatarsDir imports all avatars data from avatars files in directory with specified path.

func ImportEffectsGraphics

func ImportEffectsGraphics(path string) ([]res.EffectGraphicData, error)

ImportEffectsGraphics imports all effects graphics from data file with specified path.

func ImportEffectsGraphicsDir

func ImportEffectsGraphicsDir(path string) ([]res.EffectGraphicData, error)

ImportEffectsGraphicsDir imports all files with effects graphics from directory with specified path.

func ImportHUD

func ImportHUD(path string) (res.HUDData, error)

ImportHUD imports HUD data file from specified path.

func ImportItemsGraphics

func ImportItemsGraphics(path string) ([]res.ItemGraphicData, error)

ImportItemsGraphics imports all items grpahics from data file with specified path.

func ImportItemsGraphicsDir

func ImportItemsGraphicsDir(dirPath string) ([]res.ItemGraphicData, error)

ImportItemsGraphicsDir imports all files with items graphics from directory with specified path.

func ImportObjectsGraphics

func ImportObjectsGraphics(path string) ([]res.ObjectGraphicData, error)

ImportObjectsGraphics imports all objects graphic from base file with specified path.

func ImportObjectsGraphicsDir

func ImportObjectsGraphicsDir(dirPath string) ([]res.ObjectGraphicData, error)

ImportObjectsGraphicsDir imports all files with objects graphics from directory with specified path.

func ImportSkillsGraphics

func ImportSkillsGraphics(path string) ([]res.SkillGraphicData, error)

ImportSkillsGraphics imports all skills graphics from data file with specified path.

func ImportSkillsGraphicsDir

func ImportSkillsGraphicsDir(path string) ([]res.SkillGraphicData, error)

ImportSkillsGraphicsDir imports all files with skills graphics from directory with specified path.

func LoadChapterData

func LoadChapterData(path string) error

LoadChapterData loads all chapter graphical data from specified path.

func LoadModuleData

func LoadModuleData(path string) (err error)

LoadModuleData loads graphic data from specified path. Should be called by GUI before creating any in-game elements.

func Map

func Map(areaDir string) (*tmx.Map, error)

Map loads TMX map from file with specified directory and name.

func Pictures

func Pictures(path string) (map[string]pixel.Picture, error)

Pictures loads all pictures from specified path and returns map with file names as keys and pictures as values.

func Script

func Script(path string) (*ash.Script, error)

Script parses file with specified path to Ash scirpt.

func ScriptsDir

func ScriptsDir(path string) ([]*ash.Script, error)

ScriptsDir returns all scripts from directory with specified path.

Types

This section is empty.

Directories

Path Synopsis
res
Package with pre-loaded game resources like item graphic data, textures, etc.
Package with pre-loaded game resources like item graphic data, textures, etc.
audio
Package with pre-loaded audio buffers.
Package with pre-loaded audio buffers.
graphic
Package with pre-loaded game graphics.
Package with pre-loaded game graphics.

Jump to

Keyboard shortcuts

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