project

package
v0.4.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 42 Imported by: 14 modules, 13 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package project is experimental: its API and documented formats may change in a minor release; see https://nsgo.games/docs/stability/.

Package project reads, validates, writes and applies game.yaml, the one project file at the root of a game that holds its settings.

The Project File

A game.yaml names the game (name, id, appVersion) and holds its window and virtual resolution (window, display), its input map (input), its audio buses (audio), the scenes and resources it loads at startup (autoload), its export presets per platform (export), the Go plugins enabled for it (plugins) and the asset pipeline targets game assets builds (assets). Parse decodes a version 2 file into a File and runs Validate, refusing unknown fields, unsupported versions (refusing version 1 with a hint to run game migrate), duplicate names and out-of-range values. Encode validates a File and writes deterministic 2-space YAML in a fixed key order that Parse reads back unchanged, so a load and save never alters a file Encode wrote.

The Runtime

A game embeds its game.yaml and reads it with Parse (or MustParse for a file that is part of the program). File.WindowSize, File.WindowConstraints, File.Appearance and File.TitleBar feed nsgo.Run's options, File.Viewport is the screen.Viewport of the virtual resolution, File.BindInput binds the input map into an input.Actions, File.ConfigureMixer gives a sound.Mixer each bus's default volume and DSP chain, and File.LoadAutoloads reads the autoloaded scenes (as sceneformat documents) and resources from an fs.FS.

The Tools

game.yaml owns the fields NSGo's own nsgo.yaml repeats: the app's name, id and version, its appearance and its build output and targets. SyncNSGo writes them into an nsgo.yaml, keeping its other keys and comments, and CheckNSGo reports where an nsgo.yaml disagrees. The game project command runs these on a project directory, and the editor opens and saves game.yaml (editor.Editor.OpenProject, EditProject and SaveProject). PathRefs lists every path game.yaml holds to a file or folder of the project with the YAML node that writes it, and File.EachPath visits the same paths in a parsed File, so that package refs can check and rewrite them when a file moves.

Index

Examples

Constants

View Source
const (
	FieldAutoloadScene     = "autoload scene"
	FieldAutoloadResource  = "autoload resource"
	FieldAssetsCache       = "assets cache"
	FieldAtlasIn           = "assets atlas in"
	FieldAtlasOut          = "assets atlas out"
	FieldTextureIn         = "assets texture in"
	FieldTextureOut        = "assets texture out"
	FieldAudioIn           = "assets audio in"
	FieldAudioOut          = "assets audio out"
	FieldFontIn            = "assets font in"
	FieldFontOut           = "assets font out"
	FieldFontCharsFrom     = "assets font charsFrom"
	FieldFontCharsFile     = "assets font charsFile"
	FieldModelIn           = "assets model in"
	FieldModelOut          = "assets model out"
	FieldDataTableIn       = "assets dataTables in"
	FieldDataTableOut      = "assets dataTables out"
	FieldManifestIn        = "assets manifest in"
	FieldManifestOut       = "assets manifest out"
	FieldRemoteIn          = "assets remote in"
	FieldRemoteOut         = "assets remote out"
	FieldTagsFile          = "tags file"
	FieldL10nAssetManifest = "l10n assetManifest"
	FieldPackDir           = "pack dir"
)

The fields of a project file that hold a path to a file or folder of the project, in PathRef.Field and in messages.

View Source
const (
	// PortalProviderAuto detects the hosting portal from the browser page host on web builds and is a no-op elsewhere.
	PortalProviderAuto = "auto"
	// PortalProviderNone disables web portal SDK integration.
	PortalProviderNone = "none"
	// PortalProviderPoki selects the Poki HTML5 SDK on web builds.
	PortalProviderPoki = "poki"
	// PortalProviderCrazyGames selects the CrazyGames SDK v3 on web builds.
	PortalProviderCrazyGames = "crazygames"
)

PortalProvider constants name the values Portal.Provider accepts in game.yaml.

View Source
const (
	// KindTouchRegion is a touch inside Region (input.TouchRegion).
	KindTouchRegion = "touchRegion"
	// KindMouseButton is Button held anywhere on the view (input.MouseButton).
	KindMouseButton = "mouseButton"
	// KindMouseRegion is Button held inside Region (input.MouseRegion).
	KindMouseRegion = "mouseRegion"
	// KindKey is Key held on a keyboard, following the active keyboard layout (input.Key).
	KindKey = "key"
	// KindKeyCode is Code held at a physical keyboard position, independent of layout (input.KeyCode).
	KindKeyCode = "keyCode"
	// KindGamepadButton is Button held on a connected game controller (input.GamepadButton).
	KindGamepadButton = "gamepadButton"
)

Binding kinds name the input.Input constructors.

View Source
const (
	// PackAsset is a pack of assets, such as images, atlases, sounds and data files.
	PackAsset = "asset"
	// PackPlugin is a pack that turns on editor plugins, with any files they read.
	PackPlugin = "plugin"
	// PackTemplate is a pack of scenes and prefabs a game starts from or builds on.
	PackTemplate = "template"
)

Pack kinds name what a library pack holds.

View Source
const AssetsPlanFileName = "assets.plan.yaml"

AssetsPlanFileName is the optional project-root asset work plan.

View Source
const AssetsPlanSchemaComment = "# yaml-language-server: $schema=" + AssetsPlanSchemaURL

AssetsPlanSchemaComment is the YAML language-server header emitted by EncodeAssetsPlan.

View Source
const AssetsPlanSchemaURL = "https://nsgo.games/schemas/assets-plan.v1.json"

AssetsPlanSchemaURL is the published JSON Schema for assets.plan.yaml.

View Source
const AssetsPlanVersion = 1

AssetsPlanVersion is the assets.plan.yaml schema version.

View Source
const BriefFileName = "brief.yaml"

BriefFileName is the game brief file name at a project's root.

View Source
const BriefSchemaComment = "# yaml-language-server: $schema=" + BriefSchemaURL

BriefSchemaComment is the first line EncodeBrief writes: a YAML comment pointing a YAML language server at BriefSchemaURL.

View Source
const BriefSchemaURL = "https://nsgo.games/schemas/brief.v1.json"

BriefSchemaURL is where the JSON Schema of version 1 game brief files (brief.yaml) is published.

View Source
const BriefVersion = 1

BriefVersion is the brief.yaml schema version this package reads and writes.

View Source
const CurrentVersion = 2

CurrentVersion is the project file schema version this package reads and writes.

View Source
const DefaultAssetsCache = ".game/assets-cache.yaml"

DefaultAssetsCache is where game assets keeps its build cache, relative to the project root, when Assets.Cache is empty. Its directory starts with a dot, so the manifest's scan of an assets directory never lists it.

View Source
const DefaultFontChars = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"

DefaultFontChars are the characters a font target bakes when neither it nor its font's import settings list them: printable ASCII, from the space to the tilde.

View Source
const DefaultFontSize = 32

DefaultFontSize is the size in pixels a font target bakes its glyphs at when neither it nor its font's import settings set one.

View Source
const DefaultNavAgent = "default"

DefaultNavAgent names the agent type game navmesh bakes for when game.yaml declares none.

View Source
const FileName = "game.yaml"

FileName is the project file's name at a game's root.

View Source
const MaxFontSize = 2048

MaxFontSize is the largest size in pixels a font target or a font's import settings may set: the width and height of a font's page, which each glyph must fit on.

View Source
const MaxNavVertsPerPoly = 12

MaxNavVertsPerPoly is the largest Navigation.MaxVertsPerPoly.

View Source
const NSGoFileName = "nsgo.yaml"

NSGoFileName is NSGo's own project file, beside game.yaml.

View Source
const SchemaURL = "https://nsgo.games/schemas/game.v2.json"

SchemaURL is where the JSON Schema of version 2 project files (game.yaml) is published.

View Source
const SchemaURLV1 = "https://nsgo.games/schemas/game.v1.json"

SchemaURLV1 is where the JSON Schema of version 1 project files is published; Parse still reads them (FileVersion1).

Variables

View Source
var AudioFormats = []string{"wav", "aac", "mp3"}

AudioFormats are the formats an audio target may name, as game audio's -format flag spells them.

BindingKinds lists every binding kind a game.yaml action may declare, in display order.

BriefSections lists every section checked by Brief.MissingSections in canonical display order.

View Source
var DataTableSides = []string{"client", "server"}

DataTableSides are the sides a dataTables target may name.

View Source
var GamepadAxes = []string{"leftX", "leftY", "rightX", "rightY"}

GamepadAxes lists the W3C Standard Gamepad stick axis names accepted by GamepadAxis.Axis.

View Source
var GamepadButtons = []string{
	"south", "east", "west", "north",
	"leftShoulder", "rightShoulder", "leftTrigger", "rightTrigger",
	"back", "start", "leftStick", "rightStick",
	"dpadUp", "dpadDown", "dpadLeft", "dpadRight",
	"home",
}

GamepadButtons lists the W3C Standard Gamepad button names accepted by KindGamepadButton.

View Source
var ModelTextureFormats = []string{"uastc"}

ModelTextureFormats are the Basis Universal KTX2 formats a model target or model sidecar may convert a glTF model's textures into (KHR_texture_basisu).

View Source
var ModifierKinds = []string{"negate", "swizzle", "scale"}

ModifierKinds lists the value modifier kinds accepted by Modifier.Kind.

View Source
var MotionAxes = []string{"tiltX", "tiltY", "tiltZ", "gyroX", "gyroY", "gyroZ"}

MotionAxes lists the device motion sensor axis names accepted by MotionAxis.Axis.

View Source
var MouseButtons = []string{"left", "right", "middle", "back", "forward"}

MouseButtons lists the mouse button names accepted by KindMouseButton and KindMouseRegion.

View Source
var OriginKeep = []string{"rules", "data", "name", "readme", "credits"}

OriginKeep are the values Origin.Keep accepts, one per template residue warning game check reports.

PackKinds are the kinds a Pack may have, in the order the tools list them.

View Source
var Platforms = []string{"macos", "windows", "linux", "ios", "tvos", "watchos", "android", "harmonyos", "web", "miniprogram"}

Platforms are the export preset platforms, each a name nsgo build -target accepts.

View Source
var TextureFormats = []string{"rgba8", "bc1", "bc3", "bc7", "etc2", "etc2-rgba", "astc4x4", "uastc"}

TextureFormats are the KTX2 formats a texture target may name, as game tex's -format flag spells them.

View Source
var TriggerKinds = []string{"hold", "tap", "doubleTap", "chord", "repeat"}

TriggerKinds lists the fixed-step trigger kinds accepted by Trigger.Kind.

View Source
var VectorSticks = []string{"left", "right"}

VectorSticks lists the gamepad stick names accepted by Vector.Stick.

Functions

func AtlasNamed

func AtlasNamed(p, name string) bool

AtlasNamed reports whether name names the atlas JSON file at p, a slash-separated path from the project root, as NearestAtlases matches it before choosing the nearest: p without its extension is name, cleaned and taken from the project root, or p's base name without its extension is name.

func AtlasScaleSuffix

func AtlasScaleSuffix(scale float64) string

AtlasScaleSuffix returns the filename suffix placed before the extension for an atlas variant at scale: "" for 1 and "@<s>x" (such as "@0.5x") for scales in (0, 1).

func Bool

func Bool(v bool) *bool

Bool returns a pointer to v for optional fields such as Window.Resizable.

func BuiltinFeatures

func BuiltinFeatures() []string

BuiltinFeatures returns every built-in platform, target, category, and build-mode feature name accepted in game.yaml overrides without being declared on a preset.

func Encode

func Encode(f *File) ([]byte, error)

Encode validates f and serializes it as deterministic 2-space YAML that Parse reads back unchanged.

func EncodeAssetsPlan

func EncodeAssetsPlan(plan *AssetsPlan) ([]byte, error)

EncodeAssetsPlan validates and writes deterministic assets.plan.yaml.

func EncodeBrief

func EncodeBrief(b *Brief) ([]byte, error)

EncodeBrief validates b and writes it as deterministic 2-space YAML prefixed with BriefSchemaComment. A file EncodeBrief wrote loads and saves back unchanged byte for byte.

func Features

func Features() []string

Features returns the active feature tags for the running build in deterministic order: built-in platform category ("desktop", "mobile", or "web"), platform name, concrete build target name, build mode ("debug" or "release"), followed by any preset features injected by game release or registered via SetFeatures, without duplicates.

func Float32

func Float32(v float32) *float32

Float32 returns a pointer to v for optional fields such as Bus.Volume and Audio.Master.

func Float64

func Float64(v float64) *float64

Float64 returns a pointer to v for optional numeric bounds such as BriefPlaytestTarget.Min, Max, and Equal.

func FormatAtlasScale

func FormatAtlasScale(scale float64) string

FormatAtlasScale formats a positive atlas scale for variant filenames and metadata (for example 0.5 -> "0.5", 1 -> "1").

func HasFeature

func HasFeature(feature string) bool

HasFeature reports whether feature is active in the running build (either a built-in platform/build-mode feature or a preset feature).

func HasScheme

func HasScheme(ref string) bool

HasScheme reports whether ref starts with a URI scheme of two or more letters, such as asset: or https:, which ResolveRef refuses as a path.

func Int

func Int(v int) *int

Int returns a pointer to v for optional Override int fields.

func IsAtlasJSON

func IsAtlasJSON(data []byte) bool

IsAtlasJSON reports whether data is a JSON object with top-level frames (an object or an array) and meta (an object), as TexturePacker and Aseprite export an atlas: the test Resolver and `game check` both tell a project's atlas JSON files from its other JSON files by.

func IsKnownFeature

func IsKnownFeature(f *File, feature string) bool

IsKnownFeature reports whether feature is either a built-in feature or declared in at least one export preset of f.

func IsPortableTarget

func IsPortableTarget(target string) bool

IsPortableTarget reports whether target (or platform name) builds on every host (macOS, Linux, and Windows) with plain Go, without macOS, Xcode, or an Android NDK.

func IsSHA256

func IsSHA256(s string) bool

IsSHA256 reports whether s is a SHA-256 digest written as 64 lower-case hexadecimal digits.

func IsVersion1

func IsVersion1(data []byte) bool

IsVersion1 reports whether data is a YAML mapping whose version is the integer 1, a file Parse upgrades in memory and game migrate rewrites as version 2.

func MatchAssetFilter

func MatchAssetFilter(include, exclude []string, relPath string) bool

MatchAssetFilter reports whether relPath passes the include and exclude glob filters: when include is non-empty, relPath must match at least one include pattern; any match in exclude removes relPath.

func MatchAssetPattern

func MatchAssetPattern(pattern, relPath string) bool

MatchAssetPattern matches a slash-separated project-relative path against pattern, supporting path.Match wildcards (*, ?, [...]) within segments and "**" to match zero or more path segments.

func NearestAtlases

func NearestAtlases(atlases []string, from, name string) []string

NearestAtlases returns which of atlases, the slash-separated paths of a project's atlas JSON files from its root, a scene in the directory from (a path from the root, "." for the root itself) names name, as `game check` and Resolver find them: the files whose path without its extension is name, or whose base name without its extension is name, keeping only those nearest from, counting the directories up from from and down to the file. It returns them sorted; more than one means name is ambiguous there, and none that it names no atlas.

func PlatformFeatures

func PlatformFeatures(platform, target string, release bool) []string

PlatformFeatures returns the built-in feature tags for a given export platform, optional concrete NSGo build target, and build mode ("release" when release is true, "debug" otherwise).

func ResolveRef

func ResolveRef(dir, ref string) (string, error)

ResolveRef joins ref, a slash-separated path written in a file of a project, to dir, the slash-separated directory from the project root it is relative to, and returns the path from the project root, or an error saying why ref cannot name a file there: it refuses a path with backslashes, an absolute path or one starting with a Windows drive letter such as C:, a URI with a scheme of two or more letters (HasScheme), and a path that leads outside the root. `game check` (package assetcheck) reads the paths files write with it, and Resolver reads an atlas's meta.image with it, so the two accept the same images.

func SaveBrief

func SaveBrief(path string, b *Brief) error

SaveBrief validates, encodes, and writes b to path in canonical YAML form.

func SetFeatures

func SetFeatures(features []string)

SetFeatures replaces the runtime-registered custom preset feature tags reported by Features and HasFeature. Generated build-feature packages (such as internal/buildfeatures written by game release) and tests call SetFeatures to register preset features without altering built-in platform or build-mode features.

func SetNSGoMiniProgramAppID

func SetNSGoMiniProgramAppID(nsgoYAML []byte, platform, appID string) ([]byte, error)

SetNSGoMiniProgramAppID returns nsgoYAML, an nsgo.yaml's contents (empty for a new one), with miniprogram.appid.<platform> set to appID, or removed when appID is empty. platform is the name after miniprogram_ in an NSGo target (wechat, qq, alipay, douyin). Every other key and comment is kept. NSGo reads this AppID when it builds the mini program target.

func SkipDir

func SkipDir(name string) bool

SkipDir reports whether a walk of a project's files skips the directory called name, as the go command skips it: a name starting with "." or "_", or testdata. Resolver and `game check` both skip them.

func String

func String(v string) *string

String returns a pointer to v for optional Override string fields.

func TargetsOf

func TargetsOf(platform string) []string

TargetsOf returns the NSGo build targets a preset for platform may list.

func Validate

func Validate(f *File) error

Validate checks that f conforms to the version 2 schema.

func ValidateAssetPattern

func ValidateAssetPattern(pat string) bool

ValidateAssetPattern reports whether pat is a valid slash-separated project-relative asset filter pattern.

func ValidateAssetsPlan

func ValidateAssetsPlan(plan *AssetsPlan) error

ValidateAssetsPlan checks the assets plan schema and semantic uniqueness rules.

func ValidateBrief

func ValidateBrief(b *Brief) error

ValidateBrief checks b against the version 1 brief.yaml schema.

func ValidateFontChars

func ValidateFontChars(chars string) error

ValidateFontChars checks the characters of a font target or a font's import settings: valid UTF-8 without control characters, line breaks included. The space is allowed.

func ValidateFontCharsFile

func ValidateFontCharsFile(p string) error

ValidateFontCharsFile checks the charsFile path of a font target or a font's import settings: empty, or a clean, slash-separated relative file path inside the project.

func ValidateFontCharsFrom

func ValidateFontCharsFrom(paths []string) error

ValidateFontCharsFrom checks the charsFrom path list of a font target or a font's import settings: each entry a clean, non-empty, slash-separated relative file path inside the project, with no duplicates.

func ValidateFontSize

func ValidateFontSize(size int) error

ValidateFontSize checks the size of a font target or a font's import settings: 0, which keeps the default, up to MaxFontSize.

func ValidateModelScale

func ValidateModelScale(scale float64) error

ValidateModelScale checks the scale of a model target or a model's import settings: a finite number that is not negative, 0 meaning the default.

func ValidateModelTextureFormat

func ValidateModelTextureFormat(format string) error

ValidateModelTextureFormat checks the textureFormat of a model target or a model's import settings: empty (keep images as written) or one of ModelTextureFormats.

func ValidatePackName

func ValidatePackName(name string) error

ValidatePackName reports whether name can name a library pack: 1 to 64 lower-case ASCII letters, digits and '-', starting with a letter or digit, so that it is also a directory name on every platform.

func ValidatePackVersion

func ValidatePackVersion(v string) error

ValidatePackVersion reports whether v is a valid semantic version (MAJOR.MINOR.PATCH[-prerelease][+build]) without a leading "v", such as 1.2.0.

Types

type Action

type Action struct {
	// Name uniquely identifies the action.
	Name string `yaml:"name" schema:"required"`
	// Bindings are the inputs that press the action; an action without any is declared for code to bind, such as one an axis reads.
	Bindings []Binding `yaml:"bindings,omitempty"`
	// Assist declares which player motor assists (hold-to-toggle, mash-to-hold) apply to this action; nil leaves the action ineligible so menu actions are never latched.
	Assist *ActionAssist `yaml:"assist,omitempty,flow"`
}

Action is one named action and the physical inputs that trigger it.

type ActionAssist

type ActionAssist struct {
	// Toggle reports whether a player may latch this action on press and release it on the next press.
	Toggle bool `yaml:"toggle,omitempty"`
	// Mash reports whether a player may satisfy rapid-press mashing of this action by holding it.
	Mash bool `yaml:"mash,omitempty"`
	// MashRate is the synthetic press rate in presses per second used when MashToHold is active; 0 uses input.DefaultMashRate (10). Refused when Mash is false.
	MashRate float64 `yaml:"mashRate,omitempty" schema:"minimum=0"`
}

ActionAssist declares which player motor assists an action opts into.

type AssetCaps

type AssetCaps struct {
	// Main is the largest size of the main package in bytes.
	Main int64 `yaml:"main,omitempty" schema:"minimum=0"`
	// Total is the largest size of all packages together in bytes.
	Total int64 `yaml:"total,omitempty" schema:"minimum=0"`
}

AssetCaps are the package size limits of one export preset, in bytes; 0 leaves a limit unset. In YAML each field accepts either an integer byte count or a byte-size string such as 4MiB, 30MiB, 512KiB, 4MB or 1024B.

func (*AssetCaps) UnmarshalYAML

func (c *AssetCaps) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML decodes an AssetCaps mapping whose main and total fields may be integer bytes or byte-size strings such as 4MiB or 30MiB, refusing unknown or duplicate keys.

type AssetDelivery

type AssetDelivery struct {
	// Main lists the asset groups shipped in the main package.
	Main []string `yaml:"main,omitempty,flow"`
	// Subpackages maps each subpackage name to the asset groups it ships; a name has no spaces or control characters.
	Subpackages map[string][]string `yaml:"subpackages,omitempty"`
	// Remote lists the asset groups served from the remote origin instead of a package.
	Remote []string `yaml:"remote,omitempty,flow"`
	// Caps are the package size limits of the preset in bytes.
	Caps *AssetCaps `yaml:"caps,omitempty"`
}

AssetDelivery is where one export preset places its asset groups. Each group may appear in at most one of Main, Subpackages and Remote.

func (*AssetDelivery) Clone

func (d *AssetDelivery) Clone() *AssetDelivery

Clone returns a deep copy of d, or nil when d is nil.

func (*AssetDelivery) Validate

func (d *AssetDelivery) Validate() error

Validate checks d's asset group placement, subpackage names and package caps.

type Assets

type Assets struct {
	// Cache is the build cache's path; empty is DefaultAssetsCache.
	Cache string `yaml:"cache,omitempty"`
	// Atlases are the sprite atlases to pack, each from one folder of PNG images.
	Atlases []AtlasTarget `yaml:"atlases,omitempty"`
	// Textures are the images to encode into KTX2 containers.
	Textures []TextureTarget `yaml:"textures,omitempty"`
	// Audio are the WAV files to normalize, resample and convert.
	Audio []AudioTarget `yaml:"audio,omitempty"`
	// Fonts are the TrueType and OpenType fonts, and the folders of PNG glyph images, to bake into bitmap fonts.
	Fonts []FontTarget `yaml:"fonts,omitempty"`
	// Models are the glTF models to pack into single GLB files.
	Models []ModelTarget `yaml:"models,omitempty"`
	// DataTables are the folders of canonical YAML data tables to strip to the columns read by a side (client or server).
	DataTables []DataTableTarget `yaml:"dataTables,omitempty"`
	// Manifest, when set, is the typed Go asset manifest generated after every other target is built.
	Manifest *ManifestTarget `yaml:"manifest,omitempty"`
	// Remote, when set, copies loose assets to content-hashed filenames (<name>.<hash8>.<ext>) under its out folder and writes remote.yaml for CDN hosting.
	Remote *RemoteTarget `yaml:"remote,omitempty"`
}

Assets declares the targets game assets builds: the sprite atlases to pack, the textures to encode, the audio to convert, the fonts to bake, the models to pack, the data tables to filter by side and the asset manifest to generate. Paths in it are slash-separated and relative to the project root, and may not leave it.

func (*Assets) CachePath

func (a *Assets) CachePath() string

CachePath returns the build cache's slash-separated path relative to the project root: Cache, or DefaultAssetsCache when a is nil or Cache is empty.

func (*Assets) IsOutput

func (a *Assets) IsOutput(p string) bool

IsOutput reports whether a target of a writes the file at the slash-separated path p, relative to the project root: the cache, a texture, an audio output, a font's .fnt file or one of its pages (name.png or name-N.png beside it), a model, the manifest, or a page of an atlas (name.png, name.json, name-N.png or name-N.json in its out folder). Such a file is built from the targets' inputs rather than authored, so it is not an asset of its own. A nil a writes nothing.

func (*Assets) Validate

func (a *Assets) Validate() error

Validate checks the assets section as Validate checks the whole file: paths that are relative, slash-separated and stay inside the project, settings in range, known formats, no two targets writing the same file, no file written over game.yaml or over a target's input, no atlas or font page or other PNG written where an atlas reads its images, and no cache where the manifest lists assets.

type AssetsPlan

type AssetsPlan struct {
	Version int               `yaml:"version" schema:"required"`
	Batches []AssetsPlanBatch `yaml:"batches,omitempty"`
}

AssetsPlan records pending asset work in approval-scoped batches.

func ParseAssetsPlan

func ParseAssetsPlan(data []byte) (*AssetsPlan, error)

ParseAssetsPlan decodes and validates assets.plan.yaml.

type AssetsPlanBatch

type AssetsPlanBatch struct {
	ID       string           `yaml:"id" schema:"required,minLength=1"`
	Approval string           `yaml:"approval" schema:"required,minLength=1"`
	Assets   []AssetsPlanItem `yaml:"assets" schema:"required,minItems=1"`
}

AssetsPlanBatch groups work under one spend approval.

type AssetsPlanItem

type AssetsPlanItem struct {
	ID             string `yaml:"id" schema:"required,minLength=1"`
	Kind           string `yaml:"kind" schema:"required,enum=image|texture|sound|music|model|animation|tileset"`
	Target         string `yaml:"target" schema:"required,minLength=1"`
	Priority       string `yaml:"priority" schema:"required,enum=high|normal|low"`
	Placeholder    string `yaml:"placeholder,omitempty"`
	Notes          string `yaml:"notes,omitempty"`
	Status         string `yaml:"status,omitempty"`
	Generator      string `yaml:"generator,omitempty"`
	MaxRetries     int    `yaml:"maxRetries,omitempty"`
	Reuse          int    `yaml:"reuse,omitempty"`
	FallbackReason string `yaml:"fallbackReason,omitempty"`
}

AssetsPlanItem describes one asset still needed by the project.

type AtlasTarget

type AtlasTarget struct {
	// Name is the base name of the atlas's page files, such as "ui" for ui.png and ui.json.
	Name string `yaml:"name"`
	// In is the folder of PNG images, searched recursively.
	In string `yaml:"in"`
	// Out is the folder the pages are written to.
	Out string `yaml:"out"`
	// Padding is the transparent gap between frames in pixels; nil is 1.
	Padding *int `yaml:"padding,omitempty"`
	// Extrude is how many edge pixels are repeated around each frame.
	Extrude int `yaml:"extrude,omitempty"`
	// MaxWidth bounds a page's width in pixels; 0 is 2048.
	MaxWidth int `yaml:"maxWidth,omitempty"`
	// MaxHeight bounds a page's height in pixels; 0 is 2048.
	MaxHeight int `yaml:"maxHeight,omitempty"`
	// Scale is written to the pages' meta.scale; 0 is 1. Mutually exclusive with Scales.
	Scale int `yaml:"scale,omitempty"`
	// Scales packs one page set per scale in (0, 1] (such as [1, 0.5]), writing name.json/png for 1 and name@<s>x.json/png for reduced scales, deduplicated and sorted descending for deterministic output. Mutually exclusive with Scale.
	Scales []float64 `yaml:"scales,omitempty,flow"`
	// Trim removes transparent borders around each image; nil is true.
	Trim *bool `yaml:"trim,omitempty"`
}

AtlasTarget is one sprite atlas packed from a folder of PNG images, as game pack packs it.

func (AtlasTarget) NormalizedScales

func (t AtlasTarget) NormalizedScales() []float64

NormalizedScales returns a deduplicated copy of t.Scales sorted from highest to lowest, or nil when t.Scales is empty.

type Audio

type Audio struct {
	// Master is the default master volume in [0, 1]; nil leaves it at 1.
	Master *float32 `yaml:"master,omitempty" schema:"minimum=0,maximum=1"`
	// MaxVoices is the mixer's global concurrent voice budget; 0 uses sound.DefaultMaxVoices.
	MaxVoices int `yaml:"maxVoices,omitempty" schema:"minimum=0"`
	// Buses are the mixer groups in declaration order.
	Buses []Bus `yaml:"buses,omitempty"`
	// Concurrency lists shared concurrency groups limiting and resolving overlapping voices across sounds.
	Concurrency []ConcurrencyGroup `yaml:"concurrency,omitempty"`
	// Duck lists bus ducking rules that lower one bus while another bus or concurrency group plays.
	Duck []BusDuck `yaml:"duck,omitempty"`
}

Audio is the master volume, global voice budget, buses (sound.Mixer groups), concurrency groups, and bus ducking rules a game plays through.

type AudioDuck

type AudioDuck struct {
	// Amount is the volume reduction fraction in [0, 1] (0 disables ducking, 0.4 lowers by 40%, 1 silences).
	Amount float32 `yaml:"amount" schema:"required,minimum=0,maximum=1"`
	// Attack is how quickly ducking ramps in; 0 applies immediately.
	Attack time.Duration `yaml:"attack,omitempty"`
	// Release is how quickly volume recovers; 0 restores immediately.
	Release time.Duration `yaml:"release,omitempty"`
}

AudioDuck configures ducking reduction and attack/release envelope timing for a concurrency group.

type AudioOverride

type AudioOverride struct {
	// Master overrides Audio.Master in [0, 1].
	Master *float32 `yaml:"master,omitempty" schema:"minimum=0,maximum=1"`
	// MaxVoices overrides Audio.MaxVoices.
	MaxVoices *int `yaml:"maxVoices,omitempty" schema:"minimum=0"`
	// Buses replaces Audio.Buses when non-nil.
	Buses []Bus `yaml:"buses,omitempty"`
	// Concurrency replaces Audio.Concurrency when non-nil.
	Concurrency []ConcurrencyGroup `yaml:"concurrency,omitempty"`
	// Duck replaces Audio.Duck when non-nil.
	Duck []BusDuck `yaml:"duck,omitempty"`
}

AudioOverride overrides individual fields of Audio; omitted fields keep the base value.

type AudioTarget

type AudioTarget struct {
	// In is the source WAV file.
	In string `yaml:"in"`
	// Out is the file written.
	Out string `yaml:"out"`
	// Format is one of AudioFormats; empty is wav. aac and mp3 need an external encoder, as game audio describes.
	Format string `yaml:"format,omitempty"`
	// Rate is the sample rate in Hz; 0 keeps the input's.
	Rate int `yaml:"rate,omitempty"`
	// Channels is 1 for mono or 2 for stereo; 0 keeps the input's.
	Channels int `yaml:"channels,omitempty"`
	// PeakDB normalizes the peak to this level in dBFS; it may not be set with RMSDB.
	PeakDB *float64 `yaml:"peakDB,omitempty"`
	// RMSDB normalizes the loudness to this level in dBFS with soft clipping; it may not be set with PeakDB.
	RMSDB *float64 `yaml:"rmsDB,omitempty"`
	// Bitrate is the AAC or MP3 bitrate in kbps; 0 is 128.
	Bitrate int `yaml:"bitrate,omitempty"`
}

AudioTarget is one WAV file normalized, resampled and converted, as game audio converts it.

type Autoload

type Autoload struct {
	// MainScene names the scene in Scenes the game starts in; empty leaves the choice to the game.
	MainScene string `yaml:"mainScene,omitempty"`
	// Scenes are sceneformat YAML documents, loaded and validated at startup.
	Scenes []Entry `yaml:"scenes,omitempty"`
	// Resources are other files loaded as bytes at startup, such as data tables.
	Resources []Entry `yaml:"resources,omitempty"`
}

Autoload lists the scenes and resources a game loads at startup.

type AutoloadOverride

type AutoloadOverride struct {
	// MainScene overrides Autoload.MainScene.
	MainScene *string `yaml:"mainScene,omitempty"`
	// Scenes replaces Autoload.Scenes when non-nil.
	Scenes []Entry `yaml:"scenes,omitempty"`
	// Resources replaces Autoload.Resources when non-nil.
	Resources []Entry `yaml:"resources,omitempty"`
}

AutoloadOverride overrides individual fields of Autoload; omitted fields keep the base value.

type Axis

type Axis struct {
	// Name uniquely identifies the axis.
	Name string `yaml:"name" schema:"required"`
	// Negative names a declared action that drives the axis toward -1; at least one of Negative and Positive is required.
	Negative string `yaml:"negative,omitempty"`
	// Positive names a declared action that drives the axis toward +1; at least one of Negative and Positive is required.
	Positive string `yaml:"positive,omitempty"`
}

Axis is a named axis over two actions, as input.Actions.BindAxis binds it.

type BandFilter

type BandFilter struct {
	// Hz is the band center in hertz; it must be positive.
	Hz float64 `yaml:"hz" schema:"required,exclusiveMinimum=0"`
	// Q is the resonance; 0 is Butterworth.
	Q float64 `yaml:"q,omitempty" schema:"minimum=0"`
}

BandFilter is a band-pass or notch filter around Hz (sound.BandPass, sound.Notch).

type Binding

type Binding struct {
	// Kind is KindTouchRegion, KindMouseButton, KindMouseRegion, KindKey, KindKeyCode or KindGamepadButton.
	Kind string `yaml:"kind" schema:"required,enum=touchRegion|mouseButton|mouseRegion|key|keyCode|gamepadButton"`
	// Button is a mouse button ("left", "right", "middle", "back" or "forward") for KindMouseButton and KindMouseRegion, or a standard gamepad button (one of GamepadButtons) for KindGamepadButton; refused by other kinds.
	Button string `yaml:"button,omitempty"`
	// Key is the keyboard key name (such as "a", "space", "left", "enter" or "shift") for KindKey, matched case-insensitively as input.Key does; refused by other kinds.
	Key string `yaml:"key,omitempty"`
	// Code is the physical keyboard position (such as "KeyW", "ArrowLeft", "Space" or "ShiftLeft") for KindKeyCode, as input.KeyCode reads it; refused by other kinds.
	Code string `yaml:"code,omitempty"`
	// Region is the rectangle in virtual coordinates (or view coordinates without a Display) that KindTouchRegion and KindMouseRegion test; refused by other kinds.
	Region *Rect `yaml:"region,omitempty,flow"`
	// Trigger configures fixed-step hold, tap, doubleTap, chord or repeat evaluation for this binding.
	Trigger *Trigger `yaml:"trigger,omitempty,flow"`
	// Modifiers transform this binding's evaluated value in order (negate, swizzle, scale).
	Modifiers []Modifier `yaml:"modifiers,omitempty"`
}

Binding is one physical input bound to an action, with an optional fixed-step trigger and value modifiers.

func (Binding) ActionBinding

func (b Binding) ActionBinding() input.ActionBinding

ActionBinding returns b as an input.ActionBinding including any Trigger and Modifiers.

func (Binding) Input

func (b Binding) Input() input.Input

Input returns b as an input.Input; a Binding Validate refused returns the zero Input, which is never active.

type Bitcrush

type Bitcrush struct {
	// Bits is the quantized bit depth in [1, 15].
	Bits int `yaml:"bits" schema:"required,minimum=1,maximum=15"`
	// Downsample holds each sample for this many frames; 0 and 1 keep every frame.
	Downsample int `yaml:"downsample,omitempty" schema:"minimum=0"`
}

Bitcrush is a lo-fi quantizer (sound.Bitcrush): Bits in [1, 15] and Downsample 0 or more, where 0 and 1 keep every frame.

type Brief

type Brief struct {
	// Version is the schema version; it must equal BriefVersion (1).
	Version int `yaml:"version" schema:"required"`
	// Basis records where the brief's statements come from: locked (a decision only the person changes), target (an experience goal to aim for) or assumption (a default an agent may revise).
	Basis string `yaml:"basis,omitempty" schema:"enum=locked|target|assumption"`
	// Pitch describes what the game is meant to be in a sentence or two.
	Pitch string `yaml:"pitch,omitempty"`
	// Genre lists the game's primary genre labels, such as "2D platformer" and "action".
	Genre []string `yaml:"genre,omitempty,flow"`
	// Tags lists optional extra keywords or sub-genre tags describing the game.
	Tags []string `yaml:"tags,omitempty,flow"`
	// Platforms lists the target platforms and control styles, such as "desktop", "phones, touch", and "web".
	Platforms []string `yaml:"platforms,omitempty,flow"`
	// ArtDirection describes visual style, resolution, palette, and silhouette rules.
	ArtDirection string `yaml:"artDirection,omitempty"`
	// Art holds structured visual direction notes and pinned reference images read by the agent before every request.
	Art *BriefArt `yaml:"art,omitempty"`
	// ToneAndAudio describes mood, music, and sound direction.
	ToneAndAudio string `yaml:"toneAndAudio,omitempty"`
	// Feel describes game feel, difficulty pacing, and structured playtest targets.
	Feel *BriefFeel `yaml:"feel,omitempty"`
	// Changes records explicit edits to brief intent in deterministic order.
	Changes []BriefChange `yaml:"changes,omitempty"`
}

Brief is the root of a versioned brief.yaml file at a game project's root. The agent reads it before every request and checks its work against it, and playtests can read structured targets from Feel.Targets.

func LoadBrief

func LoadBrief(path string) (*Brief, error)

LoadBrief reads and parses brief.yaml from path.

func ParseBrief

func ParseBrief(data []byte) (*Brief, error)

ParseBrief decodes and validates a versioned brief.yaml document. Unknown fields, trailing YAML documents, duplicate keys, YAML anchors/aliases/merge keys, missing or unsupported versions, and invalid playtest target bounds are refused with *loaderr.Error line info.

func ReadBriefFS

func ReadBriefFS(fsys fs.FS) (*Brief, error)

ReadBriefFS reads and parses BriefFileName at the root of fsys.

func (*Brief) Clone

func (b *Brief) Clone() *Brief

Clone returns a deep copy of b, or nil when b is nil.

func (*Brief) MissingSections

func (b *Brief) MissingSections() []BriefSection

MissingSections returns the brief sections that are currently empty, in canonical BriefSections order.

func (*Brief) TargetsForScene

func (b *Brief) TargetsForScene(scene string) []BriefPlaytestTarget

TargetsForScene returns the playtest targets defined in b that apply to scene. Targets with an empty Scene apply to every scene; when both a global target and a scene-specific target exist for the same metric, the scene-specific target takes precedence. When scene is empty, all targets are returned in declaration order.

type BriefArt

type BriefArt struct {
	// Basis records where the art direction comes from: locked, target or assumption.
	Basis string `yaml:"basis,omitempty" schema:"enum=locked|target|assumption"`
	// Direction optionally describes visual direction inline under art.direction.
	Direction string `yaml:"direction,omitempty"`
	// References lists pinned project-relative reference images included with every agent request.
	References []BriefArtReference `yaml:"references,omitempty"`
}

BriefArt holds structured art direction notes and pinned project-relative reference images.

type BriefArtReference

type BriefArtReference struct {
	// Path is the project-relative slash path to the reference image (for example "art/reference/spikes_ref.png").
	Path string `yaml:"path" schema:"required,minLength=1"`
	// Note is an optional short description of what the reference illustrates.
	Note string `yaml:"note,omitempty"`
}

BriefArtReference names one pinned reference image listed under art.references in brief.yaml.

type BriefChange

type BriefChange struct {
	// Date is the UTC day of the edit, as YYYY-MM-DD.
	Date string `yaml:"date" schema:"required"`
	// Field names what changed, such as "feel.targets.floor_01.median_time".
	Field string `yaml:"field" schema:"required"`
	// From is the value before the edit, empty when the field was added.
	From string `yaml:"from,omitempty"`
	// To is the value after the edit, empty when the field was removed.
	To string `yaml:"to,omitempty"`
	// Reason says why the field changed.
	Reason string `yaml:"reason,omitempty"`
}

BriefChange records one edit to the brief's intent, listed under changes in brief.yaml.

type BriefFeel

type BriefFeel struct {
	// Basis records where the feel summary comes from: locked, target or assumption.
	Basis string `yaml:"basis,omitempty" schema:"enum=locked|target|assumption"`
	// Summary describes target game feel, controls responsiveness, and difficulty pacing in plain language.
	Summary string `yaml:"summary,omitempty"`
	// Targets lists structured playtest targets readable by playtest runners and the editor.
	Targets []BriefPlaytestTarget `yaml:"targets,omitempty"`
}

BriefFeel describes game feel, difficulty expectations, and machine-readable playtest targets.

type BriefPlaytestTarget

type BriefPlaytestTarget struct {
	// Metric is the playtest metric name this target constrains, such as "median_time", "deaths", or "finished".
	Metric string `yaml:"metric" schema:"required,minLength=1"`
	// Scene optionally restricts this target to a specific scene or level name, such as "floor_01".
	Scene string `yaml:"scene,omitempty"`
	// Basis records where this target comes from: locked (only the person changes it), target (an experience goal) or assumption (a default an agent may tune).
	Basis string `yaml:"basis,omitempty" schema:"enum=locked|target|assumption"`
	// Summary is an optional human-readable description of the target, such as "2–4 deaths on floor 3".
	Summary string `yaml:"summary,omitempty"`
	// Unit is an optional display unit, such as "s", "ms", or "%".
	Unit string `yaml:"unit,omitempty"`
	// Min is the inclusive lower bound (value >= Min).
	Min *float64 `yaml:"min,omitempty"`
	// Max is the inclusive upper bound (value <= Max).
	Max *float64 `yaml:"max,omitempty"`
	// Equal requires value == Equal.
	Equal *float64 `yaml:"equal,omitempty"`
}

BriefPlaytestTarget declares one measurable playtest target in brief.yaml's feel and difficulty section.

type BriefSection

type BriefSection string

BriefSection identifies a top-level section of brief.yaml checked for completeness ("gaps").

const (
	BriefSectionPitch        BriefSection = "pitch"
	BriefSectionGenre        BriefSection = "genre"
	BriefSectionPlatforms    BriefSection = "platforms"
	BriefSectionArtDirection BriefSection = "artDirection"
	BriefSectionFeel         BriefSection = "feel"
	BriefSectionToneAndAudio BriefSection = "toneAndAudio"
)

type Budgets

type Budgets struct {
	// QualityProfile names the quality preset frameTimeP95Ms is measured at (for example "low", "medium", or "high"); empty defaults to "low".
	QualityProfile string `yaml:"qualityProfile,omitempty"`
	// DownloadSizeMB is the maximum acceptable release download size in megabytes; 0 leaves it unset.
	DownloadSizeMB float64 `yaml:"downloadSizeMB,omitempty" schema:"minimum=0"`
	// FrameTimeP95Ms is the maximum acceptable 95th-percentile frame time in milliseconds; 0 leaves it unset.
	FrameTimeP95Ms float64 `yaml:"frameTimeP95Ms,omitempty" schema:"minimum=0"`
}

Budgets holds release size and performance thresholds checked against each built package.

type Bus

type Bus struct {
	// Name is the mixer group, such as "music" or "sfx".
	Name string `yaml:"name" schema:"required"`
	// Volume is the default volume in [0, 1] until the player sets one; nil leaves it at 1.
	Volume *float32 `yaml:"volume,omitempty" schema:"minimum=0,maximum=1"`
	// Effects is the bus's DSP chain, applied in order.
	Effects []Effect `yaml:"effects,omitempty"`
}

Bus is one sound.Mixer group: its default volume and its DSP effect chain.

func (Bus) Chain

func (b Bus) Chain() sound.EffectChain

Chain returns the bus's effects as a sound.EffectChain, nil without any.

type BusDuck

type BusDuck struct {
	// Bus is the mixer bus whose volume is lowered.
	Bus string `yaml:"bus" schema:"required"`
	// By is the triggering mixer bus or concurrency group name.
	By string `yaml:"by" schema:"required"`
	// Amount is the volume reduction fraction in [0, 1] (0 disables ducking, 0.4 lowers by 40%, 1 silences).
	Amount float32 `yaml:"amount" schema:"required,minimum=0,maximum=1"`
	// Attack is how quickly bus fades down when by starts playing; 0 applies immediately.
	Attack time.Duration `yaml:"attack,omitempty"`
	// Release is how quickly bus recovers once by finishes playing; 0 restores immediately.
	Release time.Duration `yaml:"release,omitempty"`
}

BusDuck lowers one mixer bus while another bus or concurrency group has active sounds.

func (BusDuck) Rule

func (d BusDuck) Rule() sound.BusDuckRule

Rule converts d into a sound.BusDuckRule.

type Chorus

type Chorus struct {
	// RateHz is the sweep rate; it must be positive.
	RateHz float64 `yaml:"rateHz" schema:"required,exclusiveMinimum=0"`
	// DepthMs is the sweep depth around 20ms in milliseconds.
	DepthMs float64 `yaml:"depthMs,omitempty" schema:"minimum=0"`
	// Mix is the dry/wet mix from 0 to 1.
	Mix float64 `yaml:"mix,omitempty" schema:"minimum=0,maximum=1"`
}

Chorus is a modulated-delay chorus (sound.Chorus).

type Compressor

type Compressor struct {
	// ThresholdDB is the level above which it acts.
	ThresholdDB float64 `yaml:"thresholdDb" schema:"required"`
	// Ratio is how much the level above the threshold is compressed; it must be above 1.
	Ratio float64 `yaml:"ratio" schema:"required,exclusiveMinimum=1"`
	// AttackMs and ReleaseMs are the envelope times in milliseconds; 0 reacts at once.
	AttackMs  float64 `yaml:"attackMs,omitempty" schema:"minimum=0"`
	ReleaseMs float64 `yaml:"releaseMs,omitempty" schema:"minimum=0"`
	// Sidechain optionally names another declared audio bus whose level keys this compressor.
	Sidechain string `yaml:"sidechain,omitempty"`
}

Compressor is a feed-forward peak compressor (sound.Compressor or sound.SidechainCompressor).

type ConcurrencyGroup

type ConcurrencyGroup struct {
	// Name is the unique concurrency group name referenced by sounds.
	Name string `yaml:"name" schema:"required"`
	// Max is the maximum simultaneous active voices in this group (or per owner when scope is owner); 0 imposes no group cap.
	Max int `yaml:"max,omitempty" schema:"minimum=0"`
	// Resolve chooses which voice is dropped when max is reached: refuse (default), oldest, farthest, quietest, or lowestPriority.
	Resolve string `yaml:"resolve,omitempty" schema:"enum=refuse|oldest|farthest|quietest|lowestPriority"`
	// Scope chooses whether max, retrigger, and duck apply across the whole group ("global", default) or per sound owner ("owner").
	Scope string `yaml:"scope,omitempty" schema:"enum=global|owner"`
	// Retrigger is the minimum duration between accepted voice starts in this group (or owner).
	Retrigger time.Duration `yaml:"retrigger,omitempty"`
	// StealFade is the fade-out duration applied to voices stolen by this group's resolution rule.
	StealFade time.Duration `yaml:"stealFade,omitempty"`
	// Duck lowers older active voices in the same concurrency scope while newer voices play.
	Duck *AudioDuck `yaml:"duck,omitempty,flow"`
}

ConcurrencyGroup defines a shared voice concurrency group under audio.concurrency.

func (ConcurrencyGroup) SoundGroup

func (c ConcurrencyGroup) SoundGroup() sound.ConcurrencyGroup

SoundGroup converts c into a sound.ConcurrencyGroup.

type CustomEffect

type CustomEffect struct {
	// Type is the namespaced effect name registered with sound.RegisterEffect, such as "dynakit.compressor".
	Type string `yaml:"type" schema:"required,minLength=1"`
	// Params holds effect-specific parameters passed to the registered sound.EffectFactory.
	Params map[string]any `yaml:"params,omitempty"`
}

CustomEffect configures a plugin-registered sound.BusEffect by its namespaced type and parameters.

func (CustomEffect) MarshalYAML

func (c CustomEffect) MarshalYAML() (any, error)

MarshalYAML writes type first and params (when non-empty) with keys sorted in strict byte order for deterministic YAML output.

type DataTableTarget

type DataTableTarget struct {
	// In is the folder of canonical YAML data tables, searched recursively.
	In string `yaml:"in" schema:"required"`
	// Out is the folder the filtered YAML data tables are written to.
	Out string `yaml:"out" schema:"required"`
	// Side is which side reads the written tables: "client" or "server".
	Side string `yaml:"side" schema:"required,enum=client|server"`
}

DataTableTarget filters every YAML data table under In through its registered Go row type and writes canonical version 1 YAML containing only the columns read by Side under Out.

type Delay

type Delay struct {
	// Time is the echo spacing, such as 250ms; it must be positive.
	Time time.Duration `yaml:"time" schema:"required"`
	// Feedback is the feedback gain in [0, 0.99].
	Feedback float64 `yaml:"feedback,omitempty" schema:"minimum=0,maximum=0.99"`
	// Wet is the wet mix level in [0, 1].
	Wet float64 `yaml:"wet,omitempty" schema:"minimum=0,maximum=1"`
}

Delay is a feedback delay line (sound.Delay).

type Display

type Display struct {
	// Width is the virtual canvas width in game points; it must be positive.
	Width float32 `yaml:"width" schema:"required,exclusiveMinimum=0"`
	// Height is the virtual canvas height in game points; it must be positive.
	Height float32 `yaml:"height" schema:"required,exclusiveMinimum=0"`
	// Mode is how the canvas fits a window of another aspect ratio: "fit" (the default when empty), "fill", "stretch" or "expand", as screen.Mode names them.
	Mode string `yaml:"mode,omitempty" schema:"enum=fit|fill|stretch|expand"`
	// IntegerScale scales by whole multiples only, as screen.Viewport.IntegerScale does.
	IntegerScale bool `yaml:"integerScale,omitempty"`
	// PixelSnap aligns the canvas to whole points, as screen.Viewport.PixelSnap does.
	PixelSnap bool `yaml:"pixelSnap,omitempty"`
	// BarColor is the CSS color of letterbox and pillarbox bars, parsed with core.ParseColor; empty is opaque black.
	BarColor string `yaml:"barColor,omitempty"`
}

Display is the virtual resolution a screen.Viewport maps onto the window.

type DisplayOverride

type DisplayOverride struct {
	// Width overrides Display.Width; must be positive when set.
	Width *float32 `yaml:"width,omitempty" schema:"exclusiveMinimum=0"`
	// Height overrides Display.Height; must be positive when set.
	Height *float32 `yaml:"height,omitempty" schema:"exclusiveMinimum=0"`
	// Mode overrides Display.Mode ("fit", "fill", "stretch", or "expand").
	Mode *string `yaml:"mode,omitempty" schema:"enum=fit|fill|stretch|expand"`
	// IntegerScale overrides Display.IntegerScale.
	IntegerScale *bool `yaml:"integerScale,omitempty"`
	// PixelSnap overrides Display.PixelSnap.
	PixelSnap *bool `yaml:"pixelSnap,omitempty"`
	// BarColor overrides Display.BarColor.
	BarColor *string `yaml:"barColor,omitempty"`
}

DisplayOverride overrides individual fields of Display; omitted fields keep the base value.

type Distortion

type Distortion struct {
	// Shape is clip, tanh or fold.
	Shape string `yaml:"shape" schema:"required,enum=clip|tanh|fold"`
	// DriveDB is how much the signal is driven before shaping, in dB.
	DriveDB float64 `yaml:"driveDb,omitempty"`
	// Mix is the dry/wet mix from 0 to 1.
	Mix float64 `yaml:"mix,omitempty" schema:"minimum=0,maximum=1"`
}

Distortion drives a signal and shapes it with a transfer curve (sound.Distortion).

type EOS

type EOS struct {
	// ProductID is the Epic Developer Portal Product ID.
	ProductID string `yaml:"productId" schema:"required"`
	// SandboxID is the Epic Developer Portal Sandbox ID.
	SandboxID string `yaml:"sandboxId" schema:"required"`
	// DeploymentID is the Epic Developer Portal Deployment ID.
	DeploymentID string `yaml:"deploymentId" schema:"required"`
	// ClientID is the EOS Desktop Client Policy ClientId.
	ClientID string `yaml:"clientId,omitempty"`
	// ClientSecret is the optional EOS Desktop Client Policy ClientSecret; omit it here and set eos.Config.ClientSecret from CI or environment variables if you prefer to keep it out of version control.
	ClientSecret string `yaml:"clientSecret,omitempty"`
	// ProductName overrides File.Name when calling EOS_Initialize.
	ProductName string `yaml:"productName,omitempty"`
	// ProductVersion overrides File.AppVersion when calling EOS_Initialize.
	ProductVersion string `yaml:"productVersion,omitempty"`
	// EncryptionKey is an optional 64-hex-character key used by EOS storage and stats.
	EncryptionKey string `yaml:"encryptionKey,omitempty"`
	// DisableOverlay disables the Epic Social Overlay when true.
	DisableOverlay bool `yaml:"disableOverlay,omitempty"`
}

EOS configures Epic Online Services product and client identifiers for desktop Epic Games Store builds (see pkg/online/eos).

type EQ

type EQ struct {
	// Bands are the peaking bands, at least one.
	Bands []EQBand `yaml:"bands" schema:"required,minItems=1"`
}

EQ is the peaking bands sound.EQ applies in order.

type EQBand

type EQBand struct {
	// Hz is the band center or shelf corner in hertz; it must be positive.
	Hz float64 `yaml:"hz" schema:"required,exclusiveMinimum=0"`
	// GainDB is the boost or cut in dB.
	GainDB float64 `yaml:"gainDb" schema:"required"`
	// Q is the band's resonance; 0 is Butterworth.
	Q float64 `yaml:"q,omitempty" schema:"minimum=0"`
	// Kind selects the band shape: peaking (default when empty), lowShelf or highShelf.
	Kind string `yaml:"kind,omitempty" schema:"enum=peaking|lowShelf|highShelf"`
}

EQBand is one band of EQ.

type EditorVersion1

type EditorVersion1 struct {
	// Plugins names the editor plugins the project turns on, in the order their panels and tools appear; each becomes a version 2 plugins entry. Each name is unique and has no spaces or control characters.
	Plugins []string `yaml:"plugins,omitempty,flow"`
}

EditorVersion1 is version 1's editor section.

type Effect

type Effect struct {
	// LowPass is a biquad low-pass filter.
	LowPass *Filter `yaml:"lowPass,omitempty,flow"`
	// HighPass is a biquad high-pass filter.
	HighPass *Filter `yaml:"highPass,omitempty,flow"`
	// Delay is a feedback delay line.
	Delay *Delay `yaml:"delay,omitempty,flow"`
	// Reverb is a Freeverb-style reverb.
	Reverb *Reverb `yaml:"reverb,omitempty,flow"`
	// Gain scales every sample by a non-negative factor.
	Gain *Gain `yaml:"gain,omitempty,flow"`
	// Bitcrush quantizes bit depth and sample rate.
	Bitcrush *Bitcrush `yaml:"bitcrush,omitempty,flow"`
	// BandPass keeps the band around its frequency.
	BandPass *BandFilter `yaml:"bandPass,omitempty,flow"`
	// Notch cuts the band around its frequency.
	Notch *BandFilter `yaml:"notch,omitempty,flow"`
	// PeakingEQ boosts or cuts one band by gain.
	PeakingEQ *GainFilter `yaml:"peakingEq,omitempty,flow"`
	// LowShelf raises or lowers everything below its frequency.
	LowShelf *GainFilter `yaml:"lowShelf,omitempty,flow"`
	// HighShelf raises or lowers everything above its frequency.
	HighShelf *GainFilter `yaml:"highShelf,omitempty,flow"`
	// EQ shapes several peaking bands in order.
	EQ *EQ `yaml:"eq,omitempty,flow"`
	// Compressor compresses levels above its threshold.
	Compressor *Compressor `yaml:"compressor,omitempty,flow"`
	// Limiter clips every sample to its ceiling.
	Limiter *Limiter `yaml:"limiter,omitempty,flow"`
	// Distortion shapes a driven signal.
	Distortion *Distortion `yaml:"distortion,omitempty,flow"`
	// Chorus adds a modulated delay copy.
	Chorus *Chorus `yaml:"chorus,omitempty,flow"`
	// Phaser sweeps all-pass stages with feedback.
	Phaser *Phaser `yaml:"phaser,omitempty,flow"`
	// PitchShift retunes by semitones without changing duration.
	PitchShift *PitchShift `yaml:"pitchShift,omitempty,flow"`
	// Panner moves a stereo signal between channels.
	Panner *Panner `yaml:"panner,omitempty,flow"`
	// StereoWidth narrows or widens a stereo signal.
	StereoWidth *StereoWidth `yaml:"stereoWidth,omitempty,flow"`
	// Custom is a plugin-registered bus effect built through sound.RegisterEffect.
	Custom *CustomEffect `yaml:"custom,omitempty"`
}

Effect is one DSP effect on a bus; exactly one field must be set.

func (Effect) BusEffect

func (e Effect) BusEffect() sound.BusEffect

BusEffect returns e as a sound.BusEffect, nil when no field is set.

type Entry

type Entry struct {
	// Name uniquely identifies the entry within its list.
	Name string `yaml:"name" schema:"required"`
	// Path is the file's slash-separated path relative to the project root, as fs.ValidPath accepts it.
	Path string `yaml:"path" schema:"required"`
}

Entry is one autoloaded file.

type Export

type Export struct {
	// Output is the directory builds are written to; empty is NSGo's default (dist).
	Output string `yaml:"output,omitempty"`
	// Budgets are optional release thresholds checked before and after each build (download size and frame time p95 at a quality profile).
	Budgets *Budgets `yaml:"budgets,omitempty"`
	// AllowResources lists project-relative dotfiles or dot-directories in resources/ that are intentionally shipped. They remain warnings in release readiness.
	AllowResources []string `yaml:"allowResources,omitempty"`
	// Presets are the platforms the game exports to, in build order.
	Presets []Preset `yaml:"presets,omitempty"`
}

Export holds the build output directory, optional release budgets, and one export preset per platform.

func (*Export) Validate

func (e *Export) Validate() error

Validate checks e's output path, release budgets, allowResources paths, and export presets.

type File

type File struct {
	// Version is the schema version; it must equal CurrentVersion (2).
	Version int `yaml:"version" schema:"required"`
	// Name is the game's display name, which nsgo.yaml's name follows.
	Name string `yaml:"name" schema:"required"`
	// ID is the game's reverse-DNS application identifier, such as dev.nsgo.game.examples.caverun, which nsgo.yaml's id follows.
	ID string `yaml:"id" schema:"required"`
	// AppVersion is the game's release version, such as 0.1.0, which nsgo.yaml's version follows.
	AppVersion string `yaml:"appVersion" schema:"required"`
	// Origin records the source used by game new, when the project was copied from a template, example, directory, or pack.
	Origin *Origin `yaml:"origin,omitempty"`
	// Window is the main window's size, limits, title and appearance.
	Window Window `yaml:"window" schema:"required"`
	// Runtime holds process-wide runtime settings applied at startup.
	Runtime *Runtime `yaml:"runtime,omitempty"`
	// Display is the virtual resolution the game draws at; nil draws at the window's own size.
	Display *Display `yaml:"display,omitempty"`
	// Input is the input map bound into an input.Actions; nil binds nothing.
	Input *Input `yaml:"input,omitempty"`
	// Audio holds the master volume and the audio buses a sound.Mixer is configured with; nil configures nothing.
	Audio *Audio `yaml:"audio,omitempty"`
	// Physics holds the default 2D and 3D gravity, solver iterations and named collision layers shared by scenes; nil uses each engine's defaults.
	Physics *Physics `yaml:"physics,omitempty"`
	// VisibilityLayers maps human-readable visibility layer names (such as "p1", "p2", or "minimap") to bit indices in [0, 31], shared by scene objects, layers, and split-screen viewport cull masks.
	VisibilityLayers []VisibilityLayer `yaml:"visibilityLayers,omitempty"`
	// Autoload lists the scenes and resources loaded at startup; nil loads nothing.
	Autoload *Autoload `yaml:"autoload,omitempty"`
	// Export holds the build output directory and the export presets per platform, which nsgo.yaml's build section follows; nil leaves nsgo.yaml without them.
	Export *Export `yaml:"export,omitempty"`
	// Plugins lists the Go plugins enabled for this project, in activation order. Each entry records the plugin's name, Go module path and its own settings; its version is whatever go.mod requires.
	Plugins []Plugin `yaml:"plugins,omitempty"`
	// Assets declares the atlases, textures, audio, fonts, models and asset manifest game assets builds; nil declares none.
	Assets *Assets `yaml:"assets,omitempty"`
	// Navigation holds the settings and agent types game navmesh bakes a scene's navigation meshes with (see the navbake3d package); nil bakes one agent type called DefaultNavAgent with the default settings.
	Navigation *Navigation `yaml:"navigation,omitempty"`
	// Tags points to the project's gameplay tag registry file (see the tags package); nil looks for tags.yaml at the project root when present.
	Tags *Tags `yaml:"tags,omitempty"`
	// Portal configures web-portal SDK integration (Poki, CrazyGames, or automatic page-host detection); nil disables portal SDK loading.
	Portal *Portal `yaml:"portal,omitempty"`
	// L10n configures project localization files such as per-language asset manifests (see the l10n package); nil declares none.
	L10n *L10n `yaml:"l10n,omitempty"`
	// EOS holds Epic Online Services product identifiers and desktop client policy settings (see the online/eos package); nil leaves EOS unconfigured.
	EOS *EOS `yaml:"eos,omitempty"`
	// Packs records the library packs installed into the project, in the order they were first installed: the files each wrote and the autoload entries and editor plugins each added, so that a later install of the pack can update it and a removal can undo it (see the tooling/library package). nil records none.
	Packs []Pack `yaml:"packs,omitempty"`
	// RequireSigned refuses to install a library entry its publisher has not signed (see the tooling/library package). Without it an unsigned entry installs with a warning; a signed entry is verified, and refused when its signature does not verify or its publisher revoked it, either way.
	RequireSigned bool `yaml:"requireSigned,omitempty"`
	// Overrides maps feature tags (built-in platform/build features such as mobile, desktop, web, debug, release, or custom preset features) to partial game.yaml sections merged over the base settings by File.For in feature order.
	Overrides map[string]Override `yaml:"overrides,omitempty"`
}

File is the root of a versioned game.yaml project file.

func Check

func Check(fsys fs.FS) (*File, error)

Check reads the project at the root of fsys and reports every problem a person should fix before running or building it, joined with errors.Join: a game.yaml that fails Parse, an nsgo.yaml beside it that disagrees with it (CheckNSGo), an autoloaded scene or resource that is missing or, for a scene, invalid (LoadAutoloads), and a file an installed pack wrote (File.Packs) that is missing. It returns the parsed file whenever game.yaml parses, so a caller can go on with it after reporting the rest. A project without an nsgo.yaml has nothing to disagree with.

func MustParse

func MustParse(data []byte) *File

MustParse is Parse for a project file that is part of the program, such as an embedded game.yaml: it panics on an invalid file.

func Parse

func Parse(data []byte) (*File, error)

Parse decodes a YAML project file and validates it. Unknown fields and trailing YAML documents are refused. A version 1 file is read and upgraded in memory to version 2, so Encode always writes version 2: its editor section goes, and each plugin it named under editor.plugins becomes a plugins entry wired by hand in the project's own module, which Parse, having no go.mod, takes to be the project's ID. game migrate rewrites the file on disk with each plugin's real module.

func ReadFS

func ReadFS(fsys fs.FS) (*File, error)

ReadFS reads and parses FileName at the root of fsys.

func (*File) Appearance

func (f *File) Appearance() core.Appearance

Appearance returns the appearance the app starts in, as nsgo.Appearance takes it: core.AppearanceSystem when Window.Appearance is empty.

func (*File) ApplyRuntime

func (f *File) ApplyRuntime()

ApplyRuntime applies the runtime settings for the platform the game runs on: the LimitMB entry of that platform (macos on darwin, web on js, otherwise the GOOS name) as the Go soft memory limit, and GCPercent. A missing platform entry leaves the memory limit unchanged.

func (*File) BindInput

func (f *File) BindInput(a *input.Actions)

BindInput binds every action with bindings, mapping context, axis, motion axis, gamepad axis and 2D vector of the input map into a, replacing a's bindings of the same names and leaving others, such as ones the game binds in code, as they are. When any action declares an Assist block, BindInput also registers each declared action's input.ActionAssist on a so undeclared actions (such as menu controls) are never latched by player assists.

func (*File) BuildTargets

func (f *File) BuildTargets() []string

BuildTargets returns the unique NSGo build targets of every export preset in first-seen order: each preset's Targets, or its platform name when it lists none. It returns nil without export presets.

func (*File) CheckNSGo

func (f *File) CheckNSGo(nsgoYAML []byte) error

CheckNSGo reports the fields of nsgoYAML, an nsgo.yaml's contents, that disagree with f: name, id, version, appearance, build.output and build.targets, which game.yaml owns. For build.targets, both the portable cross-host targets (written by SyncNSGo) and the full BuildTargets list are accepted. It returns nil when they all agree.

func (*File) Clone

func (f *File) Clone() *File

Clone returns a deep copy of f, which Validate accepts exactly when it accepts f.

func (*File) ConfigureMixer

func (f *File) ConfigureMixer(m *sound.Mixer)

ConfigureMixer gives m the default master volume, global voice budget, each bus's default volume and DSP chain, shared concurrency groups, and bus ducking rules. Volumes the player kept in storage win over the defaults. A bus without effects leaves the chain the game set in code, as BindInput leaves the bindings of an action without any.

func (*File) ConfigurePhysics3DWorld

func (f *File) ConfigurePhysics3DWorld(w *physics3d.World)

ConfigurePhysics3DWorld applies the project's 3D gravity and solver iterations to w.

func (*File) ConfigurePhysicsWorld

func (f *File) ConfigurePhysicsWorld(w *physics.World)

ConfigurePhysicsWorld applies the project's 2D gravity to w when Physics.Gravity2D is set.

func (*File) ConfigureRigidWorld

func (f *File) ConfigureRigidWorld(w *physics.RigidWorld)

ConfigureRigidWorld applies the project's 2D gravity and solver iterations to w.

func (*File) ConfigureSoftwareMixer

func (f *File) ConfigureSoftwareMixer(m *sound.SoftwareMixer)

ConfigureSoftwareMixer installs each declared audio bus's stateful effect chain (including sidechain compressors and lookahead limiters) on m.

func (*File) EOSConfig

func (f *File) EOSConfig() (eos.Config, bool)

EOSConfig returns the Epic Online Services configuration declared under eos in game.yaml, or zero and false when the project declares no eos section. ProductName and ProductVersion default to File.Name and File.AppVersion when omitted.

func (*File) EachPath

func (f *File) EachPath(visit func(field string, path *string))

EachPath calls visit with every non-empty path f holds to a file or folder of the project, as PathRefs lists them, so that visit can read or change it in place, as a tool that moves a file does.

func (*File) FindPack

func (f *File) FindPack(name string) *Pack

FindPack returns the installed pack called name, or nil.

func (*File) FindPlugin

func (f *File) FindPlugin(name string) *Plugin

FindPlugin returns the enabled plugin entry called name, or nil.

func (*File) For

func (f *File) For(features []string) *File

For returns a deep copy of f with each matching entry in f.Overrides merged over the base settings in the order features are listed. Unknown features in features are ignored; the returned File has Overrides cleared so it represents the resolved view and never mutates f.

func (*File) Fullscreen

func (f *File) Fullscreen() bool

Fullscreen reports the requested startup fullscreen state, or false when the project leaves it at the platform default.

func (*File) LDtkOptions

func (f *File) LDtkOptions(resolveImage func(relPath string) core.ImageSource) tilemap.LDtkOptions

LDtkOptions builds a tilemap.LDtkOptions using f's physics.ldtkIntGrid rules and resolveImage.

func (*File) LoadAutoloads

func (f *File) LoadAutoloads(fsys fs.FS) (*Loaded, error)

LoadAutoloads reads every autoloaded scene and resource from fsys, the project root, parsing and validating the scenes. It fails on the first file that is missing or, for a scene, invalid.

func (*File) OverrideFeaturesForField

func (f *File) OverrideFeaturesForField(fieldPath string) []string

OverrideFeaturesForField returns the sorted feature names in f.Overrides that set fieldPath (for example "display.mode", "window.width", or "audio.buses").

func (*File) PhysicsLayerTable

func (f *File) PhysicsLayerTable() *sceneformat.PhysicsLayerTable

PhysicsLayerTable returns the project's named collision layer table, or nil when File.Physics is nil.

func (*File) PhysicsSettings

func (f *File) PhysicsSettings() *sceneformat.PhysicsSettings

PhysicsSettings converts File.Physics into a *sceneformat.PhysicsSettings for sceneformat.BuildPhysics. It returns nil when f or f.Physics is nil.

func (*File) PluginSettings

func (f *File) PluginSettings(name string) map[string]any

PluginSettings returns a copy of the settings game.yaml stores for the plugin called name: only the keys the project sets, with each value as YAML decodes it (bool, int, float64, string, nil, or a list or mapping of them). It returns nil when the plugin is not listed under plugins: or sets nothing. A game reads its plugins' settings through it without the editor and applies the plugin's own defaults to the keys it leaves out.

func (*File) PortableBuildTargets

func (f *File) PortableBuildTargets() []string

PortableBuildTargets returns the subset of BuildTargets that every host can build with plain `nsgo build` (omitting Apple targets and android_x64). It returns nil when BuildTargets has no portable targets.

func (*File) Preset

func (f *File) Preset(platform string) (Preset, bool)

Preset returns the export preset for platform.

func (*File) PresetByName

func (f *File) PresetByName(name string) (Preset, bool)

PresetByName returns the export preset whose Name equals name, or an unnamed preset whose Platform equals name.

func (*File) Region

func (f *File) Region(action string) (core.Bounds, bool)

Region returns the first region bound to action, as a game draws its on-screen control there, and false when the action has no region binding.

func (*File) ResolveFieldSource

func (f *File) ResolveFieldSource(fieldPath string, features []string) string

ResolveFieldSource returns the winning feature name from features whose override sets fieldPath, or "" when fieldPath comes from the base game.yaml.

func (*File) SyncNSGo

func (f *File) SyncNSGo(nsgoYAML []byte) ([]byte, error)

SyncNSGo returns nsgoYAML, an nsgo.yaml's contents (empty for a new one), with the fields game.yaml owns set from f: name, id, version, appearance, build.output and build.targets (filtered to cross-host targets when any preset is portable so plain `nsgo build` succeeds on every host). Fields f leaves empty are removed; every other key and comment is kept.

func (*File) Title

func (f *File) Title() string

Title returns the window's title: Window.Title, or Name when it is empty.

func (*File) TitleBar

func (f *File) TitleBar() core.TitleBarStyle

TitleBar returns the desktop title bar style for nsgo.WindowTitleBar. Game projects hide the system title bar by default; "system" restores it.

func (*File) Viewport

func (f *File) Viewport() (screen.Viewport, bool)

Viewport returns the screen.Viewport of the virtual resolution, and false without a Display.

func (*File) VisibilityLayerMask

func (f *File) VisibilityLayerMask(names ...string) (uint32, error)

VisibilityLayerMask resolves visibility layer names into a 32-bit bitmask.

func (*File) VisibilityLayerTable

func (f *File) VisibilityLayerTable() *sceneformat.VisibilityLayerTable

VisibilityLayerTable returns the project's named visibility layer table, or nil when File.VisibilityLayers is empty.

func (*File) WindowConstraints

func (f *File) WindowConstraints() core.WindowConstraints

WindowConstraints returns the main window's size limits and whether the user may resize it, as nsgo.WindowConstraints takes them.

func (*File) WindowSize

func (f *File) WindowSize() (width, height core.Points)

WindowSize returns the main window's starting content size, as nsgo.WindowSize takes it: nsgo.WindowSize(f.WindowSize()).

type FileVersion1

type FileVersion1 struct {
	File `yaml:",inline"`
	// Editor is the scene editor's settings, which version 2 removed.
	Editor *EditorVersion1 `yaml:"editor,omitempty"`
}

FileVersion1 is the version 1 project file that Parse reads and upgrades: version 2's fields except plugins, which version 1 refuses, plus the editor section that version 2 replaced with plugins.

type Filter

type Filter struct {
	// CutoffHz is the cutoff frequency in hertz; it must be positive.
	CutoffHz float64 `yaml:"cutoffHz" schema:"required,exclusiveMinimum=0"`
	// Q is the filter's quality factor; 0 is Butterworth.
	Q float64 `yaml:"q,omitempty" schema:"minimum=0"`
}

Filter is a biquad low-pass or high-pass filter (sound.LowPass, sound.HighPass).

type FontTarget

type FontTarget struct {
	// In is the .ttf or .otf font file, or a folder of PNG glyph images when the path has no .ttf or .otf extension.
	In string `yaml:"in"`
	// Out is the .fnt file written; the pages are written beside it.
	Out string `yaml:"out"`
	// Size is the font size in pixels the glyphs are drawn at; 0 is DefaultFontSize. A folder of glyph images keeps its images' pixels instead.
	Size int `yaml:"size,omitempty"`
	// Chars are the characters baked, each once, in any order; empty is DefaultFontChars when CharsFrom and CharsFile are also empty. When CharsFrom or CharsFile is set, Chars is merged with the characters collected from them. A character the font has no glyph for is left out. A folder of glyph images bakes every image it holds instead.
	Chars string `yaml:"chars,omitempty"`
	// CharsFrom lists slash-separated project-relative files whose text characters are collected and merged into the baked set: versioned YAML or JSON localization string tables (all strings and plural forms, with {placeholders} and rich-text markup stripped), YAML data tables (*.table.yaml, all string cells), and scene files (*.scene.yaml). A folder of glyph images refuses CharsFrom.
	CharsFrom []string `yaml:"charsFrom,omitempty"`
	// CharsFile is a slash-separated project-relative UTF-8 plain-text file whose non-control characters are merged into the baked set. A folder of glyph images refuses CharsFile.
	CharsFile string `yaml:"charsFile,omitempty"`
	// Locale is the optional normalized BCP-47 locale tag (such as "zh-Hans" or "en") this font target is meant to draw, checked by game check against that locale's localization string tables. When omitted, game check infers the locale from any localization string tables listed in CharsFrom.
	Locale string `yaml:"locale,omitempty"`
	// Padding is the transparent gap around each glyph on the pages in pixels; nil is 1.
	Padding *int `yaml:"padding,omitempty"`
	// Glyphs maps a glyph image's slash-separated path relative to In to the character it draws, for images whose base name's stem is not one character, such as "plus.png": "+". A folder input only takes it.
	Glyphs map[string]string `yaml:"glyphs,omitempty"`
	// Spacing is the extra advance in pixels after each glyph of a folder input.
	Spacing int `yaml:"spacing,omitempty"`
	// Align is where each glyph of a folder input sits in the line: "top", "center" or "bottom"; empty is "bottom".
	Align string `yaml:"align,omitempty"`
}

FontTarget is one TrueType or OpenType font, or one folder of PNG glyph images, baked into an AngelCode BMFont, which text.LoadBMFont reads: a text .fnt file and the PNG pages its glyphs are packed on, named after it, such as hud.png beside hud.fnt, or hud-0.png, hud-1.png and so on when the glyphs need several pages.

func (FontTarget) FontPages

func (t FontTarget) FontPages() (dir, name string)

FontPages returns the slash-separated folder a font target writes its pages to and the name they are named after: Out's folder and its base name without the .fnt extension.

func (FontTarget) GlyphFolder

func (t FontTarget) GlyphFolder() bool

GlyphFolder reports whether the font target bakes from a folder of PNG glyph images rather than a TrueType or OpenType font file: In has no .ttf or .otf extension.

type Gain

type Gain struct {
	// Factor is the non-negative linear gain multiplier.
	Factor float64 `yaml:"factor" schema:"required,minimum=0"`
}

Gain scales every sample by Factor (sound.Gain), which must be finite and non-negative.

type GainFilter

type GainFilter struct {
	// Hz is the band center for a peaking filter, or the shelf corner; it must be positive.
	Hz float64 `yaml:"hz" schema:"required,exclusiveMinimum=0"`
	// GainDB is the boost or cut in dB.
	GainDB float64 `yaml:"gainDb" schema:"required"`
	// Q is the resonance; 0 is Butterworth.
	Q float64 `yaml:"q,omitempty" schema:"minimum=0"`
}

GainFilter is a peaking or shelf filter around Hz with GainDB (sound.PeakingEQ, sound.LowShelf, sound.HighShelf).

type GamepadAxis

type GamepadAxis struct {
	// Name uniquely identifies the gamepad axis.
	Name string `yaml:"name" schema:"required"`
	// Axis is "leftX", "leftY", "rightX" or "rightY".
	Axis string `yaml:"axis" schema:"required,enum=leftX|leftY|rightX|rightY"`
	// DeadZone is the stick deflection below which the axis reads 0, strictly less than 1; 0 uses input.DefaultGamepadDeadZone and a negative value turns the dead zone off.
	DeadZone float64 `yaml:"deadZone,omitempty" schema:"exclusiveMaximum=1"`
	// Axial applies DeadZone to this axis alone instead of radially over both axes of the stick.
	Axial bool `yaml:"axial,omitempty"`
	// Sensitivity multiplies the dead-zoned reading before clamping to [-1, 1]; 0 uses 1.
	Sensitivity float64 `yaml:"sensitivity,omitempty" schema:"minimum=0"`
	// Invert negates the resulting axis value.
	Invert bool `yaml:"invert,omitempty"`
}

GamepadAxis is a named axis read from a connected game controller's analog stick, as input.Actions.BindGamepadAxis binds it.

type Input

type Input struct {
	// Actions are the named actions in the order they are declared.
	Actions []Action `yaml:"actions,omitempty"`
	// Contexts are named mapping contexts with priorities; an enabled context's bindings consume their physical inputs so lower-priority contexts and top-level actions do not see them.
	Contexts []InputContext `yaml:"contexts,omitempty"`
	// Axes are the named axes, each reading -1 for its negative action and +1 for its positive one.
	Axes []Axis `yaml:"axes,omitempty"`
	// MotionAxes are the named axes read from the device's tilt and gyroscope.
	MotionAxes []MotionAxis `yaml:"motionAxes,omitempty"`
	// GamepadAxes are the named axes read from a connected game controller's analog sticks.
	GamepadAxes []GamepadAxis `yaml:"gamepadAxes,omitempty"`
	// Vectors are named 2D actions read by input.Actions.Vector, normalized to length 1 by default.
	Vectors []Vector `yaml:"vectors,omitempty"`
}

Input is a game's input map: named actions with their physical bindings, prioritized mapping contexts, axes over pairs of actions, device motion axes, game controller stick axes and 2D vector actions.

type InputContext

type InputContext struct {
	// Name uniquely identifies the mapping context.
	Name string `yaml:"name" schema:"required"`
	// Priority orders contexts: a higher priority takes precedence, and among equal priorities the context pushed last does.
	Priority int `yaml:"priority,omitempty"`
	// Enabled controls whether BindInput leaves this context enabled after pushing it; omitted defaults to true.
	Enabled *bool `yaml:"enabled,omitempty"`
	// Actions are the context's named actions and their bindings in declaration order.
	Actions []Action `yaml:"actions,omitempty"`
}

InputContext is a named set of action bindings with a priority for one mode of play, such as walking, driving or a menu.

type InputOverride

type InputOverride struct {
	// Actions replaces Input.Actions when non-nil.
	Actions []Action `yaml:"actions,omitempty"`
	// Axes replaces Input.Axes when non-nil.
	Axes []Axis `yaml:"axes,omitempty"`
	// MotionAxes replaces Input.MotionAxes when non-nil.
	MotionAxes []MotionAxis `yaml:"motionAxes,omitempty"`
	// GamepadAxes replaces Input.GamepadAxes when non-nil.
	GamepadAxes []GamepadAxis `yaml:"gamepadAxes,omitempty"`
}

InputOverride overrides individual lists of Input; omitted lists keep the base value.

type L10n

type L10n struct {
	// AssetManifests lists slash-separated paths relative to the project root to versioned YAML localized asset manifests (see the l10n package), such as "assets.yaml" or "l10n/assets.yaml".
	AssetManifests []string `yaml:"assetManifests,omitempty"`
}

L10n configures project localization files checked by game check and rewritten by game mv.

type LDtkIntGridRule

type LDtkIntGridRule struct {
	// Name matches an LDtk IntGrid value identifier or IntGrid value group identifier (case-insensitive).
	Name string `yaml:"name,omitempty"`
	// Value matches a positive numeric LDtk IntGrid value (1, 2, ...).
	Value int `yaml:"value,omitempty" schema:"minimum=0"`
	// Solid sets tilemap.TileSolid on matching IntGrid cells.
	Solid bool `yaml:"solid,omitempty"`
	// OneWay sets tilemap.TileOneWay on matching IntGrid cells.
	OneWay bool `yaml:"oneWay,omitempty"`
	// Flags sets additional game-defined tilemap.TileFlags bits on matching IntGrid cells alongside Solid and OneWay.
	Flags uint32 `yaml:"flags,omitempty"`
}

LDtkIntGridRule maps one LDtk IntGrid value (by identifier/group name or positive numeric value) to tile collision flags. Exactly one of Name or Value must be set; leaving Solid, OneWay, and Flags all unset explicitly maps matching cells to 0 (non-colliding).

func (LDtkIntGridRule) TileFlags

func (r LDtkIntGridRule) TileFlags() tilemap.TileFlags

TileFlags returns the combined tilemap.TileFlags produced by r.

type Limiter

type Limiter struct {
	// CeilingDB is the loudest level a sample may reach.
	CeilingDB float64 `yaml:"ceilingDb" schema:"required"`
	// ReleaseMs is the lookahead limiter's release time in milliseconds; 0 uses a sample clipper.
	ReleaseMs float64 `yaml:"releaseMs,omitempty" schema:"minimum=0"`
}

Limiter limits every sample to its ceiling; when ReleaseMs is positive it runs as a lookahead true-peak limiter (sound.LookaheadLimiter).

type Loaded

type Loaded struct {
	// MainScene is the name of the scene the game starts in, empty when the project names none.
	MainScene string
	// Scenes are the parsed and validated autoloaded scenes by name.
	Scenes map[string]*sceneformat.SceneDoc
	// Resources are the autoloaded resources' bytes by name.
	Resources map[string][]byte
}

Loaded holds the autoloaded scenes and resources of a project.

func (*Loaded) Main

func (l *Loaded) Main() *sceneformat.SceneDoc

Main returns the main scene, nil when the project names none.

type ManifestTarget

type ManifestTarget struct {
	// In is the assets folder scanned.
	In string `yaml:"in"`
	// Out is the .go file written.
	Out string `yaml:"out"`
	// Package is the generated file's package name; empty is "assets".
	Package string `yaml:"package,omitempty"`
	// Prefix is prepended to each asset's path to form its URI; empty is "asset:".
	Prefix string `yaml:"prefix,omitempty"`
	// Embed emits //go:embed directives instead of URI references.
	Embed bool `yaml:"embed,omitempty"`
	// EmbedDir is prepended to the //go:embed patterns.
	EmbedDir string `yaml:"embedDir,omitempty"`
}

ManifestTarget is the typed Go asset manifest generated from a folder of assets, as game manifest generates it.

type ModelTarget

type ModelTarget struct {
	// In is the .gltf or .glb file; the buffers and images it references by relative path are read beside it.
	In string `yaml:"in"`
	// Out is the .glb file written.
	Out string `yaml:"out"`
	// Scale multiplies the size of every scene of the model, such as 0.01 for a model exported in centimeters; 0 is 1.
	Scale float64 `yaml:"scale,omitempty"`
	// Animations keeps the model's animations when true and leaves them out when false; nil is true.
	Animations *bool `yaml:"animations,omitempty"`
	// TextureFormat, when set (one of ModelTextureFormats, such as "uastc"), converts the model's PNG and JPEG textures into KTX2 containers using KHR_texture_basisu while packing the GLB. Empty keeps the model's images as written.
	TextureFormat string `yaml:"textureFormat,omitempty" schema:"enum=uastc"`
}

ModelTarget is one glTF model packed into a single binary glTF (.glb) file: its buffers merged into the file's binary chunk and the images it references by file embedded, so the game loads one file.

type Modifier

type Modifier struct {
	// Kind is "negate", "swizzle" or "scale".
	Kind string `yaml:"kind" schema:"required,enum=negate|swizzle|scale"`
	// Scale uniformly multiplies the value when Kind is "scale" and X/Y are omitted; must be finite and positive. Refused by other kinds.
	Scale float64 `yaml:"scale,omitempty" schema:"minimum=0"`
	// X multiplies the X component when Kind is "scale"; must be finite and non-negative. Refused by other kinds.
	X float64 `yaml:"x,omitempty" schema:"minimum=0"`
	// Y multiplies the Y component when Kind is "scale"; must be finite and non-negative. Refused by other kinds.
	Y float64 `yaml:"y,omitempty" schema:"minimum=0"`
}

Modifier transforms an evaluated binding or vector value.

func (Modifier) InputModifier

func (m Modifier) InputModifier() input.Modifier

InputModifier returns m as an input.Modifier.

type MotionAxis

type MotionAxis struct {
	// Name uniquely identifies the motion axis.
	Name string `yaml:"name" schema:"required"`
	// Axis is "tiltX", "tiltY", "tiltZ", "gyroX", "gyroY" or "gyroZ".
	Axis string `yaml:"axis" schema:"required,enum=tiltX|tiltY|tiltZ|gyroX|gyroY|gyroZ"`
	// DeadZone is the sensor dead zone in [0, 1); 0 takes input.MotionAxisOptions' default.
	DeadZone float64 `yaml:"deadZone,omitempty" schema:"minimum=0,exclusiveMaximum=1"`
	// Sensitivity scales the reading; 0 takes input.MotionAxisOptions' default.
	Sensitivity float64 `yaml:"sensitivity,omitempty" schema:"minimum=0"`
	// MaxRange is the full-deflection sensor range; 0 takes input.MotionAxisOptions' default.
	MaxRange float64 `yaml:"maxRange,omitempty" schema:"minimum=0"`
	// Smoothing is the low-pass smoothing factor in [0, 1); 0 disables smoothing.
	Smoothing float64 `yaml:"smoothing,omitempty" schema:"minimum=0,exclusiveMaximum=1"`
	// Invert negates the resulting axis value.
	Invert bool `yaml:"invert,omitempty"`
}

MotionAxis is a named axis read from a device motion sensor, as input.Actions.BindMotionAxis binds it.

type NavAgent struct {
	// Name uniquely identifies the agent type, such as "humanoid".
	Name string `yaml:"name"`
	// Radius is how far the mesh keeps from walls and ledges.
	Radius float32 `yaml:"radius,omitempty"`
	// Height is the clearance the agent needs.
	Height float32 `yaml:"height,omitempty"`
	// MaxSlope is the steepest walkable slope in degrees, below 90.
	MaxSlope float32 `yaml:"maxSlope,omitempty"`
	// MaxClimb is the highest step the agent climbs.
	MaxClimb float32 `yaml:"maxClimb,omitempty"`
}

NavAgent is one agent type navigation meshes are baked for, as navbake3d.AgentType defines it; each size 0 or omitted takes navbake3d's default.

type Navigation struct {
	// CellSize is the width and depth of one cell of the voxel grid the level is baked on, in world units.
	CellSize float32 `yaml:"cellSize,omitempty"`
	// CellHeight is the height of one cell, the precision of heights, clearances and steps.
	CellHeight float32 `yaml:"cellHeight,omitempty"`
	// MinRegionArea is the smallest area of an island of walkable surface that is kept.
	MinRegionArea float32 `yaml:"minRegionArea,omitempty"`
	// MaxEdgeLength is the longest a polygon edge along a wall may be.
	MaxEdgeLength float32 `yaml:"maxEdgeLength,omitempty"`
	// MaxSimplificationError is the farthest a simplified outline may stray from the walkable area.
	MaxSimplificationError float32 `yaml:"maxSimplificationError,omitempty"`
	// MaxVertsPerPoly is the largest number of vertices in one polygon, from 3 to MaxNavVertsPerPoly.
	MaxVertsPerPoly int `yaml:"maxVertsPerPoly,omitempty"`
	// DetailSampleDistance is the spacing of the height samples polygons follow uneven ground with, at least CellSize.
	DetailSampleDistance float32 `yaml:"detailSampleDistance,omitempty"`
	// DetailSampleMaxError is how far the polygons' triangles may stray from the sampled height.
	DetailSampleMaxError float32 `yaml:"detailSampleMaxError,omitempty"`
	// Agents are the agent types a scene gets a navigation mesh each for, in the order the baked file lists them; empty bakes one called DefaultNavAgent.
	Agents []NavAgent `yaml:"agents,omitempty"`
}

Navigation is the navigation mesh bake settings of a project, as navbake3d.Settings defines them: each field 0 or omitted takes navbake3d's default. The scene's own layers are all baked.

type NavigationOverride struct {
	// CellSize overrides Navigation.CellSize.
	CellSize *float32 `yaml:"cellSize,omitempty"`
	// CellHeight overrides Navigation.CellHeight.
	CellHeight *float32 `yaml:"cellHeight,omitempty"`
	// MinRegionArea overrides Navigation.MinRegionArea.
	MinRegionArea *float32 `yaml:"minRegionArea,omitempty"`
	// MaxEdgeLength overrides Navigation.MaxEdgeLength.
	MaxEdgeLength *float32 `yaml:"maxEdgeLength,omitempty"`
	// MaxSimplificationError overrides Navigation.MaxSimplificationError.
	MaxSimplificationError *float32 `yaml:"maxSimplificationError,omitempty"`
	// MaxVertsPerPoly overrides Navigation.MaxVertsPerPoly.
	MaxVertsPerPoly *int `yaml:"maxVertsPerPoly,omitempty"`
	// DetailSampleDistance overrides Navigation.DetailSampleDistance.
	DetailSampleDistance *float32 `yaml:"detailSampleDistance,omitempty"`
	// DetailSampleMaxError overrides Navigation.DetailSampleMaxError.
	DetailSampleMaxError *float32 `yaml:"detailSampleMaxError,omitempty"`
	// Agents replaces Navigation.Agents when non-nil.
	Agents []NavAgent `yaml:"agents,omitempty"`
}

NavigationOverride overrides individual fields of Navigation; omitted fields keep the base value.

type Origin

type Origin struct {
	// Kind is what the project was copied from: template for a template game new embeds, or example, directory or pack.
	Kind string `yaml:"kind"`
	// Source names the source: the Go module of a template, or the module path in the go.mod of the directory a copy was made from (the directory's name when it has none). The path the copy was made from is not recorded, as it belongs to one machine.
	Source string `yaml:"source"`
	// Digest is the SHA-256 digest of the copied source files, using the library listing algorithm.
	Digest string `yaml:"digest,omitempty"`
	// Path is the template's name, such as cards2d, when Kind is template.
	Path string `yaml:"path,omitempty"`
	// Keep lists the template residue warnings game check leaves out for a deliberate as-is copy: rules, data, name, readme or credits.
	Keep []string `yaml:"keep,omitempty,flow"`
}

Origin describes where a project created by game new came from.

type Override

type Override struct {
	// Name overrides the game's display name.
	Name *string `yaml:"name,omitempty"`
	// AppVersion overrides the game's release version.
	AppVersion *string `yaml:"appVersion,omitempty"`
	// Window overrides individual fields of the main window configuration.
	Window *WindowOverride `yaml:"window,omitempty"`
	// Runtime overrides process-wide runtime memory settings.
	Runtime *RuntimeOverride `yaml:"runtime,omitempty"`
	// Display overrides individual fields of the virtual display configuration.
	Display *DisplayOverride `yaml:"display,omitempty"`
	// Input overrides individual lists of the input map.
	Input *InputOverride `yaml:"input,omitempty"`
	// Audio overrides master volume, voice budget, buses, concurrency groups, or ducking rules.
	Audio *AudioOverride `yaml:"audio,omitempty"`
	// Physics overrides 2D/3D gravity, solver iterations, collision layers, or LDtk IntGrid rules.
	Physics *PhysicsOverride `yaml:"physics,omitempty"`
	// Autoload overrides the startup main scene, autoload scenes, or autoload resources.
	Autoload *AutoloadOverride `yaml:"autoload,omitempty"`
	// Navigation overrides 3D navigation mesh bake settings or agent types.
	Navigation *NavigationOverride `yaml:"navigation,omitempty"`
	// Tags overrides the gameplay tag registry file.
	Tags *Tags `yaml:"tags,omitempty"`
}

Override holds partial game.yaml sections merged over the base File when its feature tag is active (see File.For). Only non-nil fields override the base; omitted fields inherit from the base File or earlier overrides in feature order.

type Pack

type Pack struct {
	// Name identifies the pack in its library: lower-case ASCII letters, digits and '-', starting with a letter or digit.
	Name string `yaml:"name" schema:"required"`
	// Kind is one of PackKinds.
	Kind string `yaml:"kind" schema:"required,enum=asset|plugin|template"`
	// PackVersion is the version of the pack that was installed, such as 1.2.0.
	PackVersion string `yaml:"packVersion" schema:"required"`
	// SHA256 is the pack's digest, 64 lower-case hexadecimal digits, which tells one release of the pack from another whatever its version says.
	SHA256 string `yaml:"sha256" schema:"required"`
	// Dir is the slash-separated directory inside the project the pack's files were written to.
	Dir string `yaml:"dir" schema:"required"`
	// Files are the slash-separated paths of the pack's files relative to Dir, sorted and unique.
	Files []string `yaml:"files,omitempty"`
	// Scenes names the autoload scenes the install added.
	Scenes []string `yaml:"scenes,omitempty,flow"`
	// Resources names the autoload resources the install added.
	Resources []string `yaml:"resources,omitempty,flow"`
	// Plugins names the plugins listed under File.Plugins that the pack uses.
	Plugins []string `yaml:"plugins,omitempty,flow"`
}

Pack is one library pack installed into the project. Its files are Dir joined with each of Files, Scenes and Resources name the autoload entries the install added (which must still be in the file; an entry the project held before the install is not the pack's and is not listed), and Plugins names the plugins from File.Plugins that the pack uses.

func (*Pack) Paths

func (p *Pack) Paths() []string

Paths returns the slash-separated paths of p's files from the project root, in the order of Files.

type Panner

type Panner struct {
	// Pan is -1 for the left channel, 0 for equal power and 1 for the right.
	Pan float64 `yaml:"pan" schema:"required,minimum=-1,maximum=1"`
}

Panner moves a stereo signal between the channels (sound.Panner).

type PathRef

type PathRef struct {
	// Field says what the path is, one of the Field constants, such as FieldAtlasIn.
	Field string
	// Node is the YAML scalar that writes the path in the document PathRefs parsed: its Value is the path, and its Line and Column say where it is written.
	Node *yaml.Node
	// Dir reports whether the path names a folder rather than a file.
	Dir bool
	// Output reports whether the path need not exist before game assets runs: what a tool writes, such as an asset target's out, and the manifest's in, the folder the other targets usually write into.
	Output bool
}

PathRef is one path a project file holds to a file or folder of the project, slash-separated and relative to the project root.

func PathRefs

func PathRefs(data []byte) ([]PathRef, error)

PathRefs parses data as a project file, refusing what Parse refuses, and returns every path it holds to a file or folder of the project with the YAML node that writes it, in the order EachPath visits them, so that a tool can check each path or rewrite it in place.

type Phaser

type Phaser struct {
	// RateHz is the sweep rate; it must be positive.
	RateHz float64 `yaml:"rateHz" schema:"required,exclusiveMinimum=0"`
	// Mix is the dry/wet mix from 0 to 1.
	Mix float64 `yaml:"mix,omitempty" schema:"minimum=0,maximum=1"`
	// Feedback feeds the wet output back, from 0 to 0.9.
	Feedback float64 `yaml:"feedback,omitempty" schema:"minimum=0,maximum=0.9"`
}

Phaser sweeps four all-pass stages (sound.Phaser).

type Physics

type Physics struct {
	// Gravity2D is the 2D gravity acceleration in points per second squared (for example {y: 980} in +Y-down screen space); nil leaves 2D gravity at (0, 0).
	Gravity2D *Vec2 `yaml:"gravity2D,omitempty,flow"`
	// Gravity3D is the 3D gravity acceleration in units per second squared (for example {y: -9.81} in Y-up 3D space); nil leaves 3D gravity at physics3d's default (0, -9.81, 0).
	Gravity3D *Vec3 `yaml:"gravity3D,omitempty,flow"`
	// SolverIterations2D is the number of sequential-impulse iterations per 2D rigid step; 0 uses physics.DefaultSolverIterations.
	SolverIterations2D int `yaml:"solverIterations2D,omitempty" schema:"minimum=0"`
	// SolverIterations3D is the number of solver iterations per 3D physics step; 0 uses physics3d's default.
	SolverIterations3D int `yaml:"solverIterations3D,omitempty" schema:"minimum=0"`
	// Layers maps human-readable collision layer names (such as "player", "walls", and "coins") to bit indices in [0, 31], in declaration order.
	Layers []PhysicsLayer `yaml:"layers,omitempty"`
	// LDtkIntGrid maps LDtk IntGrid value identifiers, group identifiers, or numeric values to tilemap.TileFlags when loading .ldtk projects.
	LDtkIntGrid []LDtkIntGridRule `yaml:"ldtkIntGrid,omitempty"`
}

Physics holds the project's default 2D and 3D gravity, solver iterations, named collision layers, and LDtk IntGrid collision flag mappings shared by scenes.

func (*Physics) LDtkOptions

func (p *Physics) LDtkOptions(resolveImage func(relPath string) core.ImageSource) tilemap.LDtkOptions

LDtkOptions builds a tilemap.LDtkOptions using p's LDtkIntGrid rules and resolveImage.

func (*Physics) LayerBit

func (p *Physics) LayerBit(name string) (uint, bool)

LayerBit returns the bit index in [0, 31] assigned to name, and false when p is nil or name is not declared.

func (*Physics) LayerMask2D

func (p *Physics) LayerMask2D(names ...string) (physics.LayerMask, error)

LayerMask2D resolves layer names into a 2D physics.LayerMask.

func (*Physics) LayerMask3D

func (p *Physics) LayerMask3D(names ...string) (physics3d.LayerMask, error)

LayerMask3D resolves layer names into a 3D physics3d.LayerMask.

func (*Physics) LayerTable

func (p *Physics) LayerTable() *sceneformat.PhysicsLayerTable

LayerTable returns p's declared layers as a *sceneformat.PhysicsLayerTable, or nil when p is nil.

type PhysicsLayer

type PhysicsLayer struct {
	// Name uniquely identifies the collision layer, such as "player", "walls", or "coins".
	Name string `yaml:"name" schema:"required"`
	// Bit is the collision bit index in [0, 31], matching LayerBit(Bit).
	Bit int `yaml:"bit" schema:"minimum=0,maximum=31"`
}

PhysicsLayer assigns a human-readable collision layer name to a bit index in [0, 31].

type PhysicsOverride

type PhysicsOverride struct {
	// Gravity2D overrides Physics.Gravity2D.
	Gravity2D *Vec2 `yaml:"gravity2D,omitempty,flow"`
	// Gravity3D overrides Physics.Gravity3D.
	Gravity3D *Vec3 `yaml:"gravity3D,omitempty,flow"`
	// SolverIterations2D overrides Physics.SolverIterations2D.
	SolverIterations2D *int `yaml:"solverIterations2D,omitempty" schema:"minimum=0"`
	// SolverIterations3D overrides Physics.SolverIterations3D.
	SolverIterations3D *int `yaml:"solverIterations3D,omitempty" schema:"minimum=0"`
	// Layers replaces Physics.Layers when non-nil.
	Layers []PhysicsLayer `yaml:"layers,omitempty"`
	// LDtkIntGrid replaces Physics.LDtkIntGrid when non-nil.
	LDtkIntGrid []LDtkIntGridRule `yaml:"ldtkIntGrid,omitempty"`
}

PhysicsOverride overrides individual fields of Physics; omitted fields keep the base value.

type PitchShift

type PitchShift struct {
	// Semitones is the shift from -48 to 48.
	Semitones float64 `yaml:"semitones" schema:"required,minimum=-48,maximum=48"`
}

PitchShift retunes a signal by Semitones without changing its duration (sound.PitchShift).

type Plugin

type Plugin struct {
	// Name uniquely identifies the plugin: 1 to 64 lower-case ASCII letters, digits and '-', starting with a letter or digit.
	Name string `yaml:"name" schema:"required,minLength=1"`
	// Module is the Go module path providing the plugin, or the project's own module path for a plugin wired by hand.
	Module string `yaml:"module" schema:"required,minLength=1"`
	// Settings holds the plugin's per-project settings, keyed by the field names the plugin declares (editor.PluginSettings): only the keys someone set, as the plugin supplies its own defaults. This package keeps it as an opaque mapping of YAML values and writes its keys sorted; the editor checks it against the plugin's fields when the plugin is built in and keeps it unchanged when it is not. Read it with File.PluginSettings.
	Settings map[string]any `yaml:"settings,omitempty"`
}

Plugin enables one Go plugin for the project. A listed plugin is on, and the order of File.Plugins is its activation order in the runtime and editor. Its version is whatever go.mod requires and is not recorded here.

func (Plugin) MarshalYAML

func (p Plugin) MarshalYAML() (any, error)

MarshalYAML writes name, module and, when non-empty, settings with its keys, and those of every mapping inside it, sorted in strict byte order, so the output is deterministic.

type Portal

type Portal struct {
	// Provider selects the web portal SDK: "auto" (detect from the page host), "none" (disabled), "poki", or "crazygames". Empty defaults to "auto" when portal is present.
	Provider string `yaml:"provider,omitempty" schema:"enum=auto|none|poki|crazygames"`
	// ScriptURL optionally overrides the portal SDK script URL loaded on web builds (such as a local SDK stub); empty uses the provider's official CDN script.
	ScriptURL string `yaml:"scriptURL,omitempty"`
}

Portal configures web-portal SDK integration for browser builds.

func (*Portal) EffectiveProvider

func (p *Portal) EffectiveProvider() string

EffectiveProvider returns the portal provider string: "none" when p is nil, "auto" when p.Provider is empty, or p.Provider otherwise.

type Preset

type Preset struct {
	// Name identifies the preset (such as steam-demo); required once two presets share a platform, unique among presets, and free of spaces, path separators, or control characters.
	Name string `yaml:"name,omitempty"`
	// Platform is one of Platforms, such as "web" or "macos".
	Platform string `yaml:"platform" schema:"required,enum=macos|windows|linux|ios|tvos|watchos|android|harmonyos|web|miniprogram"`
	// Targets are the NSGo build targets of the platform to build, such as macos_arm64; empty builds the platform name itself, which NSGo expands to its default targets.
	Targets []string `yaml:"targets,omitempty,flow"`
	// Features are the preset's custom feature tags, such as demo or mobile, each listed once and exposed at run time via project.Features and project.HasFeature and used to merge top-level overrides via File.For.
	Features []string `yaml:"features,omitempty,flow"`
	// Tags are the Go build tags the preset builds with, passed by game release through GOFLAGS, each listed once and made of ASCII letters, digits, underscores and dots.
	Tags []string `yaml:"tags,omitempty,flow"`
	// Include lists slash-separated glob patterns (supporting ** and path.Match wildcards), relative to the project root, of the assets the preset ships.
	Include []string `yaml:"include,omitempty,flow"`
	// Exclude lists slash-separated glob patterns (supporting ** and path.Match wildcards), relative to the project root, of the assets the preset leaves out of embedded assets, the manifest, and packaged resources.
	Exclude []string `yaml:"exclude,omitempty,flow"`
	// Delivery places named asset groups into the main package, named subpackages or the remote origin, and sets the package caps; nil keeps every asset in the single package the platform builds.
	Delivery *AssetDelivery `yaml:"delivery,omitempty"`
}

Preset is one named or single-platform export preset.

func (Preset) EffectiveFeatures

func (p Preset) EffectiveFeatures(target string, release bool) []string

EffectiveFeatures returns the full ordered feature list active when building p for target (optional concrete target; empty uses p.Platform) and build mode: built-in platform features followed by p.Features, without duplicates.

func (Preset) EffectiveName

func (p Preset) EffectiveName() string

EffectiveName returns p.Name when set, or p.Platform for an unnamed single-platform preset.

func (Preset) MatchAsset

func (p Preset) MatchAsset(relPath string) bool

MatchAsset reports whether relPath (a slash-separated path relative to the project root) is included by p's Include and Exclude glob filters.

type Rect

type Rect struct {
	// X is the horizontal origin in virtual points.
	X float32 `yaml:"x,omitempty"`
	// Y is the vertical origin in virtual points.
	Y float32 `yaml:"y,omitempty"`
	// Width is the rectangle's width in virtual points; it must be positive.
	Width float32 `yaml:"width" schema:"required,exclusiveMinimum=0"`
	// Height is the rectangle's height in virtual points; it must be positive.
	Height float32 `yaml:"height" schema:"required,exclusiveMinimum=0"`
}

Rect is an axis-aligned rectangle with a positive size.

func (Rect) Bounds

func (r Rect) Bounds() core.Bounds

Bounds returns r as core.Bounds.

type RemoteTarget

type RemoteTarget struct {
	// In is the folder of assets to publish remotely; when empty, Manifest.In is used, or the outputs built by the other targets when no manifest is configured.
	In string `yaml:"in,omitempty"`
	// Out is the directory written with content-hashed files and remote.yaml, such as "dist/cdn".
	Out string `yaml:"out"`
	// Base is the default origin URL prefix written into remote.yaml, such as "https://cdn.example.com/game/".
	Base string `yaml:"base,omitempty"`
	// Prefix is prepended to each published file's relative path to form its URI in remote.yaml; empty is "asset:".
	Prefix string `yaml:"prefix,omitempty"`
	// Include, when non-empty, limits published files to those matching at least one slash-separated path prefix (ending in "/"), exact relative path, or path.Match glob pattern.
	Include []string `yaml:"include,omitempty"`
}

RemoteTarget publishes loose assets into Out under content-hashed filenames (<name>.<hash8>.<ext>) and writes a remote.yaml manifest mapping each asset URI to its hashed path, byte size and SHA-256 digest.

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver loads a project's assets from its files, as the scene editor and the game read them: the sprite atlases, scene files, materials, physics materials, YAML tilesets and Tiled and LDtk maps a scene names. It is a sceneformat.AssetResolver that also implements sceneformat.SceneResolver, sceneformat.MaterialResolver, sceneformat.PhysicsMaterialResolver and sceneformat.FileResolver, and it lists the project's atlases (AtlasNames) for the editor's asset browser.

A scene names an atlas the way `game check` (package assetcheck) finds it: the name is the path of an atlas JSON file without its .json extension, either from the project root or as the file's base name, and when several atlases match, the one nearest the scene wins (NearestAtlases). An atlas JSON is a JSON file with top-level frames and meta objects, as TexturePacker and Aseprite export them; its meta.image is read from the project relative to the JSON file, so the atlas draws the project's own image. Scene files, materials, tilesets and tilemap sources are paths from the project root.

The walk for atlases skips the directories the go command skips (names starting with "." or "_", and testdata) and the directories of other projects, those holding a game.yaml, nsgo.yaml or go.mod of their own. A Resolver lists the atlases and parses each one once, then serves them until Refresh; scene files and the files ReadFile reads are read again on every request, so a scene saved since is seen at once. A Resolver is safe for use by multiple goroutines.

Example

A Resolver over a project's files builds its scenes with the project's own atlases, found by name nearest the scene as `game check` finds them.

package main

import (
	"fmt"
	"testing/fstest"

	"github.com/nsgo-dev/game/pkg/project"
	"github.com/nsgo-dev/game/pkg/sceneformat"
)

func main() {
	fsys := fstest.MapFS{
		"sprites/actors.json": {Data: []byte(`{"frames": {"hero": {"frame": {"x": 0, "y": 0, "w": 16, "h": 16}}}, "meta": {"image": "actors.png"}}`)},
		"sprites/actors.png":  {Data: []byte("the packed image")},
		"scenes/room.scene.yaml": {Data: []byte(`version: 2
layers:
  - name: actors
    objects:
      - id: hero
        sprite: {atlas: actors, frame: hero}
`)},
	}
	r := project.NewResolver(fsys).ForScene("scenes/room.scene.yaml")
	fmt.Println(r.AtlasNames())

	doc, err := r.Scene("scenes/room.scene.yaml")
	if err != nil {
		fmt.Println(err)
		return
	}
	built, err := sceneformat.Build(doc, r)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Printf("%s\n", built.Object("hero").Atlas.Image.Data)
}
Output:
[actors]
the packed image

func NewResolver

func NewResolver(fsys fs.FS) *Resolver

NewResolver returns a Resolver over fsys, the project's files with paths from its root, such as os.DirFS of the directory holding game.yaml. It finds atlases nearest the project root; ForScene returns one that finds them nearest a scene.

func (*Resolver) Atlas

func (r *Resolver) Atlas(name string) (*sprite.Atlas, error)

Atlas returns the atlas name names, found as Resolver describes. It fails when no atlas matches, when several match at the same distance (name it by its path from the project root instead), and when the matching file or its image does not load.

func (*Resolver) AtlasNames

func (r *Resolver) AtlasNames() []string

AtlasNames returns the names a scene can give the project's atlases, sorted: each atlas's base name when that name finds it from r's scene, as Atlas would, and otherwise its path from the project root without .json. It lists an atlas that does not load too; Atlas reports why. It lets a Resolver serve as the editor's editor.AtlasLister, and returns nil when the project's files cannot be listed.

func (*Resolver) ForScene

func (r *Resolver) ForScene(scenePath string) *Resolver

ForScene returns a Resolver over the same files and caches as r that finds atlases nearest the scene file at scenePath, a slash-separated path from the project root such as "scenes/level.scene.yaml", as `game check` finds a scene's atlases. An empty or invalid scenePath finds them nearest the project root.

func (*Resolver) LDtkOptions

func (r *Resolver) LDtkOptions() tilemap.LDtkOptions

LDtkOptions returns the tilemap.LDtkOptions derived from game.yaml's physics.ldtkIntGrid section, if present, implementing sceneformat.LDtkOptionsResolver so scenes referencing .ldtk sources map IntGrid values from project settings.

func (*Resolver) Library

func (r *Resolver) Library() *resource.Library

Library returns the resource.Library that loads the project's materials and physics materials, so callers such as the scene editor can reload edited material files in place (resource.Library.Reload) until Refresh replaces it.

func (*Resolver) Material

func (r *Resolver) Material(p string) (*resource.Material, error)

Material loads the material file at p, a slash-separated path from the project root, through a resource.Library shared by every Resolver over the project, so every scene that names one file gets the same value until Refresh.

func (*Resolver) PhysicsMaterial

func (r *Resolver) PhysicsMaterial(p string) (*resource.PhysicsMaterial, error)

PhysicsMaterial loads the physics material file at p, a .physics.yaml that a body2d or body3d component names by its path from the project root, through the same resource.Library as Material, so sceneformat.BuildPhysics, which the editor's Play runs, finds the project's physics materials.

func (*Resolver) ReadFile

func (r *Resolver) ReadFile(p string) ([]byte, error)

ReadFile reads the file at p, a slash-separated path from the project root, so that sceneformat.Build reads through it the YAML tilesets layered tilemaps name and the Tiled and LDtk maps tilemap sources name, with the tilesets those refer to, and the editor's tile palette lists their tiles, as sceneformat.FSAssets does. Their images are left as URIs, as FSAssets leaves them.

func (*Resolver) Refresh

func (r *Resolver) Refresh()

Refresh forgets the atlases, materials and physics materials r has listed and loaded, so the next request reads the project's files again: call it after the project's atlases or material files change on disk. It is shared with every Resolver ForScene returned. Until then every scene that names one material file gets the same value.

func (*Resolver) Scene

func (r *Resolver) Scene(p string) (*sceneformat.SceneDoc, error)

Scene reads and parses the scene file at p, a slash-separated path from the project root, as sceneformat.FSScenes does, and names each atlas it names, by its sprites, its overrides' sprites and its inline tilemaps' tilesets, by the atlas's path from the project root without .json when the name finds one atlas nearest p. sceneformat.Build looks up every atlas of a scene and of the scenes it instances or inherits through one resolver, which finds them nearest the open scene, so without this an instanced scene in another directory would draw the atlas nearest the scene instancing it, not the one `game check` finds nearest the instanced file. A name that finds no atlas, or several, is left as it is, for Atlas to report.

func (*Resolver) VisibilityLayers

func (r *Resolver) VisibilityLayers() *sceneformat.VisibilityLayerTable

VisibilityLayers returns the sceneformat.VisibilityLayerTable derived from game.yaml's visibilityLayers section, if present, implementing sceneformat.VisibilityLayerResolver so scenes resolve named visibility layers into 32-bit bitmasks automatically.

type Reverb

type Reverb struct {
	// RoomSize controls reverb decay size in [0, 1].
	RoomSize float64 `yaml:"roomSize,omitempty" schema:"minimum=0,maximum=1"`
	// Damping controls high-frequency attenuation in [0, 1].
	Damping float64 `yaml:"damping,omitempty" schema:"minimum=0,maximum=1"`
	// Wet is the wet mix level in [0, 1].
	Wet float64 `yaml:"wet,omitempty" schema:"minimum=0,maximum=1"`
}

Reverb is a Freeverb-style reverb (sound.Reverb); each field is in [0, 1].

type Runtime

type Runtime struct {
	// Memory configures the Go soft memory limit and GC target.
	Memory *RuntimeMemory `yaml:"memory,omitempty"`
}

Runtime holds process-wide runtime settings applied at startup.

type RuntimeMemory

type RuntimeMemory struct {
	// LimitMB maps a platform name of Platforms, such as macos, ios or web, to the Go soft memory limit in megabytes that ApplyRuntime sets on it.
	LimitMB map[string]int64 `yaml:"limitMB,omitempty"`
	// GCPercent is the Go GC target percentage, from 0 to 1000, that ApplyRuntime sets on every platform; nil leaves the runtime's.
	GCPercent *int `yaml:"gcPercent,omitempty"`
}

RuntimeMemory configures the Go garbage collector per target platform.

type RuntimeOverride

type RuntimeOverride struct {
	// Memory overrides or merges Runtime.Memory settings (LimitMB merges per platform key; GCPercent replaces when non-nil).
	Memory *RuntimeMemory `yaml:"memory,omitempty"`
}

RuntimeOverride overrides process-wide runtime settings; omitted fields keep the base value.

type StereoWidth

type StereoWidth struct {
	// Width is 0 for mono, 1 unchanged and wider above 1.
	Width float64 `yaml:"width" schema:"required,minimum=0,maximum=4"`
}

StereoWidth narrows or widens a stereo signal (sound.StereoWidth).

type Tags

type Tags struct {
	// File is the slash-separated path relative to the project root to a YAML tag registry (such as "tags.yaml" or "data/tags.yaml").
	File string `yaml:"file" schema:"required"`
}

Tags configures the project's gameplay tag registry file.

type TextureTarget

type TextureTarget struct {
	// In is the source image.
	In string `yaml:"in"`
	// Out is the .ktx2 file written.
	Out string `yaml:"out"`
	// Format is one of TextureFormats; empty is rgba8.
	Format string `yaml:"format,omitempty"`
	// Mipmaps writes the whole mipmap chain down to 1x1.
	Mipmaps bool `yaml:"mipmaps,omitempty"`
	// SRGB marks the texture sRGB and filters its mipmaps in linear light.
	SRGB bool `yaml:"srgb,omitempty"`
}

TextureTarget is one PNG or JPEG image encoded into a KTX2 container, as game tex encodes it.

type Trigger

type Trigger struct {
	// Kind is "hold", "tap", "doubleTap", "chord" or "repeat".
	Kind string `yaml:"kind" schema:"required,enum=hold|tap|doubleTap|chord|repeat"`
	// Time is the hold duration, maximum tap duration, or optional repeat initial delay in milliseconds; refused by "chord".
	Time int `yaml:"time,omitempty" schema:"minimum=0"`
	// Interval is the double-tap window or repeat interval in milliseconds; required and positive for "repeat", refused by "hold", "tap" and "chord".
	Interval int `yaml:"interval,omitempty" schema:"minimum=0"`
	// With names the declared action required by a "chord" trigger; refused by other trigger kinds.
	With string `yaml:"with,omitempty"`
}

Trigger configures fixed-step hold, tap, doubleTap, chord or repeat evaluation on a Binding.

func (Trigger) Spec

func (t Trigger) Spec() input.TriggerSpec

Spec returns t as an input.TriggerSpec.

type Vec2

type Vec2 struct {
	// X is the horizontal component.
	X float32 `yaml:"x,omitempty"`
	// Y is the vertical component.
	Y float32 `yaml:"y,omitempty"`
}

Vec2 is a two-dimensional vector in game.yaml, such as 2D gravity.

type Vec3

type Vec3 struct {
	// X is the X-axis component.
	X float32 `yaml:"x,omitempty"`
	// Y is the Y-axis component.
	Y float32 `yaml:"y,omitempty"`
	// Z is the Z-axis component.
	Z float32 `yaml:"z,omitempty"`
}

Vec3 is a three-dimensional vector in game.yaml, such as 3D gravity.

type Vector

type Vector struct {
	// Name uniquely identifies the vector action.
	Name string `yaml:"name" schema:"required"`
	// X names a declared axis or action contributing to the horizontal component.
	X string `yaml:"x,omitempty"`
	// Y names a declared axis or action contributing to the vertical component.
	Y string `yaml:"y,omitempty"`
	// Left names a declared action driving X toward -1.
	Left string `yaml:"left,omitempty"`
	// Right names a declared action driving X toward +1.
	Right string `yaml:"right,omitempty"`
	// Up names a declared action driving Y toward -1.
	Up string `yaml:"up,omitempty"`
	// Down names a declared action driving Y toward +1.
	Down string `yaml:"down,omitempty"`
	// Stick names a gamepad stick ("left" or "right") driving X and Y.
	Stick string `yaml:"stick,omitempty" schema:"enum=left|right"`
	// DeadZone is the stick dead zone strictly less than 1 when Stick is set; 0 uses input.DefaultGamepadDeadZone and a negative value turns it off. Refused without Stick.
	DeadZone float64 `yaml:"deadZone,omitempty" schema:"exclusiveMaximum=1"`
	// Axial applies DeadZone per axis instead of radially when Stick is set. Refused without Stick.
	Axial bool `yaml:"axial,omitempty"`
	// Sensitivity multiplies stick readings when Stick is set; 0 uses 1. Refused without Stick.
	Sensitivity float64 `yaml:"sensitivity,omitempty" schema:"minimum=0"`
	// InvertX negates the stick's horizontal axis when Stick is set. Refused without Stick.
	InvertX bool `yaml:"invertX,omitempty"`
	// InvertY negates the stick's vertical axis when Stick is set. Refused without Stick.
	InvertY bool `yaml:"invertY,omitempty"`
	// Normalize scales vectors longer than 1 back to length 1; omitted defaults to true.
	Normalize *bool `yaml:"normalize,omitempty"`
	// Modifiers transform the vector value in order (negate, swizzle, scale).
	Modifiers []Modifier `yaml:"modifiers,omitempty"`
}

Vector is a named 2D action read by input.Actions.Vector, driven by two axes (X and Y), four directional actions (Left, Right, Up, Down), and/or a gamepad stick ("left" or "right").

func (Vector) Spec

func (v Vector) Spec() input.VectorSpec

Spec returns v as an input.VectorSpec.

type VisibilityLayer

type VisibilityLayer struct {
	// Name uniquely identifies the visibility layer.
	Name string `yaml:"name" schema:"required"`
	// Bit is the visibility bit index in [0, 31], matching 1 << Bit.
	Bit int `yaml:"bit" schema:"minimum=0,maximum=31"`
}

VisibilityLayer assigns a human-readable visibility layer name (such as "p1", "p2", or "minimap") to a bit index in [0, 31], referenced by scene objects and layers and matched against viewport cull masks.

type Window

type Window struct {
	// Title is the window's title; empty uses File.Name.
	Title string `yaml:"title,omitempty"`
	// Width is the window's starting content width in points; it must be positive.
	Width float32 `yaml:"width" schema:"required,exclusiveMinimum=0"`
	// Height is the window's starting content height in points; it must be positive.
	Height float32 `yaml:"height" schema:"required,exclusiveMinimum=0"`
	// MinWidth is the smallest content width the user may resize the window to; 0 is no limit.
	MinWidth float32 `yaml:"minWidth,omitempty" schema:"minimum=0"`
	// MinHeight is the smallest content height the user may resize the window to; 0 is no limit.
	MinHeight float32 `yaml:"minHeight,omitempty" schema:"minimum=0"`
	// MaxWidth is the largest content width the user may resize the window to; 0 is no limit.
	MaxWidth float32 `yaml:"maxWidth,omitempty" schema:"minimum=0"`
	// MaxHeight is the largest content height the user may resize the window to; 0 is no limit.
	MaxHeight float32 `yaml:"maxHeight,omitempty" schema:"minimum=0"`
	// Resizable says whether the user may resize the window; nil defaults to true.
	Resizable *bool `yaml:"resizable,omitempty"`
	// Fullscreen says whether the app requests fullscreen at startup; nil leaves the platform default unchanged.
	Fullscreen *bool `yaml:"fullscreen,omitempty"`
	// Appearance starts the app "light" or "dark" whatever the system's; empty follows the system. nsgo.yaml's appearance follows it.
	Appearance string `yaml:"appearance,omitempty" schema:"enum=light|dark"`
	// TitleBar controls the desktop title bar: "hidden" (the default) lets the game fill the window, while "system" keeps the platform title bar.
	TitleBar string `yaml:"titleBar,omitempty" schema:"enum=hidden|system"`
}

Window is the main window's content size in points, its size limits, its title, title bar and appearance.

type WindowOverride

type WindowOverride struct {
	// Title overrides Window.Title.
	Title *string `yaml:"title,omitempty"`
	// Width overrides Window.Width; must be positive when set.
	Width *float32 `yaml:"width,omitempty" schema:"exclusiveMinimum=0"`
	// Height overrides Window.Height; must be positive when set.
	Height *float32 `yaml:"height,omitempty" schema:"exclusiveMinimum=0"`
	// MinWidth overrides Window.MinWidth.
	MinWidth *float32 `yaml:"minWidth,omitempty" schema:"minimum=0"`
	// MinHeight overrides Window.MinHeight.
	MinHeight *float32 `yaml:"minHeight,omitempty" schema:"minimum=0"`
	// MaxWidth overrides Window.MaxWidth.
	MaxWidth *float32 `yaml:"maxWidth,omitempty" schema:"minimum=0"`
	// MaxHeight overrides Window.MaxHeight.
	MaxHeight *float32 `yaml:"maxHeight,omitempty" schema:"minimum=0"`
	// Resizable overrides Window.Resizable.
	Resizable *bool `yaml:"resizable,omitempty"`
	// Fullscreen overrides Window.Fullscreen.
	Fullscreen *bool `yaml:"fullscreen,omitempty"`
	// Appearance overrides Window.Appearance ("light", "dark", or "" to follow the system).
	Appearance *string `yaml:"appearance,omitempty" schema:"enum=light|dark"`
	// TitleBar overrides Window.TitleBar ("hidden" or "system").
	TitleBar *string `yaml:"titleBar,omitempty" schema:"enum=hidden|system"`
}

WindowOverride overrides individual fields of Window; omitted fields keep the base value.

Jump to

Keyboard shortcuts

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