Documentation
¶
Index ¶
- func BuildProject(options BuildOptions) (artifact string, resultErr error)
- func CheckModuleProject(directory string) (*project.ProjectPlan, error)
- func CreateModuleProject(directory string, options project.CreateProjectOptions) (*project.ProjectPlan, error)
- func GenerateModuleProject(directory string) (*project.ProjectPlan, error)
- func Run(directory string) error
- type BuildArchitecture
- type BuildMode
- type BuildOptions
- type BuildPackageFormat
- type BuildPlatform
- type BuildProgress
- type DataPreview
- type DevelopmentBuild
- type DocumentID
- type DocumentPatch
- type ModDocument
- type ModuleEditor
- type ModuleMigrationIssue
- type ModuleMigrationReport
- type NagaShaderCompiler
- type PreviewItem
- type SceneDocument
- type TextureTarget
- type WorkspaceDocument
- func (w *WorkspaceDocument) Absolute(file string) string
- func (w *WorkspaceDocument) AddElement(mod project.ModID) (string, error)
- func (w *WorkspaceDocument) AddInstance(id string, mod project.ModID, parent string) error
- func (w *WorkspaceDocument) AddResource(mod project.ModID, kind, file string) (string, error)
- func (w *WorkspaceDocument) CopyMod(source, target project.ModID) error
- func (w *WorkspaceDocument) CreateFolder(dir string) error
- func (w *WorkspaceDocument) CreateMod(id project.ModID, spec project.ModSpec) error
- func (w *WorkspaceDocument) CreateScene(id project.SceneID) error
- func (w *WorkspaceDocument) CreateSceneModule(id string, mod project.ModID, parent string) error
- func (w *WorkspaceDocument) DeleteDocument(file string) error
- func (w *WorkspaceDocument) DeleteInstance(id string) error
- func (w *WorkspaceDocument) DeleteInstances(selected map[string]bool) error
- func (w *WorkspaceDocument) DeleteMod(id project.ModID) error
- func (w *WorkspaceDocument) Dirty() bool
- func (w *WorkspaceDocument) Dispose() error
- func (w *WorkspaceDocument) DuplicateInstance(id, newID string) error
- func (w *WorkspaceDocument) EditInstance(id, label string, edit func(*project.ModInstanceSpec) error) error
- func (w *WorkspaceDocument) EditMod(id project.ModID, label string, edit func(*project.ModSpec) error) error
- func (w *WorkspaceDocument) EditScene(id project.SceneID, label string, edit func(*project.SceneSpec) error) error
- func (w *WorkspaceDocument) Instance(id string) *project.ModInstanceSpec
- func (w *WorkspaceDocument) ModuleFiles(id project.ModID) []WorkspaceFile
- func (w *WorkspaceDocument) MoveInstance(id, parent string, index int) error
- func (w *WorkspaceDocument) PatchDocuments(label string, patches map[DocumentID][]DocumentPatch) error
- func (w *WorkspaceDocument) Redo() error
- func (w *WorkspaceDocument) Refresh() error
- func (w *WorkspaceDocument) RefreshFiles() error
- func (w *WorkspaceDocument) RemoveElement(mod project.ModID, id string) error
- func (w *WorkspaceDocument) Save() error
- func (w *WorkspaceDocument) Scene() *SceneDocument
- func (w *WorkspaceDocument) SelectScene(id project.SceneID) error
- func (w *WorkspaceDocument) Undo() error
- type WorkspaceFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildProject ¶
func BuildProject(options BuildOptions) (artifact string, resultErr error)
func CheckModuleProject ¶
func CheckModuleProject(directory string) (*project.ProjectPlan, error)
CheckModuleProject performs the same checks without changing generated files.
func CreateModuleProject ¶
func CreateModuleProject(directory string, options project.CreateProjectOptions) (*project.ProjectPlan, error)
CreateModuleProject supplies the local engine dependency for independent projects. Projects inside an existing Go module keep that module unchanged.
func GenerateModuleProject ¶
func GenerateModuleProject(directory string) (*project.ProjectPlan, error)
GenerateModuleProject validates source boundaries and signatures before replacing generated files. The user's entry and behavior sources are read only.
Types ¶
type BuildArchitecture ¶
type BuildArchitecture string
const ( BuildArchitectureUniversal BuildArchitecture = "universal" BuildArchitectureAMD64 BuildArchitecture = "amd64" BuildArchitectureARM64 BuildArchitecture = "arm64" )
type BuildOptions ¶
type BuildOptions struct {
Progress func(BuildProgress)
AppName string
JavaPackage string
Mode BuildMode
PackageFormat BuildPackageFormat
Architecture BuildArchitecture
Backend render.Backend
// Icon is only used when a project does not declare window.icon.
Icon string
Platform BuildPlatform
ProjectDir string
AndroidSDK string
AndroidNDK string
WebTitle string
WeChatAppID string
AndroidMinSDK int
}
func DefaultBuildOptions ¶
func DefaultBuildOptions(projectDir string) BuildOptions
type BuildPackageFormat ¶
type BuildPackageFormat string
const ( BuildPackagePortable BuildPackageFormat = "portable" BuildPackageApp BuildPackageFormat = "app" BuildPackageDMG BuildPackageFormat = "dmg" BuildPackageMSI BuildPackageFormat = "msi" )
type BuildPlatform ¶
type BuildPlatform string
const ( BuildPlatformWindows BuildPlatform = "windows" BuildPlatformMacOS BuildPlatform = "macos" BuildPlatformLinux BuildPlatform = "linux" BuildPlatformAndroid BuildPlatform = "android" BuildPlatformIOS BuildPlatform = "ios" BuildPlatformWeb BuildPlatform = "web" BuildPlatformWeChat BuildPlatform = "wechat" )
type BuildProgress ¶
BuildProgress reports completed work within build phases. Indeterminate marks work whose remaining amount the tool cannot measure.
type DataPreview ¶
type DataPreview struct {
Scene project.SceneID
Local project.ModID
Items []PreviewItem
Revision uint64
// contains filtered or unexported fields
}
func (*DataPreview) Sync ¶
func (p *DataPreview) Sync(w *WorkspaceDocument, local project.ModID)
type DevelopmentBuild ¶
type DevelopmentBuild struct {
ProjectImportPath string
OverlayPath string
ExecutableDir string
ResourceDir string
// contains filtered or unexported fields
}
DevelopmentBuild contains the generated resource package and Go overlay used to compile a project directly from the repository.
func PrepareDevelopmentBuild ¶
func PrepareDevelopmentBuild(projectDir string, progress func(BuildProgress)) (DevelopmentBuild, error)
PrepareDevelopmentBuild preprocesses and packages a project for the command-line builder. The caller owns the returned build and must call Cleanup when the child process exits. Pass nil to disable resource progress.
func (DevelopmentBuild) Cleanup ¶
func (build DevelopmentBuild) Cleanup() error
Cleanup removes generated development resources and the Go overlay.
type DocumentID ¶
type DocumentID string
DocumentID is the project-relative file that owns an edit and its undo state.
type DocumentPatch ¶
type DocumentPatch struct {
Pointer string
Value json.RawMessage
Remove bool
}
type ModDocument ¶
type ModuleEditor ¶
type ModuleEditor struct {
Document *WorkspaceDocument
Selected string
Local project.ModID
Preview DataPreview
// contains filtered or unexported fields
}
ModuleEditor edits module definitions and scene instances without running project behavior.
func NewModuleEditor ¶
func NewModuleEditor(directory string) (*ModuleEditor, error)
func (*ModuleEditor) ResolveHTMLImage ¶
type ModuleMigrationIssue ¶
type ModuleMigrationReport ¶
type ModuleMigrationReport struct {
Source string `json:"source"`
Output string `json:"output"`
Issues []ModuleMigrationIssue `json:"issues,omitempty"`
Ready bool `json:"ready"`
}
func MigrateModuleProject ¶
func MigrateModuleProject(source, output string) (ModuleMigrationReport, error)
MigrateModuleProject writes a reviewable draft to a new, separate directory. Scripts, controls and external entity bindings become explicit report items; they are never silently retained as runtime compatibility code.
type NagaShaderCompiler ¶
type NagaShaderCompiler struct{}
NagaShaderCompiler compiles WGSL with the pure Go gogpu/naga package.
func (NagaShaderCompiler) CompileShader ¶
func (NagaShaderCompiler) CompileShader(request project.ShaderCompileRequest) (project.ShaderCompileResult, error)
type PreviewItem ¶
type PreviewItem struct {
ID string
Mod project.ModID
Parent int32
Placement mgl32.Mat4
Content mgl32.Mat4
Visible bool
Enabled bool
Revision uint64
ContentRevision uint64
}
PreviewItem is pure authoring data. No module registry, events, requests or Go behavior is installed by the editor. Placement ancestors exclude mod locals.
type SceneDocument ¶
type TextureTarget ¶
type TextureTarget uint8
TextureTarget selects the block-compressed format family a build encodes project textures into. It mirrors ShaderTarget: the project stays platform-neutral and the build resolves one native format per platform, so a single manifest ships to every store.
const ( // TextureTargetSource keeps source images uncompressed. TextureTargetSource TextureTarget = iota // TextureTargetBC targets desktop GPUs, where D3D, Vulkan, and Metal all // sample the BC family. TextureTargetBC // TextureTargetASTC targets mobile GPUs that expose ASTC. TextureTargetASTC )
func (TextureTarget) Encodable ¶
func (target TextureTarget) Encodable() bool
Encodable reports whether this build can actually encode the target.
func (TextureTarget) String ¶
func (target TextureTarget) String() string
type WorkspaceDocument ¶
type WorkspaceDocument struct {
Scenes map[project.SceneID]*SceneDocument
Mods map[project.ModID]*ModDocument
Plan *project.ProjectPlan
Active project.SceneID
ProjectDir string
Files []WorkspaceFile
Spec project.ProjectSpec
Revision uint64
// contains filtered or unexported fields
}
WorkspaceDocument loads the new format exclusively. Files and plans are retained; idle frames never read or rediscover the project.
func LoadWorkspaceDocument ¶
func LoadWorkspaceDocument(directory string) (*WorkspaceDocument, error)
func (*WorkspaceDocument) Absolute ¶
func (w *WorkspaceDocument) Absolute(file string) string
func (*WorkspaceDocument) AddElement ¶
func (w *WorkspaceDocument) AddElement(mod project.ModID) (string, error)
AddElement appends a private element to the module definition with the first unused elementN name. The new ID is returned so callers can report it.
func (*WorkspaceDocument) AddInstance ¶
func (*WorkspaceDocument) AddResource ¶
AddResource declares a file that already lives inside the module directory, keyed by a name derived from its filename and suffixed when that name is taken.
func (*WorkspaceDocument) CopyMod ¶
func (w *WorkspaceDocument) CopyMod(source, target project.ModID) error
CopyMod clones the complete private directory layout, including mod.go. It never rewrites main.go; registration of a new behavior is a build-stage task.
func (*WorkspaceDocument) CreateFolder ¶
func (w *WorkspaceDocument) CreateFolder(dir string) error
CreateFolder makes a plain directory inside the project and refreshes the cached inventory so the file browser shows it immediately.
func (*WorkspaceDocument) CreateScene ¶
func (w *WorkspaceDocument) CreateScene(id project.SceneID) error
func (*WorkspaceDocument) CreateSceneModule ¶
CreateSceneModule creates a definition and its placement as one undoable edit. Existing definitions are reused through the usual instance wiring rules.
func (*WorkspaceDocument) DeleteDocument ¶
func (w *WorkspaceDocument) DeleteDocument(file string) error
DeleteDocument removes one JSON document. Scenes also leave the project's scene list; files move to editor trash on save.
func (*WorkspaceDocument) DeleteInstance ¶
func (w *WorkspaceDocument) DeleteInstance(id string) error
func (*WorkspaceDocument) DeleteInstances ¶
func (w *WorkspaceDocument) DeleteInstances(selected map[string]bool) error
DeleteInstances removes selected subtrees in one undoable edit.
func (*WorkspaceDocument) Dirty ¶
func (w *WorkspaceDocument) Dirty() bool
func (*WorkspaceDocument) Dispose ¶
func (w *WorkspaceDocument) Dispose() error
Dispose removes only this document's temporary copies. Saved editor trash remains recoverable independently of the editor session.
func (*WorkspaceDocument) DuplicateInstance ¶
func (w *WorkspaceDocument) DuplicateInstance(id, newID string) error
DuplicateInstance clones placement/overrides while reusing each definition. Descendant identities are remapped as one scene-document command.
func (*WorkspaceDocument) EditInstance ¶
func (w *WorkspaceDocument) EditInstance(id, label string, edit func(*project.ModInstanceSpec) error) error
func (*WorkspaceDocument) Instance ¶
func (w *WorkspaceDocument) Instance(id string) *project.ModInstanceSpec
func (*WorkspaceDocument) ModuleFiles ¶
func (w *WorkspaceDocument) ModuleFiles(id project.ModID) []WorkspaceFile
ModuleFiles uses the cached inventory and includes unsaved definitions/copies.
func (*WorkspaceDocument) MoveInstance ¶
func (w *WorkspaceDocument) MoveInstance(id, parent string, index int) error
MoveInstance uses the destination index after removal when reordering or reparenting an instance through the scene tree.
func (*WorkspaceDocument) PatchDocuments ¶
func (w *WorkspaceDocument) PatchDocuments(label string, patches map[DocumentID][]DocumentPatch) error
PatchDocuments applies a form containing scene and definition edits as one validated transaction. Each history entry still records the owning files.
func (*WorkspaceDocument) Redo ¶
func (w *WorkspaceDocument) Redo() error
func (*WorkspaceDocument) Refresh ¶
func (w *WorkspaceDocument) Refresh() error
Refresh discovers new definitions while preserving all open document drafts. Existing external document edits remain conflicts until the project is reopened.
func (*WorkspaceDocument) RefreshFiles ¶
func (w *WorkspaceDocument) RefreshFiles() error
func (*WorkspaceDocument) RemoveElement ¶
func (w *WorkspaceDocument) RemoveElement(mod project.ModID, id string) error
RemoveElement deletes an element and its descendants from the definition.
func (*WorkspaceDocument) Save ¶
func (w *WorkspaceDocument) Save() error
Save writes only changed owning documents, after checking external edits. Module removal moves the complete private folder into recoverable editor trash.
func (*WorkspaceDocument) Scene ¶
func (w *WorkspaceDocument) Scene() *SceneDocument
func (*WorkspaceDocument) SelectScene ¶
func (w *WorkspaceDocument) SelectScene(id project.SceneID) error
func (*WorkspaceDocument) Undo ¶
func (w *WorkspaceDocument) Undo() error
type WorkspaceFile ¶
Source Files
¶
- build.go
- build_brotli.go
- build_dialog.go
- build_icon.go
- build_progress.go
- desktop_package.go
- dialog_component.go
- dialog_ui.go
- json_file.go
- layout.go
- module_generate.go
- module_migrate.go
- module_resources.go
- open_directory.go
- preview3d.go
- project_resources.go
- resource_build_cache.go
- resource_collector.go
- resource_packages.go
- resource_preprocess.go
- run_process_other.go
- run_project.go
- settings.go
- settings_dialog.go
- shader_compiler.go
- system_font.go
- system_profile.go
- texture_astc.go
- texture_target.go
- theme.go
- titlebar.go
- titlebar_component.go
- viewport3d.go
- vnode_view.go
- welcome_component.go
- windows_msi.go
- workspace_animation.go
- workspace_animation_curve.go
- workspace_app.go
- workspace_assets.go
- workspace_build.go
- workspace_canvas.go
- workspace_chrome.go
- workspace_color_picker.go
- workspace_component.go
- workspace_content.go
- workspace_content_controls.go
- workspace_dialog.go
- workspace_document.go
- workspace_draft_preview.go
- workspace_drag.go
- workspace_drag3d.go
- workspace_element_picker.go
- workspace_files.go
- workspace_layout.go
- workspace_nine_slice.go
- workspace_operations.go
- workspace_outliner.go
- workspace_patch.go
- workspace_preview.go
- workspace_resources.go
- workspace_selection.go
- workspace_selection3d.go
- workspace_settings.go
- workspace_slots.go
- workspace_tilemap.go
- workspace_view.go
- workspace_viewport2d.go
- workspace_viewport3d.go
- workspace_viewport3d_controls.go
- workspace_viewport3d_environment.go
- workspace_viewport3d_guides.go
- workspace_viewport3d_helpers.go
- workspace_viewport3d_orientation.go
- workspace_welcome.go
- workspace_window.go