debugpanel

package
v0.0.0-...-5b9216b Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: MIT Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package debugpanel draws a 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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Panel

type Panel struct {
	// contains filtered or unexported fields
}

Panel is a toolshell.Renderer drawing with debugui.

func New

func New() *Panel

New returns a panel renderer.

func (*Panel) Build

func (p *Panel) Build(ctx context, pn toolshell.Panel, set func(id string, v json.RawMessage))

Build 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.

func (*Panel) Draw

func (p *Panel) Draw(screen ebiten.FinalScreen)

Draw implements toolshell.Renderer: it copies the strips of the image Panel.Render drew that hold the panels onto the final screen. Only the strips are copied, so the viewport between them stays as drawn.

func (*Panel) Insets

func (p *Panel) Insets() (left, right int)

Insets implements 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.

func (*Panel) Render

func (p *Panel) Render()

Render 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).

func (*Panel) Update

func (p *Panel) Update(pn toolshell.Panel, set func(id string, v json.RawMessage)) bool

Update implements toolshell.Renderer. Both windows are built in one debugui update, so the captured flag covers both.

Jump to

Keyboard shortcuts

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