Namespace in reactor_ui_victory.js

V

41 public functions in 4 groups · show internal (_) functions

Designing a custom interface with motion in the editor.

Quick Reference

Getting Information 2

itemKind() What a reward is: 'weapon', 'armor', 'keyItem' or 'item'.
textOf() What a Victory Text node says on the run's page.

Checks (True / False) 4

isVictoryNode() Whether it is victory node.
isLastPage() Whether it is last page.
isFilling() Whether the page's bars are still filling (a key finishes that before it moves on).
isAnimating() Whether the page still has something moving, so it must be drawn again: the fill, or a Level Up mark settling.

Updating & Drawing 5

step() One frame. input is { ok, cancel, held }: OK finishes a fill that is running and otherwise moves on (closing…
drawParty() The Experience page: the members of page ({ from, count } into run.members) at the run's point in the fill.
drawLevels() The Level Up page: one row per actor of page among those who gained a level.
drawRewards() The Rewards page: the gold and what was found, each on a card in its kind's color.
drawText() Draws the text.

Other 30

boundId() The id System binds as the Victory interface (0: none in use, the game's own message lines play).
defaultProps() What a new node of a type starts as.
normalizeProps() A stored node's own settings, every value in range (missing ones at their defaults).
normalizePage() The page a stored value names, '' for every page.
termKey() The key a word has in System.json reactorBattle.terms.
label() A word: the node's own, else the project's (System.json reactorBattle.terms), else the stock one.
pageOf() The page a node shows on ('' for every page): by its type, else by its Shown on setting.
groupItems() The rewards' items, one entry per kind of thing with how many of it, in the order they were made.
member() One actor before and after the rewards, as a summary member.
memberAt() A member part of the way through the fill (t 0 to 1), written into out: the level it shows, how full its bar…
shownMembers() The members the Experience page shows: the battle members, then (where the node says so) reserve members who…
leveled() Leveled.
rewardCount() How many reward cards there are: the gold, when there is any, and one per kind of thing found.
pages() The pages of a summary under a record's nodes: [{ kind, from, count, frames }].
newRun() New run.
page() Page.
progress() How far the page's fill has come, 0 to 1: it starts gently and settles into place.
strip() Text with its codes taken out, its spaces kept.
plain() Text as plain words on one line (a description may color a word or draw an icon; here it is the words alone).
wrap() Words broken into at most max lines that fit width, the last one cut with an ellipsis.
partyGrid() How the members are laid out in width x height: { cols, rows, per (members a page holds), cellWidth, cellHeig…
gridCell() Where the index-th of count cards on a page sits, written into out (x, y): rows centered, the block centered…
partyCard() Where a member card's parts sit inside w x h, written into out; block is the height they take together.
levelsGrid() How the Level Up rows are laid out: { per (rows a page holds), rowHeight, gap, font, line, pad }.
rewardsGrid() How the reward cards are laid out: { cols, per (cards a page holds), cardWidth, cardHeight, gap, font, line,…
rewardAt() The reward at index of the page list, written into out: the gold first where there is any, then the things fo…
stockNodes() Stock nodes.
stockRecord() The stock interface as a whole record (what Stock Layout builds).
expForLevel() An actor's total EXP at the start of a level, by its class's curve (the game's own formula).
sampleSummary() Sample summary.

Getting Information

itemKind

static source
V.itemKind(item)

What a reward is: 'weapon', 'armor', 'keyItem' or 'item'.

textOf

static source
V.textOf(node, run, theme)

What a Victory Text node says on the run's page.

Checks (True / False)

isVictoryNode

static source
V.isVictoryNode(type)

Whether it is victory node.

isLastPage

static source
V.isLastPage(run)

Whether it is last page.

isFilling

static source
V.isFilling(run)

Whether the page's bars are still filling (a key finishes that before it moves on).

isAnimating

static source
V.isAnimating(run)

Whether the page still has something moving, so it must be drawn again: the fill, or a Level Up mark settling.

Updating & Drawing

step

static source
V.step(run, input)

One frame. input is { ok, cancel, held }: OK finishes a fill that is running and otherwise moves on (closing after the last page), Cancel goes straight to the last page and closes from there, and a held key runs the fill faster and moves on by itself.

Details

One frame. input is { ok, cancel, held }: OK finishes a fill that is running and otherwise moves on (closing after the last page), Cancel goes straight to the last page and closes from there, and a held key runs the fill faster and moves on by itself. A press in the first moments of a page, or just after one cut a fill short, is not heard. Returns the EVENT_ bits of what happened: a level gained (its sound), a page turned, the close.

drawParty

static source
V.drawParty(ctx, width, height, node, run, page, theme, part)

The Experience page: the members of page ({ from, count } into run.members) at the run's point in the fill.

Details

The Experience page: the members of page ({ from, count } into run.members) at the run's point in the fill. part is 'static' (the cards, pictures and names), 'moving' (levels, numbers, bars and marks, what a frame of the fill changes) or 'all'. Returns false while a picture is still loading.

drawLevels

static source
V.drawLevels(ctx, width, height, node, summary, page, theme)

The Level Up page: one row per actor of page among those who gained a level.

drawRewards

static source
V.drawRewards(ctx, width, height, node, summary, page, theme)

The Rewards page: the gold and what was found, each on a card in its kind's color.

drawText

static source
V.drawText(ctx, width, height, node, value, theme)

Draws the text.

Other

boundId

static source
V.boundId(system)

The id System binds as the Victory interface (0: none in use, the game's own message lines play).

defaultProps

static source
V.defaultProps(type)

What a new node of a type starts as.

normalizeProps

static source
V.normalizeProps(source, type)

A stored node's own settings, every value in range (missing ones at their defaults).

normalizePage

static source
V.normalizePage(value)

The page a stored value names, '' for every page.

termKey

static source
V.termKey(key)

The key a word has in System.json reactorBattle.terms.

label

static source
V.label(node, key, theme)

A word: the node's own, else the project's (System.json reactorBattle.terms), else the stock one.

pageOf

static source
V.pageOf(node)

The page a node shows on ('' for every page): by its type, else by its Shown on setting.

groupItems

static source
V.groupItems(items)

The rewards' items, one entry per kind of thing with how many of it, in the order they were made.

member

static source
V.member(before, after, expForLevel, capped)

One actor before and after the rewards, as a summary member.

Details

One actor before and after the rewards, as a summary member. before and after are snapshots { actorId, name, level, exp, params, skills, dead, reserve, faceName, ... }; expForLevel(level) is the actor's own EXP curve and capped whether it stands at its last level.

memberAt

static source
V.memberAt(member, t, out)

A member part of the way through the fill (t 0 to 1), written into out: the level it shows, how full its bar is, the EXP gained so far.

shownMembers

static source
V.shownMembers(summary, node)

The members the Experience page shows: the battle members, then (where the node says so) reserve members who gained EXP.

leveled

static source
V.leveled(summary)

Leveled.

rewardCount

static source
V.rewardCount(summary)

How many reward cards there are: the gold, when there is any, and one per kind of thing found.

pages

static source
V.pages(nodes, summary, sizeOf)

The pages of a summary under a record's nodes: [{ kind, from, count, frames }].

Details

The pages of a summary under a record's nodes: [{ kind, from, count, frames }]. sizeOf(node) gives a node's contents { width, height }. A record with none of the three nodes still has one page.

newRun

static source
V.newRun(summary, pages, node)

New run.

page

static source
V.page(run)

Page.

progress

static source
V.progress(run)

How far the page's fill has come, 0 to 1: it starts gently and settles into place.

strip

static source
V.strip(value)

Text with its codes taken out, its spaces kept.

plain

static source
V.plain(value)

Text as plain words on one line (a description may color a word or draw an icon; here it is the words alone).

wrap

static source
V.wrap(ctx, value, width, max, out)

Words broken into at most max lines that fit width, the last one cut with an ellipsis.

Details

Words broken into at most max lines that fit width, the last one cut with an ellipsis. ctx.font is set by the caller.

partyGrid

static source
V.partyGrid(node, width, height, count, out)

How the members are laid out in width x height: { cols, rows, per (members a page holds), cellWidth, cellHeight, gap, most (how far a card's parts may grow) }, written into out when one is given.

Details

How the members are laid out in width x height: { cols, rows, per (members a page holds), cellWidth, cellHeight, gap, most (how far a card's parts may grow) }, written into out when one is given. Of the numbers of rows that hold everyone, the one that shows a card largest: three members stand side by side, eight in two rows of four. More pages where no number of rows holds them. A card is no taller than its parts need, so the rows stand in the middle of the node.

gridCell

static source
V.gridCell(grid, width, height, index, count, out)

Where the index-th of count cards on a page sits, written into out (x, y): rows centered, the block centered top to bottom.

Details

Where the index-th of count cards on a page sits, written into out (x, y): rows centered, the block centered top to bottom.

partyCard

static source
V.partyCard(node, w, h, out, most)

Where a member card's parts sit inside w x h, written into out; block is the height they take together.

Details

Where a member card's parts sit inside w x h, written into out; block is the height they take together. most is how far they may grow past their base size (the grid's, for the node's height).

levelsGrid

static source
V.levelsGrid(node, width, height, count)

How the Level Up rows are laid out: { per (rows a page holds), rowHeight, gap, font, line, pad }.

rewardsGrid

static source
V.rewardsGrid(node, width, height)

How the reward cards are laid out: { cols, per (cards a page holds), cardWidth, cardHeight, gap, font, line, small, smallLine, pad }.

rewardAt

static source
V.rewardAt(summary, index, out)

The reward at index of the page list, written into out: the gold first where there is any, then the things found.

stockNodes

static source
V.stockNodes(metrics)

Stock nodes.

stockRecord

static source
V.stockRecord(metrics)

The stock interface as a whole record (what Stock Layout builds).

expForLevel

static source
V.expForLevel(klass, level)

An actor's total EXP at the start of a level, by its class's curve (the game's own formula).

sampleSummary

static source
V.sampleSummary(data, options)

Sample summary.