project

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package project loads the project metadata required by CLI commands.

Index

Constants

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 ModulePath

func ModulePath(directory string) (string, error)

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

Types

type Assets

type Assets struct {
	Textures []Texture `koanf:"texture"`
	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 Config

type Config struct {
	Project struct {
		Name       string `koanf:"name"`
		Compiler   string `koanf:"compiler"`
		Resolution struct {
			Width  int `koanf:"width"`
			Height int `koanf:"height"`
		} `koanf:"resolution"`
	} `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 Texture

type Texture struct {
	Name    string `koanf:"name"`
	Source  string `koanf:"source"`
	Profile string `koanf:"profile"`
	Keep    bool   `koanf:"keep"`
}

Texture describes a logical texture source in a project manifest.

type Theme

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

Jump to

Keyboard shortcuts

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