d2term

package
v0.0.0-...-7f92c57 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package d2term provides a in-game terminal that allows executing custom commands for debugging

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Terminal

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

Terminal handles the in-game terminal

func New

func New(inputManager d2interface.InputManager) (*Terminal, error)

New creates and initializes the terminal

func NewTerminal

func NewTerminal() (*Terminal, error)

NewTerminal creates and returns a terminal

func (*Terminal) Advance

func (t *Terminal) Advance(elapsed float64) error

Advance advances the terminal animation

func (*Terminal) Bind

func (t *Terminal) Bind(name, description string, arguments []string, fn func(args []string) error) error

Bind binds commands to the terminal

func (*Terminal) BindLogger

func (t *Terminal) BindLogger()

BindLogger binds a log.Writer to the output

func (*Terminal) Clear

func (t *Terminal) Clear()

Clear clears the terminal

func (*Terminal) Errorf

func (t *Terminal) Errorf(format string, params ...interface{})

Errorf writes a error message to the terminal

func (*Terminal) Execute

func (t *Terminal) Execute(command string) error

Execute executes a command with arguments

func (*Terminal) Hide

func (t *Terminal) Hide()

Hide hides the terminal

func (*Terminal) Infof

func (t *Terminal) Infof(format string, params ...interface{})

Infof writes a warning message to the terminal

func (*Terminal) OnKeyChars

func (t *Terminal) OnKeyChars(event d2interface.KeyCharsEvent) bool

OnKeyChars handles char key in terminal

func (*Terminal) OnKeyDown

func (t *Terminal) OnKeyDown(event d2interface.KeyEvent) bool

OnKeyDown handles key down in the terminal

func (*Terminal) Printf

func (t *Terminal) Printf(format string, params ...interface{})

Printf writes a message to the terminal

func (*Terminal) Rawf

func (t *Terminal) Rawf(category d2enum.TermCategory, format string, params ...interface{})

Rawf writes a raw message to the terminal

func (*Terminal) Render

func (t *Terminal) Render(surface d2interface.Surface) error

Render renders the terminal

func (*Terminal) Show

func (t *Terminal) Show()

Show shows the terminal

func (*Terminal) Unbind

func (t *Terminal) Unbind(names ...string) error

Unbind unbinds commands from the terminal

func (*Terminal) Visible

func (t *Terminal) Visible() bool

Visible returns visible state

func (*Terminal) Warningf

func (t *Terminal) Warningf(format string, params ...interface{})

Warningf writes a warning message to the terminal

Jump to

Keyboard shortcuts

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