Documentation ¶
Index ¶
Constants ¶
const ( // default configuration file. ConfigFile = "erago.conf" DefaultBaseDir = erago.DefaultBaseDir LogFileStdOut = "stdout" // specify log outputs to stdout LogFileStdErr = "stderr" // specify log outputs to stderr DefaultLogFile = "erago.log" // default output log file. LogLevelInfo = "info" // logging only information level. LogLevelDebug = "debug" // logging all levels, debug and info. DefaultFont = theme.DefaultFontName // font file. empty means use builtin font. DefaultFontSize = 12.0 // font size in pt DefaultWidth = 800 // initial window width DefaultHeight = 600 // initial window height )
Variables ¶
var ErrDefaultConfigGenerated error = errors.New("default config generated")
ErrDefaultConfigGenerated implies that the specified config file is not found, and intead of that default config is generated and used.
Functions ¶
func BuildTheme ¶
build new theme according to application configure.
Types ¶
type Config ¶
type Config struct { LogFile string `toml:"logfile"` LogLevel string `toml:"loglevel"` Font string `toml:"font"` // path for fontfile. empty means that use builtin font. FontSize float64 `toml:"fontsize"` // font size in pt. Width int `toml:"width"` // initial window width. Height int `toml:"height"` // initial window height. Game erago.Config `toml:"game"` }
Configure for the Applicaltion. To build this, use NewConfig instead of struct constructor, AppConfig{}.
func LoadConfigOrDefault ¶
if config file exists load it and return. if not exists return default config and write it.
type FpsLimitter ¶
type FpsLimitter struct { EventDeque screen.EventDeque FPS int // zero FPS means no limit fps. // contains filtered or unexported fields }
fpsLimitter limits and delays paint events to not exceed over specified fps. To construct this:
fps := FpsLimitter{EventDeque: deque, FPS: fps}
zero value is invalid.
func (*FpsLimitter) Filter ¶
func (l *FpsLimitter) Filter(ev interface{}) interface{}
Filter handles paint event to limits fps. if paint event is delayed, return type paintSchedule and consume paint event. other events are returned itself.
type ModelErrorFilter ¶
type ModelErrorFilter struct {
// contains filtered or unexported fields
}
ModelErrorFilter filters ui.EragoPresenter's ModelError.
func (ModelErrorFilter) Err ¶
func (me ModelErrorFilter) Err() error
return internal error. it is valid when model error is arrived.
func (*ModelErrorFilter) Filter ¶
func (me *ModelErrorFilter) Filter(e interface{}) interface{}
type PaintScheduled ¶
type PaintScheduled struct{}
paintSchedule notifies setting a new schedule which sends paint event after some time.
type UI ¶
type UI struct { node.ShellEmbed // These Backgrounds fill each widgets by background color. // To change color you can modify XXXBackground.ThemeColor. CmdLineBackground *widget.Uniform // contains filtered or unexported fields }
UI is mixture of widgets in ui package.
func NewUI ¶
func NewUI(presenter *ui.EragoPresenter) *UI
construct standard UI node tree for the era application.
func (*UI) OnLifecycleEvent ¶
implement node.Node interface.