assets

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ColorState               = color.NRGBA{184, 152, 93, 200}
	ColorHeading             = color.NRGBA{200, 140, 100, 200}
	ColorTitle               = color.NRGBA{255, 255, 255, 200}
	ColorGameOver            = color.NRGBA{255, 52, 33, 200}
	ColorSelected            = color.NRGBA{152, 184, 93, 100}
	ColorHovered             = color.NRGBA{102, 134, 43, 50}
	ColorRoomDescription     = color.NRGBA{255, 255, 255, 200}
	ColorRoomCost            = color.NRGBA{255, 215, 0, 200}
	ColorStory               = color.NRGBA{182, 129, 129, 255}
	ColorDude                = color.NRGBA{160, 79, 201, 255}
	ColorGold                = color.NRGBA{255, 215, 0, 255}
	ColorBoss                = color.NRGBA{255, 255, 255, 255}
	ColorDudeHP              = color.NRGBA{200, 50, 50, 200}
	ColorDudeXP              = color.NRGBA{255, 255, 255, 200}
	ColorDudeTitle           = color.NRGBA{255, 255, 255, 200}
	ColorDudeDescription     = color.NRGBA{200, 200, 200, 255}
	ColorDudeCost            = color.NRGBA{255, 215, 0, 200}
	ColorDudeLevel           = color.NRGBA{255, 255, 255, 200}
	ColorDudeStrength        = color.NRGBA{200, 100, 100, 200}
	ColorDudeAgility         = color.NRGBA{200, 200, 100, 200}
	ColorDudeDefense         = color.NRGBA{200, 200, 200, 200}
	ColorDudeWisdom          = color.NRGBA{100, 200, 100, 200}
	ColorDudeConfidence      = color.NRGBA{200, 100, 200, 200}
	ColorDudeLuck            = color.NRGBA{100, 100, 200, 200}
	ColorItemDescription     = color.NRGBA{128, 128, 128, 200}
	ColorItemPerk            = color.NRGBA{255, 215, 0, 200}
	ColorItemPerkDescription = color.NRGBA{200, 200, 200, 200}
	ColorItemUses            = color.NRGBA{255, 255, 255, 200}
	ColorItemLevel           = color.NRGBA{200, 200, 255, 200}
)
View Source
var (
	ErrStackNotFound     = errors.New("stack not found")
	ErrAnimationNotFound = errors.New("animation not found")
	ErrFrameNotFound     = errors.New("frame not found")
	ErrSliceNotFound     = errors.New("slice not found")
)
View Source
var FS multipath.FS

Functions

func GetEquipmentWithTypes

func GetEquipmentWithTypes(equipmentTypes []string) map[string]*EquipmentAsset

func GetHints

func GetHints() []string

func GetRandomName

func GetRandomName() string

func LoadEquipment

func LoadEquipment()

Load all equipment listed in the 'equipment/equipmentList.txt' file

func LoadSound

func LoadSound(soundType string, name string) (*vorbis.Stream, error)

Types

type EquipmentAsset

type EquipmentAsset struct {
	BaseName    string
	Name        string         `yaml:"name"`
	Description string         `yaml:"description"`
	Type        string         `yaml:"type"`
	Professions []string       `yaml:"professions,omitempty"`
	Stats       map[string]int `yaml:"stats,omitempty"`
	Perk        string         `yaml:"perk,omitempty"`
}

EquipmentAsset is an asset that represents an equipment. Info is stored as yaml data that represents the equipment.

func GetEquipment

func GetEquipment(name string) (*EquipmentAsset, error)

type Font

type Font struct {
	Face       *text.GoTextFace
	LineHeight float64
}
var BodyFont Font
var DisplayFont Font

type Sprite

type Sprite struct {
	Image *ebiten.Image
}

func LoadSprite

func LoadSprite(name string) (*Sprite, error)

type Staxie

type Staxie struct {
	Stacks      map[string]*StaxieStack
	StackNames  []string
	FrameWidth  int
	FrameHeight int
	// contains filtered or unexported fields
}

Staxie is the structure extracted from a Staxie PNG file.

func LoadStaxie

func LoadStaxie(name string) (*Staxie, error)

func (*Staxie) FromBytes

func (s *Staxie) FromBytes(data []byte) error

FromBytes reads the given PNG bytes into a staxie structure, providing it has a stAx section.

func (*Staxie) GetStack

func (s *Staxie) GetStack(name string) (*StaxieStack, bool)

type StaxieAnimation

type StaxieAnimation struct {
	Name      string // For convenience
	Frametime uint32
	Frames    []StaxieFrame
}

func (*StaxieAnimation) GetFrame

func (s *StaxieAnimation) GetFrame(index int) (*StaxieFrame, bool)

type StaxieFrame

type StaxieFrame struct {
	Index  int // ehh... why not
	Slices []StaxieSlice
}

func (*StaxieFrame) GetSlice

func (s *StaxieFrame) GetSlice(index int) (*StaxieSlice, bool)

type StaxieSlice

type StaxieSlice struct {
	Shading uint8
	X       int
	Y       int
	// Might as well store the ebitengine subimage here for efficiency's sake.
	Image *ebiten.Image
}

type StaxieStack

type StaxieStack struct {
	Name       string // For convenience
	SliceCount int
	Animations map[string]StaxieAnimation
}

func (*StaxieStack) GetAnimation

func (s *StaxieStack) GetAnimation(name string) (StaxieAnimation, bool)

Jump to

Keyboard shortcuts

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