Documentation
¶
Index ¶
- Constants
- type Animations2D
- type App
- func (app *App) AddInputHandler(phase input.Phase, handler func(*input.Dispatch))
- func (app *App) AddSystem(stage Stage, config ecs.SystemConfig) error
- func (app *App) AddSystems(stage Stage, configs ...ecs.SystemConfig) error
- func (app *App) Destroy()
- func (app *App) Frame() error
- func (app *App) InstallSystems[T SystemSet]() error
- func (app *App) LoadModules[P module.ContentProfile](plan *project.ProjectPlan, registry module.Registry, options module.Options) (*module.Scene, error)
- func (app *App) Modules() *module.Runtime
- func (app *App) OpenFile(options window.FileDialogOptions) (string, error)
- func (app *App) OpenFileDialog(options window.FileDialogOptions) ([]string, error)
- func (app *App) OpenFiles(options window.FileDialogOptions) ([]string, error)
- func (app *App) OpenFolder(options window.FileDialogOptions) (string, error)
- func (app *App) OpenModuleWindow(spec project.ProjectSpec, source fs.FS, decoder window.IconDecoder) error
- func (app *App) RequestRender()
- func (app *App) Run() error
- func (app *App) Schedule(stage Stage) *ecs.Schedule
- func (app *App) SetIdleEnabled(enabled bool)
- func (app *App) SetInitialWindowSize(width, height int)
- func (app *App) SetRenderMode(mode RenderMode)
- func (app *App) SetTargetFPS(fps int)
- func (app *App) SetTargetTPS(tps int)
- func (app *App) SetWebViewBackend(backend scene.WebViewBackend)
- func (app *App) SetWindowAlwaysOnTop(enabled bool)
- func (app *App) SetWindowDragRegion(region func(x, y float64) bool)
- func (app *App) SetWindowIcon(data []byte) error
- func (app *App) SetWindowInputRegion(rects []window.InputRegionRect)
- func (app *App) SetWindowOptions(options window.Options)
- func (app *App) SetWindowSize(width, height int)
- func (app *App) SetWindowTaskbarVisible(visible bool)
- func (app *App) SetWindowTitle(title string)
- func (app *App) Step() (bool, error)
- func (app *App) ToggleFullscreen()
- func (app *App) WakeAt(deadline time.Time)
- type Application
- type Input2D
- type MarkdownRuntime
- type Particles2D
- type Physics2D
- type Physics3D
- type Render2D
- type Render3D
- type RenderMode
- type RenderText2D
- type Spine2D
- type SpriteTrails2D
- type Stage
- type SystemSet
- type Tilemaps2D
- type Transforms
- type UIControls
- type UIHTML
- type UIMarkdown
- type UITextInput
- type UIWidgets
- type WebView
Constants ¶
const ( DefaultTargetFPS = 30 DefaultTargetTPS = 64 DefaultMaxFrameDelta = 250 * time.Millisecond DefaultMaxRendersPerRun = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Animations2D ¶
type Animations2D struct{}
Animations2D installs the animator update systems for node-bound clips.
type App ¶
func (*App) AddInputHandler ¶
AddInputHandler registers a synchronous handler for one input phase. Handlers run in registration order and may call Dispatch.Consume.
func (*App) AddSystems ¶
func (app *App) AddSystems(stage Stage, configs ...ecs.SystemConfig) error
func (*App) Destroy ¶
func (app *App) Destroy()
Destroy releases browser surfaces before destroying the native window.
func (*App) InstallSystems ¶
InstallSystems installs one capability and its explicit dependencies. Calls are idempotent, and unused capability implementations can be removed by the Go linker.
func (*App) LoadModules ¶
func (app *App) LoadModules[P module.ContentProfile](plan *project.ProjectPlan, registry module.Registry, options module.Options) (*module.Scene, error)
LoadModules mounts the entry of the new module format. It does not open a native window, so loading and logic tests work independently of rendering.
func (*App) OpenFile ¶
func (app *App) OpenFile(options window.FileDialogOptions) (string, error)
OpenFile opens a native dialog for one file owned by the engine window.
func (*App) OpenFileDialog ¶
func (app *App) OpenFileDialog(options window.FileDialogOptions) ([]string, error)
OpenFileDialog opens a modal native file dialog owned by the engine window. An empty result means that the user cancelled the dialog.
func (*App) OpenFiles ¶
func (app *App) OpenFiles(options window.FileDialogOptions) ([]string, error)
OpenFiles opens a native multi-file dialog owned by the engine window.
func (*App) OpenFolder ¶
func (app *App) OpenFolder(options window.FileDialogOptions) (string, error)
OpenFolder opens a native dialog for one folder owned by the engine window.
func (*App) OpenModuleWindow ¶
func (app *App) OpenModuleWindow(spec project.ProjectSpec, source fs.FS, decoder window.IconDecoder) error
OpenModuleWindow applies project window metadata. LoadModules stays usable without a native window for simulation, build validation and server hosts.
func (*App) RequestRender ¶
func (app *App) RequestRender()
func (*App) SetIdleEnabled ¶
SetIdleEnabled allows an on-demand app to suspend its schedules between events. Custom time-driven systems must schedule WakeAt or disable idle.
func (*App) SetInitialWindowSize ¶
SetInitialWindowSize overrides the project window size before the native window is created. Project window options are still applied by LoadScene.
func (*App) SetRenderMode ¶
func (app *App) SetRenderMode(mode RenderMode)
func (*App) SetTargetFPS ¶
func (*App) SetTargetTPS ¶
func (*App) SetWebViewBackend ¶
func (app *App) SetWebViewBackend(backend scene.WebViewBackend)
SetWebViewBackend installs the platform browser backend used by ECS WebView components. It is useful on Linux and mobile, where the host can provide a WebKitGTK or native Android/iOS implementation.
func (*App) SetWindowAlwaysOnTop ¶
func (*App) SetWindowDragRegion ¶
func (*App) SetWindowIcon ¶
func (*App) SetWindowInputRegion ¶
func (app *App) SetWindowInputRegion(rects []window.InputRegionRect)
SetWindowInputRegion limits pointer input to logical viewport rectangles. A nil slice restores the full window; an empty non-nil slice passes all pointer input through.
func (*App) SetWindowOptions ¶
func (*App) SetWindowSize ¶
func (*App) SetWindowTaskbarVisible ¶
func (*App) SetWindowTitle ¶
func (*App) ToggleFullscreen ¶
func (app *App) ToggleFullscreen()
ToggleFullscreen switches the native window between fullscreen and its previous windowed bounds.
type Application ¶ added in v0.1.8
type Application struct {
BetweenFrames func() error
// contains filtered or unexported fields
}
Application owns multiple native windows in one desktop application instance. Add and BetweenFrames run on the UI thread, outside individual window frames.
func (*Application) Add ¶ added in v0.1.8
func (a *Application) Add(app *App, closed func()) error
func (*Application) Close ¶ added in v0.1.8
func (a *Application) Close()
func (*Application) Run ¶ added in v0.1.8
func (a *Application) Run() error
type MarkdownRuntime ¶
MarkdownRuntime is the optional implementation behind UIMarkdown. Keeping the implementation in a feature package lets projects that do not enable Markdown leave its parser dependencies out of the final binary.
type Particles2D ¶
type Particles2D struct{}
type Render2D ¶
type Render2D struct{}
Render2D adds sprites, sprite layers and UI visuals to RenderText2D.
type RenderText2D ¶ added in v0.1.11
type RenderText2D struct{}
RenderText2D installs transforms, 2D cameras and text drawing.
type SpriteTrails2D ¶
type SpriteTrails2D struct{}
type Stage ¶
type Stage string
const ( StageStartup Stage = "startup" StageInputPreprocess Stage = "input_preprocess" StageInputGlobal Stage = "input_global" StageInputGUI Stage = "input_gui" StageInputShortcut Stage = "input_shortcut" StageInputUnhandled Stage = "input_unhandled" StagePreUpdate Stage = "pre_update" StageBeforeFixedUpdateLoop Stage = "before_fixed_update_loop" StageFixedFirst Stage = "fixed_first" StageModuleEvents Stage = "module_events" StageFixedPreUpdate Stage = "fixed_pre_update" StageFixedUpdate Stage = "fixed_update" StageFixedPostUpdate Stage = "fixed_post_update" StageFixedLast Stage = "fixed_last" StageAfterFixedUpdateLoop Stage = "after_fixed_update_loop" StageUpdate Stage = "update" StagePostUpdate Stage = "post_update" StageRender Stage = "render" )
type SystemSet ¶
type SystemSet interface {
// contains filtered or unexported methods
}
SystemSet is a statically selected engine capability. The unexported method keeps installation logic inside Onix while allowing a generic public API.
type Tilemaps2D ¶
type Tilemaps2D struct{}
type Transforms ¶
type Transforms struct{}
type UIControls ¶
type UIControls struct{}
type UIHTML ¶
type UIHTML struct{}
UIHTML installs the HTML component renderer on top of the UI runtime.
type UIMarkdown ¶
type UIMarkdown[F MarkdownRuntime] struct{}
type UITextInput ¶
type UITextInput struct{}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
codec
Package codec provides the full built-in audio decoder collection.
|
Package codec provides the full built-in audio decoder collection. |
|
codec/mp3/internal/layer3
Package layer3 decodes MPEG Layer III frames to interleaved stereo PCM.
|
Package layer3 decodes MPEG Layer III frames to interleaved stereo PCM. |
|
Package ecs provides typed component storage, queries, structural commands, schedules, resources and messages.
|
Package ecs provides typed component storage, queries, structural commands, schedules, resources and messages. |
|
cmd/builder
command
Command builder preprocesses a project resource package before compiling it.
|
Command builder preprocesses a project resource package before compiling it. |
|
cmd/onix
command
|
|
|
examples
|
|
|
2048
command
Code generated by Onix; DO NOT EDIT.
|
Code generated by Onix; DO NOT EDIT. |
|
animations
command
Code generated by Onix; DO NOT EDIT.
|
Code generated by Onix; DO NOT EDIT. |
|
damaged_helmet
command
Code generated by Onix; DO NOT EDIT.
|
Code generated by Onix; DO NOT EDIT. |
|
flappybird
command
Code generated by Onix; DO NOT EDIT.
|
Code generated by Onix; DO NOT EDIT. |
|
flappybird/contracts
Code generated by Onix; DO NOT EDIT.
|
Code generated by Onix; DO NOT EDIT. |
|
hello_world
command
|
|
|
pelican
command
Code generated by Onix; DO NOT EDIT.
|
Code generated by Onix; DO NOT EDIT. |
|
spine
command
Code generated by Onix; DO NOT EDIT.
|
Code generated by Onix; DO NOT EDIT. |
|
spine/contracts
Code generated by Onix; DO NOT EDIT.
|
Code generated by Onix; DO NOT EDIT. |
|
webview
command
Code generated by Onix; DO NOT EDIT.
|
Code generated by Onix; DO NOT EDIT. |
|
webview/contracts
Code generated by Onix; DO NOT EDIT.
|
Code generated by Onix; DO NOT EDIT. |
|
Package fs provides Onix's persistent virtual filesystem.
|
Package fs provides Onix's persistent virtual filesystem. |
|
codec/hdr
Package hdr decodes Radiance RGBE panoramas without reducing their dynamic range.
|
Package hdr decodes Radiance RGBE panoramas without reducing their dynamic range. |
|
codec/ontex
Package ontex reads and writes the ONIXTEX1 container: a block-compressed texture together with the mip chain the build already generated.
|
Package ontex reads and writes the ONIXTEX1 container: a block-compressed texture together with the mip chain the build already generated. |
|
codec/ultrahdr
Package ultrahdr reconstructs linear HDR from JPEG base images and gain maps.
|
Package ultrahdr reconstructs linear HDR from JPEG base images and gain maps. |
|
html
|
|
|
markup
Package markup builds native Onix documents and serializes HTML fragments.
|
Package markup builds native Onix documents and serializes HTML fragments. |
|
images
|
|
|
png
Package png implements a PNG image decoder and encoder.
|
Package png implements a PNG image decoder and encoder. |
|
svg
Package svg decodes and rasterizes SVG documents without external dependencies.
|
Package svg decodes and rasterizes SVG documents without external dependencies. |
|
webp
Package webp implements a decoder for WEBP images.
|
Package webp implements a decoder for WEBP images. |
|
webp/config
Package config reads WebP headers without registering a pixel decoder.
|
Package config reads WebP headers without registering a pixel decoder. |
|
webp/internal/riff
Package riff implements the Resource Interchange File Format, used by media formats such as AVI, WAVE and WEBP.
|
Package riff implements the Resource Interchange File Format, used by media formats such as AVI, WAVE and WEBP. |
|
webp/internal/vp8
Package vp8 implements a decoder for the VP8 lossy image format.
|
Package vp8 implements a decoder for the VP8 lossy image format. |
|
webp/internal/vp8l
Package vp8l implements a decoder for the VP8L lossless image format.
|
Package vp8l implements a decoder for the VP8L lossless image format. |
|
internal
|
|
|
brotli
Package brotli implements the Brotli reader and writer needed by external formats: WOFF2 decoding and the WeChat WASM artifact.
|
Package brotli implements the Brotli reader and writer needed by external formats: WOFF2 decoding and the WeChat WASM artifact. |
|
ecsgen
command
Command ecsgen generates typed query, spawn and patch adapters around shared plans.
|
Command ecsgen generates typed query, spawn and patch adapters around shared plans. |
|
entitycache
Package entitycache stores large system records densely behind a small entity index.
|
Package entitycache stores large system records densely behind a small entity index. |
|
glyphdraw
Package glyphdraw copies and composites premultiplied glyph pixels into separate RGBA surfaces.
|
Package glyphdraw copies and composites premultiplied glyph pixels into separate RGBA surfaces. |
|
reuse
Package reuse provides operations on reusable scratch storage.
|
Package reuse provides operations on reusable scratch storage. |
|
smallsort
Package smallsort provides compact in-place sorting for small collections.
|
Package smallsort provides compact in-place sorting for small collections. |
|
sourcejson
Package sourcejson isolates build-time JSON parsing from release runtimes.
|
Package sourcejson isolates build-time JSON parsing from release runtimes. |
|
texcompress
Package texcompress implements pure-Go block compression for build-time texture preprocessing.
|
Package texcompress implements pure-Go block compression for build-time texture preprocessing. |
|
texcontainer
Package texcontainer describes the byte layout of the block-compressed texture container a build packs in place of a source image.
|
Package texcontainer describes the byte layout of the block-compressed texture container a build packs in place of a source image. |
|
typedbin
Package typedbin encodes values using their Go type as the schema.
|
Package typedbin encodes values using their Go type as the schema. |
|
Package module runs independent minimum systems composed by project scene plans.
|
Package module runs independent minimum systems composed by project scene plans. |
|
assets
Package assets contains opt-in project resource implementations.
|
Package assets contains opt-in project resource implementations. |
|
audio
Package projectaudio provides an opt-in audio resource feature for project bundles.
|
Package projectaudio provides an opt-in audio resource feature for project bundles. |
|
internal/dxbcgen
command
Command dxbcgen compiles generated HLSL into builtin DirectX 11 bytecode.
|
Command dxbcgen compiles generated HLSL into builtin DirectX 11 bytecode. |
|
internal/hlslgen
command
Command hlslgen regenerates DirectX builtins from the shared WGSL sources.
|
Command hlslgen regenerates DirectX builtins from the shared WGSL sources. |
|
Package scene provides scene components and runtime systems built on ecs, including transforms, common cameras, 2D rendering, animation, and input.
|
Package scene provides scene components and runtime systems built on ecs, including transforms, common cameras, 2D rendering, animation, and input. |
|
render3d
Package render3d owns meshes, camera settings, lights, deformation, shadows, post-processing, and the 3D extract/prepare/sort/draw pipeline.
|
Package render3d owns meshes, camera settings, lights, deformation, shadows, post-processing, and the 3D extract/prepare/sort/draw pipeline. |
|
Package spine loads Spine 3.7 JSON and atlas exports and evaluates them into indexed 2D geometry for Onix's render pipeline.
|
Package spine loads Spine 3.7 JSON and atlas exports and evaluates them into indexed 2D geometry for Onix's render pipeline. |
|
Package syntax incrementally tokenizes TextMate grammars and colors their scopes with VS Code themes.
|
Package syntax incrementally tokenizes TextMate grammars and colors their scopes with VS Code themes. |
|
tests
|
|
|
htmlcompat
command
Command htmlcompat renders the browser compatibility fixture through Onix.
|
Command htmlcompat renders the browser compatibility fixture through Onix. |
|
piecetree
Package piecetree stores UTF-8 text in an AVL tree of references into an immutable original buffer and an append-only edit buffer.
|
Package piecetree stores UTF-8 text in an AVL tree of references into an immutable original buffer and an append-only edit buffer. |
|
tools
|
|
|
html_blur_shader
command
|
|
|
Package ui provides layouts, constraints, reusable controls and composition.
|
Package ui provides layouts, constraints, reusable controls and composition. |
|
html
Package html provides retained HTML surfaces and typed components on the scene runtime.
|
Package html provides retained HTML surfaces and typed components on the scene runtime. |
|
codec/png
Package png provides the opt-in PNG window icon decoder.
|
Package png provides the opt-in PNG window icon decoder. |
|
codec/svg
Package svg provides SVG window icon decoding at a statically selected size.
|
Package svg provides SVG window icon decoding at a statically selected size. |







