reader
The public API of vnReader: `setup` a game, then `say`, `choose`, backlog, auto/skip, hide UI, save/load (slots, quick, auto), gallery, settings, system menu, themes and the showcase picker. Runs one input loop that reads keyboard, mouse wheel, gamepad and touch swipes. Called by…
reader
The public API of vnReader: setup a game, then say, choose, backlog, auto/skip, hide UI, save/load (slots, quick, auto), gallery, settings, system menu, themes and the showcase picker. Runs one input loop that reads keyboard, mouse wheel, gamepad and touch swipes. Called by the game's own UI module (require("vnReader.reader")); see the package README for every function and config field.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2nonstrict
cfg( ) → void
ns( ) → string return
scr(name: string) → string return
| arg | type | description |
|---|---|---|
| name | string |
layer(k: string) → number
| arg | type | description |
|---|---|---|
| k | string |
now( ) → number return getTime
fire(fn: ?, ...: ?) → void
| arg | type | description |
|---|---|---|
| fn | ? | |
| ... | ? |
sfx(kind: string, vol: number?) → void
| arg | type | description |
|---|---|---|
| kind | string | |
| vol | number? |
settings( ) → void
theme( ) → void
phoneK( ) → number
scaledTree(n: any, k: number) → any
| arg | type | description |
|---|---|---|
| n | any | |
| k | number |
dims( ) → void
zin( ) → void
touchMode( ) → boolean
castOf(id: string?) → void
| arg | type | description |
|---|---|---|
| id | string? |
isNarrator(speaker: string?) → boolean
| arg | type | description |
|---|---|---|
| speaker | string? |
utf8sub(s: string, n: number) → string
| arg | type | description |
|---|---|---|
| s | string | |
| n | number |
lineKey(speaker: string, text: string, lineId: string?) → string
| arg | type | description |
|---|---|---|
| speaker | string | |
| text | string | |
| lineId | string? |
loadSettings( ) → void
saveSettings( ) → void
applyVolumes( ) → void
readSet( ) → void
markRead(key: string) → void
| arg | type | description |
|---|---|---|
| key | string |
isRead(key: string) → boolean
| arg | type | description |
|---|---|---|
| key | string |
put(name: string, tree: ?, lyr: number, fresh: boolean?) → void
| arg | type | description |
|---|---|---|
| name | string | |
| tree | ? | |
| lyr | number | |
| fresh | boolean? |
drop(name: string) → void
| arg | type | description |
|---|---|---|
| name | string |
toast(text: string, kind: string?) → void
| arg | type | description |
|---|---|---|
| text | string | |
| kind | string? |
fontSize( ) → number
dlgGeom( ) → void
plateNode(T: ?, g: ?, c: ?, fresh: boolean) → void
| arg | type | description |
|---|---|---|
| T | ? | |
| g | ? | |
| c | ? | |
| fresh | boolean |
quickButtons(T: ?, g: ?) → void
| arg | type | description |
|---|---|---|
| T | ? | |
| g | ? |
buildFrame(fresh: boolean) → void
| arg | type | description |
|---|---|---|
| fresh | boolean |
buildText( ) → void
renderFrame(fresh: boolean) → void
| arg | type | description |
|---|---|---|
| fresh | boolean |
renderText( ) → void
stopVoice( ) → void
playVoice(lineId: string?, speaker: string?, text: string?) → number
| arg | type | description |
|---|---|---|
| lineId | string? | |
| speaker | string? | |
| text | string? |
say(speaker: string?, text: string, onDone: (() → void
Show one line. `opts` is a line id string or { lineId, voice = false }. onDone fires when the player advances.
| arg | type | description |
|---|---|---|
| speaker | string? | |
| text | string | |
| onDone | (( |
hideDialogue( ) → void
finishTyping( ) → boolean
overlayOpen( ) → boolean return
advance(force: boolean?) → void
| arg | type | description |
|---|---|---|
| force | boolean? |
setHidden(on: boolean) → void
| arg | type | description |
|---|---|---|
| on | boolean |
setAuto(on: boolean) → void
| arg | type | description |
|---|---|---|
| on | boolean |
setSkip(on: boolean) → void
| arg | type | description |
|---|---|---|
| on | boolean |
buildChoice( ) → void
_renderChoice(fresh: boolean) → void
| arg | type | description |
|---|---|---|
| fresh | boolean |
choose(prompt: string?, options: { any }, onPick: (id: string) → void
Show choice cards. options = { { id, text, locked? } }. Skip stops here. onPick(id) fires with the picked id.
| arg | type | description |
|---|---|---|
| prompt | string? | |
| options | { any } | |
| onPick | (id: string |
pickChoice(i: number) → void
| arg | type | description |
|---|---|---|
| i | number |
hideChoice( ) → void
Take the choice cards down without picking (the onPick callback never fires).
slotKey(slot: any) → string return ns
| arg | type | description |
|---|---|---|
| slot | any |
pictureOf(snap: any) → any
Turn a stage snapshot into a slot picture { background, layers = {{ src, x, h, aspect, flip }} } (config.picture overrides).
| arg | type | description |
|---|---|---|
| snap | any |
lastLine( ) → void
capture( ) → any
Build what a slot holds now: { savedAt, playTime, title, line, speaker, game, stage, picture }.
save(slot: any) → any
Save into a slot (a number, "quick" or "auto"). Returns the slot data.
| arg | type | description |
|---|---|---|
| slot | any |
slot(slot: any) → any
The data in a slot, or nil.
| arg | type | description |
|---|---|---|
| slot | any |
deleteSlot(slot: any) → void
| arg | type | description |
|---|---|---|
| slot | any |
hasSaves( ) → boolean
True when the local player has at least one save (slots, quick or auto).
slotCount( ) → number
load(slot: any) → boolean
Load a slot: closes every reader screen and hands the data to config.onLoad(game, slotData).
| arg | type | description |
|---|---|---|
| slot | any |
quickSave( ) → void
quickLoad( ) → void
canSave( ) → boolean
Whether saving is allowed now (config.canSave, default: a line or choice is on screen).
beginSession(seconds: number?) → void
Start counting play time (from `seconds`, default keeps the current count).
| arg | type | description |
|---|---|---|
| seconds | number? |
endSession( ) → void
playTime( ) → number return S
topKind( ) → string
renderTop(fresh: boolean?) → void
| arg | type | description |
|---|---|---|
| fresh | boolean? |
push(kind: string, data: any?) → void
| arg | type | description |
|---|---|---|
| kind | string | |
| data | any? |
pop( ) → void
closeAll( ) → void
rerenderAll( ) → void
openLog( ) → void
Open the backlog.
openSaves(mode: string?) → void
Open the save (mode "save") or load (mode "load") screen.
| arg | type | description |
|---|---|---|
| mode | string? |
openSettings(tab: string?) → void
| arg | type | description |
|---|---|---|
| tab | string? |
openGallery( ) → void
openMenu(opts: any?) → void
Open the system (pause) menu: Save, Load, Quick Save/Load, Log, Settings, Gallery, Title.
| arg | type | description |
|---|---|---|
| opts | any? |
confirm(text: string, onYes: () → void
| arg | type | description |
|---|---|---|
| text | string | |
| onYes | ( |
set(key: string, value: any) → void
Change one setting (persisted per player) and apply it.
| arg | type | description |
|---|---|---|
| key | string | |
| value | any |
setTheme(name: string) → void
Switch the theme for every reader screen at once.
| arg | type | description |
|---|---|---|
| name | string |
setSaveLayout(name: string) → void
| arg | type | description |
|---|---|---|
| name | string |
themes( ) → void
registerTheme(name: string, tokens: any) → void
| arg | type | description |
|---|---|---|
| name | string | |
| tokens | any |
setup(config: any) → void
Configure the reader for a game. See README for every field.
| arg | type | description |
|---|---|---|
| config | any |
onQuick(id: string) → void
| arg | type | description |
|---|---|---|
| id | string |
onCallback(id: string, data: any) → void
| arg | type | description |
|---|---|---|
| id | string | |
| data | any |
kp(code: string) → boolean
| arg | type | description |
|---|---|---|
| code | string |
kd(code: string) → boolean
| arg | type | description |
|---|---|---|
| code | string |
pp(btn: string) → boolean
| arg | type | description |
|---|---|---|
| btn | string |
pd(btn: string) → boolean
| arg | type | description |
|---|---|---|
| btn | string |
readIntent( ) → void
One frame's intent, from every device.
moveFocus(t: ?, dx: number, dy: number) → void
| arg | type | description |
|---|---|---|
| t | ? | |
| dx | number | |
| dy | number |
overlayInput(t: ?, i: ?) → void
| arg | type | description |
|---|---|---|
| t | ? | |
| i | ? |
tick(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
relayout( ) → void
ensureLoop(force: boolean?) → void
| arg | type | description |
|---|---|---|
| force | boolean? |
showcasePicker(opts: any?) → void
Showcase: draws a picker to flip through every theme and save layout. opts = { cast = { a = id, b = id }, x, y }.
| arg | type | description |
|---|---|---|
| opts | any? |
hidePicker( ) → void
demo(kind: string?) → void
Showcase helper: show a sample of one part ("line", "choice", "saves", "load", "log", "settings", "menu", "gallery").
| arg | type | description |
|---|---|---|
| kind | string? |
sp(s: ?) → void
| arg | type | description |
|---|---|---|
| s | ? |
debugState( ) → void
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.