assets

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

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

Go to latest
Published: Sep 14, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirFromContext

func DirFromContext(ctx context.Context) (string, bool)

func InstallFromGCS

func InstallFromGCS(ctx context.Context, bucketName string) error

Install fetches all game assets. Returns an error on the first failure.

func LoadPicture

func LoadPicture(ctx context.Context, filename string) (pixel.Picture, error)

LoadPicture loads a picture asset from the given filename. file is given relative to the root asset cache directory.

func Open

func Open(ctx context.Context, filename string) (*os.File, error)

Opens the file in the asset cache with the given filename. filename is given relative to the root asset cache directory.

func WithDir

func WithDir(ctx context.Context, dir string) context.Context

Types

type ID

type ID = string
const (
	// Adventurer
	AdventurerAnimationsConfigID ID = "configs/animations/adventurer.json"
	SpriteAdventurerSheet        ID = "sprites/rvros/pixel_adventurer/adventurer-sheet.png"

	// Props
	SpriteSphere ID = "sprites/rvros/platformer_tileset/Props/crate.png"

	// Audio
	SoundAdventurerJump ID = "sounds/adventurer-jump.mp3"
	SoundAdventurerLand ID = "sounds/adventurer-land.mp3"

	// Maps
	MapDev                  ID = "maps/surge-map-dev.tmx"
	SpritePlatformerTileset ID = "sprites/rvros/platformer_tileset/platformer_tiles.png"
)

Jump to

Keyboard shortcuts

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