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

project

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package project loads the project metadata required by CLI commands.

Index

Constants

View Source
const DefaultEnvironmentProfile = "environment"
View Source
const DefaultMusicProfile = "music"
View Source
const DefaultSoundProfile = "effect"
View Source
const DefaultTextureProfile = "sprite"

Variables

This section is empty.

Functions

func CompileUI

func CompileUI(directory string, entries []Texture, layouts []Layout, theme string) ([]uicompiler.Component, error)

CompileUI adapts project asset configuration to KartUI's independent compiler.

func DecodeUIWithTheme added in v0.0.2

func DecodeUIWithTheme(source string, data []byte, theme uicompiler.Theme) (ui.Template, error)

DecodeUIWithTheme retains the compiled component long enough to report style warnings. Static-template validation is identical to KartUI's decoder.

func ModulePath

func ModulePath(directory string) (string, error)

ModulePath returns the module path used to import the generated engine package.

func ReportUIWarnings added in v0.0.2

func ReportUIWarnings(components []uicompiler.Component)

ReportUIWarnings supports current KartUI diagnostics while remaining buildable with the released public compiler module during the candidate release cycle.

Types

type Assets

type Assets struct {
	Textures     []Texture     `koanf:"texture"`
	Sounds       []Sound       `koanf:"sound"`
	Music        []AudioStream `koanf:"music"`
	Environments []AudioStream `koanf:"environment"`
	Videos       []Video       `koanf:"video"`
	Fonts        []Font        `koanf:"font"`
	UI           []Texture     `koanf:"ui"`
	Layouts      []Layout      `koanf:"layout"`
	Theme        Theme         `koanf:"theme"`
}

Assets contains convention-discovered entries plus optional manifest overrides.

type AudioStream added in v0.0.2

type AudioStream struct {
	Name      string         `koanf:"name"`
	Source    string         `koanf:"source"`
	Profile   string         `koanf:"profile"`
	Transform SoundTransform `koanf:"transform"`
}

AudioStream describes a long-form WAV source encoded as a staged QOA sidecar.

type CameraConfig added in v0.0.2

type CameraConfig struct {
	Enabled     bool    `koanf:"-"`
	FOVYDegrees float64 `koanf:"fov_y_degrees"`
	Near        float64 `koanf:"near"`
	Far         float64 `koanf:"far"`
	OrthoHeight float64 `koanf:"ortho_height"`
}

CameraConfig contains optional build-time defaults for project Camera3D settings. Enabled distinguishes a declared camera table from a 2D-only project.

type Config

type Config struct {
	Project struct {
		StorageID string `koanf:"storage_id"`
		Name      string `koanf:"name"`
		Compiler  string `koanf:"compiler"`
		Web       struct {
			RuntimeURL string `koanf:"runtime_url"`
		} `koanf:"web"`
		Resolution struct {
			Width  int `koanf:"width"`
			Height int `koanf:"height"`
		} `koanf:"resolution"`
		Performance PerformanceConfig `koanf:"performance"`
		Camera      CameraConfig      `koanf:"camera"`
		Debug       struct {
			Renderer bool `koanf:"renderer"`
		} `koanf:"debug"`
	} `koanf:"project"`
	SDK struct {
		Version string `koanf:"version"`
	} `koanf:"sdk"`
	Assets Assets `koanf:"assets"`
}

Config is the supported subset of karty.toml.

func Load

func Load(directory string) (Config, error)

Load reads and validates the project configuration in directory.

type Font

type Font struct {
	Role   string `koanf:"role"`
	Source string `koanf:"source"`
}

Font binds one project font file to a semantic UI typography role.

type Layout

type Layout struct {
	Source string `koanf:"source"`
}

Layout identifies one build-time-only KartUI layout source.

type PerformanceConfig added in v0.0.2

type PerformanceConfig struct {
	TargetFPS      float64              `json:"target_fps"      koanf:"target_fps"`
	DefaultProfile string               `json:"default_profile" koanf:"default_profile"`
	Profiles       []PerformanceProfile `json:"profiles"        koanf:"profiles"`
}

PerformanceConfig configures the host's adaptive render-quality ladder.

type PerformanceProfile added in v0.0.2

type PerformanceProfile struct {
	Name             string  `json:"name"                        koanf:"name"`
	RenderScale      float64 `json:"render_scale"                koanf:"render_scale"`
	MinWindowWidth   int     `json:"min_window_width,omitempty"  koanf:"min_window_width"`
	MaxWindowWidth   int     `json:"max_window_width,omitempty"  koanf:"max_window_width"`
	FloorReflections *bool   `json:"floor_reflections,omitempty" koanf:"floor_reflections"`
}

PerformanceProfile names a render scale and optional inclusive window-width eligibility range. A nil FloorReflections value inherits the renderer default.

type Sound added in v0.0.2

type Sound struct {
	Name      string         `koanf:"name"`
	Source    string         `koanf:"source"`
	Profile   string         `koanf:"profile"`
	Transform SoundTransform `koanf:"transform"`
	Inferred  bool           `koanf:"-"`
}

type SoundTransform added in v0.0.2

type SoundTransform struct {
	SampleRate uint32 `koanf:"sample_rate"`
	Channels   string `koanf:"channels"`
}

SoundTransform contains sparse per-asset overrides for the SDK profile.

type Texture

type Texture struct {
	Name      string           `koanf:"name"`
	Source    string           `koanf:"source"`
	Profile   string           `koanf:"profile"`
	Keep      bool             `koanf:"keep"`
	Transform TextureTransform `koanf:"transform"`
	Inferred  bool             `koanf:"-"`
}

Texture describes a logical texture source in a project manifest.

type TextureTransform added in v0.0.2

type TextureTransform struct {
	MaxWidth  uint32 `koanf:"max_width"`
	MaxHeight uint32 `koanf:"max_height"`
	Filter    string `koanf:"filter"`
	BitDepth  uint8  `koanf:"bit_depth"`
}

TextureTransform contains sparse per-asset overrides for the SDK profile. Zero values inherit the selected profile.

type Theme

type Theme struct {
	Source string `koanf:"source"`
}

type Video added in v0.0.2

type Video struct {
	Name   string `koanf:"name"`
	Source string `koanf:"source"`
}

Sound describes a game-scoped one-shot WAV source. Video is an explicitly declared MPEG-PS source copied without transcoding.

Jump to

Keyboard shortcuts

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