model

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Export ImageFetchType as int for mobile client.
	ImageFetchNone       int = pubdata.ImageFetchNone
	ImageFetchRawRGBA    int = pubdata.ImageFetchRawRGBA
	ImageFetchEncodedPNG int = pubdata.ImageFetchEncodedPNG
)

Functions

func Init

func Init(ui UI, baseDir string, imageFetchType int) error

func Main

func Main(appContext AppContext)

run game thread. the game thread runs on background so it returns imediately. quiting the game thread is notifyed through AppContext.NotifyQuit().

func Quit

func Quit()

func SendCommand

func SendCommand(cmd string)

func SendSkippingWait

func SendSkippingWait()

func SendStopSkippingWait

func SendStopSkippingWait()

func SetTextUnitPx

func SetTextUnitPx(textUnitWidthPx, textUnitHeightPx float64) error

func SetViewSize

func SetViewSize(lineCount, lineRuneWidth int) error

func StringWidth

func StringWidth(text string) int32

Types

type AppContext

type AppContext interface {
	// it is called when mobile.app is quited.
	// the native framework must be quited by this signal.
	// the argument erorr indicates why app is quited.
	// nil error means quit correctly.
	NotifyQuit(error)
}

AppContext manages application context.

type CallbackJson

type CallbackJson interface {
	OnPublishJson(string) error
	OnPublishJsonTemporary(string) error
	OnRemove(nParagraph int) error
	OnRemoveAll() error
}

Callbacks with json message if use complex structure.

type UI

type UI interface {
	CallbackJson

	// it is called when mobile.app requires inputting
	// user's command.
	OnCommandRequested()

	// it is called when mobile.app requires just input any command.
	OnInputRequested()

	// it is called when mobile.app no longer requires any input,
	// such as just-input and command.
	OnInputRequestClosed()
}

erago.UI for java bind.

Jump to

Keyboard shortcuts

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