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 ¶
- func New() toolshell.Tool
- type Viewer
- func (*Viewer) Check(key string) error
- func (v *Viewer) Close(s *toolshell.Shell)
- func (v *Viewer) Draw(s *toolshell.Shell, screen ebiten.FinalScreen)
- func (v *Viewer) Init(s *toolshell.Shell)
- func (v *Viewer) Open(s *toolshell.Shell, key string) error
- func (v *Viewer) Panel() toolshell.Panel
- func (v *Viewer) Set(id string, val json.RawMessage) error
- func (v *Viewer) Sync(s *toolshell.Shell)
- func (v *Viewer) Update(s *toolshell.Shell)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
Check reports whether the viewer can show the file at asset key. The command calls it before opening a window.
func (*Viewer) Close ¶
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 ¶
Init implements toolshell.Initializer: a first file with sound installs the voice previewer, which installs package speech.
func (*Viewer) Open ¶
Open implements toolshell.Tool.
func (*Viewer) Set ¶
func (v *Viewer) Set(id string, val json.RawMessage) error
Set implements toolshell.Tool.
func (*Viewer) Sync ¶
Sync implements toolshell.Syncer for the previewers that need it.