Documentation
¶
Overview ¶
Package voiceview is the voice and dialogue previewer of wpix-editor, routed by package viewer: a read-only preview with sound of the files of package speech. A voice (*.voice.json) speaks a line typed in the panel and draws the line's notes as a piano roll; a dialogue (*.dialogue.json) plays in a box, line by line, with a Next button. Its kinds are the only ones that run with audio on. Editing voices and dialogues stays in the library's Voice Editor.
Index ¶
- Constants
- func New() toolshell.Tool
- type Tool
- func (*Tool) Check(key string) error
- func (t *Tool) Close(s *toolshell.Shell)
- func (t *Tool) Draw(s *toolshell.Shell, screen ebiten.FinalScreen)
- func (t *Tool) Init(s *toolshell.Shell)
- func (t *Tool) Open(s *toolshell.Shell, key string) error
- func (t *Tool) Panel() toolshell.Panel
- func (t *Tool) Set(id string, v json.RawMessage) error
- func (t *Tool) Sync(s *toolshell.Shell)
- func (t *Tool) Update(*toolshell.Shell)
Constants ¶
const ( IDText = "voice.text" IDSpeed = "voice.speed" IDSay = "voice.say" IDSkip = "voice.skip" IDStop = "voice.stop" IDNext = "dialogue.next" IDRestart = "dialogue.restart" IDEnd = "dialogue.stop" IDStatus = "status" )
The widget ids of the panel.
const DefaultLine = "Hello there, traveler! Are you lost? The village is just over the hill."
DefaultLine is the line a voice says when the tool opens.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
Tool is the "voice" tool. It is a toolshell.Tool without a document, an toolshell.Initializer (it installs package speech before the engine's schedule is built) and a toolshell.Closer: the host can switch it to another file.
func (*Tool) Check ¶
Check reports whether the tool can open the file at key. The command calls it before opening a window.
func (*Tool) Close ¶
Close implements toolshell.Closer: it ends the line or the dialogue, deletes the entities and releases the file's assets.
func (*Tool) Draw ¶
func (t *Tool) Draw(s *toolshell.Shell, screen ebiten.FinalScreen)
Draw implements toolshell.Tool: the text in the free area and, for a voice, the piano roll of the line under it with a playhead.
func (*Tool) Init ¶
Init implements toolshell.Initializer: it installs package speech. Its system does not run while the shell pauses the game, so Sync steps it. A second Init does nothing.
func (*Tool) Open ¶
Open implements toolshell.Tool.
func (*Tool) Set ¶
func (t *Tool) Set(id string, v json.RawMessage) error
Set implements toolshell.Tool.
func (*Tool) Sync ¶
Sync implements toolshell.Syncer: it steps speech by one tick (the shell pauses the game, so the speech system does not run) and replays the line or the dialogue when its file was reloaded.