Documentation
¶
Overview ¶
Package project loads the project metadata required by CLI commands.
Index ¶
- Constants
- func CompileUI(directory string, entries []Texture, layouts []Layout, theme string) ([]uicompiler.Component, error)
- func DecodeUIWithTheme(source string, data []byte, theme uicompiler.Theme) (ui.Template, error)
- func ModulePath(directory string) (string, error)
- func ReportUIWarnings(components []uicompiler.Component)
- type Assets
- type AudioStream
- type CameraConfig
- type Config
- type Font
- type Layout
- type PerformanceConfig
- type PerformanceProfile
- type Sound
- type SoundTransform
- type Texture
- type TextureTransform
- type Theme
- type Video
Constants ¶
const DefaultEnvironmentProfile = "environment"
const DefaultMusicProfile = "music"
const DefaultSoundProfile = "effect"
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
DecodeUIWithTheme retains the compiled component long enough to report style warnings. Static-template validation is identical to KartUI's decoder.
func ModulePath ¶
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.
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.