viewer

package
v0.0.0-...-94fff03 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: MIT Imports: 34 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 viewer is the "view" tool of wpix-editor: it previews every file kind of package filekind that is not edited, with the engine's own loaders. A texture is shown on a grid with pan and zoom; an atlas (*.atlas.json) shows its frames over the texture, and a font (*.ttf, *.otf) shows sample text at the sizes the project uses. A Tiled map (*.tmj) shows its layers and objects, a tileset (*.tsj) its tiles with ids, collision shapes and animations, and a world (*.world) its maps with the levels that use them. A shader (*.kage) is drawn on a texture with a control per +shader:param marker. An Aseprite export (*.aseprite.json, *.ase.json) plays its clips in the anim tool's read-only layout, and a voice or a dialogue is spoken by the voice tool, with sound.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() toolshell.Tool

New returns a viewer.

Types

type Viewer

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

Viewer is the "view" tool, the preview of every kind of filekind.All that is not edited: it picks the previewer of its file when it opens, and passes everything on to it. It is a toolshell.Tool without a document, a toolshell.Closer (the host can switch it to another file) and a toolshell.Initializer: when its first file has sound (a voice or a dialogue) it installs package speech, and only then can it show those kinds. A page or window that starts without sound reloads to show them.

func (*Viewer) Check

func (*Viewer) Check(key string) error

Check reports whether the viewer can show the file at asset key. The command calls it before opening a window.

func (*Viewer) Close

func (v *Viewer) Close(s *toolshell.Shell)

Close implements toolshell.Closer: it removes the previewer's entities and releases the file's assets; they unload at the engine's next asset update unless the next file holds them again.

func (*Viewer) Draw

func (v *Viewer) Draw(s *toolshell.Shell, screen ebiten.FinalScreen)

Draw implements toolshell.Tool.

func (*Viewer) Init

func (v *Viewer) Init(s *toolshell.Shell)

Init implements toolshell.Initializer: a first file with sound installs the voice previewer, which installs package speech.

func (*Viewer) Open

func (v *Viewer) Open(s *toolshell.Shell, key string) error

Open implements toolshell.Tool.

func (*Viewer) Panel

func (v *Viewer) Panel() toolshell.Panel

Panel implements toolshell.Tool.

func (*Viewer) Set

func (v *Viewer) Set(id string, val json.RawMessage) error

Set implements toolshell.Tool.

func (*Viewer) Sync

func (v *Viewer) Sync(s *toolshell.Shell)

Sync implements toolshell.Syncer for the previewers that need it.

func (*Viewer) Update

func (v *Viewer) Update(s *toolshell.Shell)

Update implements toolshell.Tool.

Jump to

Keyboard shortcuts

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