Help us shape the future of Go! Take the 2026 Go Developer Survey

panorama

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package panorama compiles Panorama layouts and scripts into the resources the game loads, without Valve's resource compiler, and decompiles layouts back to XML. The output follows what the resource compiler writes, so the game reads it the same way on every platform.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

func Compile(addon, path string, source []byte) ([]byte, error)

Compile builds the source at path, such as panorama/layout/hud.xml or panorama/scripts/hud.js inside the addon named addon, into its compiled resource. A layout is parsed into the tree the game reads; a script is stored as it is.

func CompileTree

func CompileTree(addon string, tree fs.FS) (fstest.MapFS, error)

CompileTree compiles the addon content directory tree, such as content/citadel_addons/<addon>, into the addon's game files: each layout and script under panorama/ becomes its compiled resource, and every other file is kept as it is, so already compiled resources ship beside them. A style sheet is refused: its compiled form also carries a source map and an image table that this package does not write yet, so compile it with Valve's resource compiler.

func Compiled

func Compiled(source string) (string, bool)

Compiled returns the path of the resource the game loads for a source path, such as panorama/layout/hud.vxml_c for panorama/layout/hud.xml, and whether Compile builds that kind of source.

func Decompile

func Decompile(compiled []byte) (string, error)

Decompile prints a compiled .vxml_c layout as XML that Compile builds back to the same tree, apart from source positions. A layout is the only Panorama resource that needs it; a compiled script's DATA block is its source.

Types

This section is empty.

Jump to

Keyboard shortcuts

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