{"modulePath":"github.com/weakpixel/engine","version":"v0.0.0-20261205071607-94fff0387040","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package debugpanel\n\nPackage debugpanel draws a [toolshell.Panel](/github.com/weakpixel/engine/editor/toolshell#Panel) with debugui, in the native window of wpix-editor. It is the only package that imports debugui (besides tools/wpix-editor/internal/native, which wires it): the js/wasm build must not link it, so the user's module needs no go.sum entries for it. The VSCode extension draws the same panel as HTML.\n\n## Types\n\n```go\ntype Panel struct {\n\t// contains filtered or unexported fields\n}\n```\nPanel is a [toolshell.Renderer](/github.com/weakpixel/engine/editor/toolshell#Renderer) drawing with debugui.\n\n```go\nfunc New() *Panel\n```\nNew returns a panel renderer.\n\n```go\nfunc (p *Panel) Build(ctx context, pn toolshell.Panel, set func(id string, v json.RawMessage))\n```\nBuild calls ctx for every section and field of pn; set receives a changed widget. It is the mapping: number to NumberFieldF (SliderF with both bounds), range to two of those on one row, color to a swatch with an Edit button that opens a color picker (see colorField), asset to a Dropdown of the keys (the first entry is none), checkbox to Checkbox, dropdown to Dropdown, text to TextField, button to Button, label to Text.\n\n```go\nfunc (p *Panel) Draw(screen ebiten.FinalScreen)\n```\nDraw implements [toolshell.Renderer](/github.com/weakpixel/engine/editor/toolshell#Renderer): it copies the strips of the image [Panel.Render](#Panel.Render) drew that hold the panels onto the final screen. Only the strips are copied, so the viewport between them stays as drawn.\n\n```go\nfunc (p *Panel) Insets() (left, right int)\n```\nInsets implements [toolshell.Renderer](/github.com/weakpixel/engine/editor/toolshell#Renderer). The logical screen is the physical screen (see tools/wpix-editor/internal/native), so the widths are in physical pixels: the UI pixels times the UI scale.\n\n```go\nfunc (p *Panel) Render()\n```\nRender draws the UI into the panel's offscreen image. Call it from the game's Draw, before Ebiten draws the final screen: debugui draws into an \\*ebiten.Image (the final screen is not one), and rendering an offscreen image in the middle of DrawFinalScreen, between draws to the final screen, blanked everything drawn before it on macOS (Metal).\n\n```go\nfunc (p *Panel) Update(pn toolshell.Panel, set func(id string, v json.RawMessage)) bool\n```\nUpdate implements [toolshell.Renderer](/github.com/weakpixel/engine/editor/toolshell#Renderer). Both windows are built in one debugui update, so the captured flag covers both.\n\n","path":"github.com/weakpixel/engine/editor/toolshell/debugpanel","name":"debugpanel","synopsis":"Package debugpanel draws a toolshell.Panel with debugui, in the native window of wpix-editor.","isRedistributable":true}
