元编程参考文档

画面

34 个节点

本页内容 34

添加框

函数

A box of elements, laid out by its kind: vbox one under another, hbox side by side, grid in rows of columns, frame a panel with them placed over it, fixed each where its position puts it, viewport one under another and scrolled with the wheel.

签名
添加框 -> Screen Layout
    屏幕: Screen Layout
    种类: 文本
    内容: Screen Layout
    X: 数字
    Y: 数字
    间距: 数字
    内边距: 数字
    背景: 文本
    宽度: 数字
    高度: 数字
    列数: 整数
    条件: Condition
ScreenLayout AddBox(
    ScreenLayout screen,
    string kind,
    ScreenLayout contents,
    double x = 0.5,
    double y = 0.5,
    double spacing = 0,
    double padding = 0,
    string background = "",
    double width = 0,
    double height = 0,
    int columns = 1,
    Condition when)

参数

名称类型默认值说明
屏幕Screen Layout—The screen.
种类文本—vbox, hbox, grid, frame, fixed or viewport.
内容Screen Layout—What the box holds, from Start Contents.
X数字0.5Across.
Y数字0.5Down.
间距数字0Pixels between what it holds.
内边距数字0Pixels between its edge and what it holds.
背景文本—A colour such as #000000c0, an image or a file; empty for none.
宽度数字0Its width in pixels; 0 fits what it holds.
高度数字0Its height in pixels; 0 fits what it holds.
列数整数1A grid's number of columns.
条件Condition—Shown only while this holds; empty always.

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

添加遍历

函数

Elements once for every item of a list, with the item in a variable: a row for every gift in the bag.

签名
添加遍历 -> Screen Layout
    屏幕: Screen Layout
    变量: 文本
    列表: 文本
    内容: Screen Layout
ScreenLayout AddForEach(
    ScreenLayout screen,
    string variable,
    string list,
    ScreenLayout contents)

参数

名称类型默认值说明
屏幕Screen Layout—The screen.
变量文本—The name each item goes by, such as item.
列表文本—The list variable, such as bag.
内容Screen Layout—The elements for one item, from Start Contents.

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

添加条件

函数

Some elements while a condition holds and, optionally, others while it does not.

签名
添加条件 -> Screen Layout
    屏幕: Screen Layout
    条件: Condition
    则: Screen Layout
    否则: Screen Layout
ScreenLayout AddIf(
    ScreenLayout screen,
    Condition condition,
    ScreenLayout then,
    ScreenLayout otherwise)

参数

名称类型默认值说明
屏幕Screen Layout—
条件Condition—
则Screen Layout—
否则Screen Layout—

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

添加图片按钮

函数

A picture to press, such as a place on a map, with another picture under the pointer.

签名
添加图片按钮 -> Screen Layout
    屏幕: Screen Layout
    图像: 文本
    操作: Button Actions
    悬停图像: 文本
    X: 数字
    Y: 数字
    条件: Condition
    可交互: Condition
ScreenLayout AddPictureButton(
    ScreenLayout screen,
    string image,
    ButtonActions action,
    string hoverImage = "",
    double x = 0.5,
    double y = 0.5,
    Condition when,
    Condition sensitive)

参数

名称类型默认值说明
屏幕Screen Layout—The screen.
图像文本—The picture.
操作Button Actions—What pressing it does.
悬停图像文本—The picture under the pointer; empty brightens the first.
X数字0.5Across.
Y数字0.5Down.
条件Condition—Shown only while this holds; empty always.
可交互Condition—Pressable only while this holds, and shown greyed otherwise; empty always.

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

添加屏幕进度条

函数

A bar showing a variable against a maximum, such as trust out of ten.

签名
添加屏幕进度条 -> Screen Layout
    屏幕: Screen Layout
    变量: 文本
    最大值: 数字
    X: 数字
    Y: 数字
    宽度: 数字
    高度: 数字
    条件: Condition
ScreenLayout AddScreenBar(
    ScreenLayout screen,
    string variable,
    double maximum,
    double x = 0.5,
    double y = 0.05,
    double width = 300,
    double height = 20,
    Condition when)

参数

名称类型默认值说明
屏幕Screen Layout—
变量文本—
最大值数字—
X数字0.5
Y数字0.05
宽度数字300
高度数字20
条件Condition—

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

添加屏幕按钮

函数

A button with text on it.

签名
添加屏幕按钮 -> Screen Layout
    屏幕: Screen Layout
    文本: 文本
    操作: Button Actions
    X: 数字
    Y: 数字
    条件: Condition
    宽度: 数字
    高度: 数字
    可交互: Condition
ScreenLayout AddScreenButton(
    ScreenLayout screen,
    string text,
    ButtonActions action,
    double x = 0.5,
    double y = 0.5,
    Condition when,
    double width = 0,
    double height = 0,
    Condition sensitive)

参数

名称类型默认值说明
屏幕Screen Layout—The screen.
文本文本—What it says.
操作Button Actions—What pressing it does, from the action nodes.
X数字0.5Across.
Y数字0.5Down.
条件Condition—Shown only while this holds; empty always.
宽度数字0Its width in pixels; 0 fits the text.
高度数字0Its height in pixels; 0 for the usual.
可交互Condition—Pressable only while this holds, and shown greyed otherwise; empty always.

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

添加屏幕图像

函数

A picture on the screen: an image name or a file.

签名
添加屏幕图像 -> Screen Layout
    屏幕: Screen Layout
    图像: 文本
    X: 数字
    Y: 数字
    缩放: 数字
    条件: Condition
ScreenLayout AddScreenImage(
    ScreenLayout screen,
    string image,
    double x = 0.5,
    double y = 0.5,
    double zoom = 1,
    Condition when)

参数

名称类型默认值说明
屏幕Screen Layout—
图像文本—
X数字0.5
Y数字0.5
缩放数字1
条件Condition—

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

添加屏幕输入框

函数

A text field that types into a variable, such as a name.

签名
添加屏幕输入框 -> Screen Layout
    屏幕: Screen Layout
    变量: 文本
    X: 数字
    Y: 数字
    最大长度: 整数
    允许的字符: 文本
    宽度: 数字
    条件: Condition
ScreenLayout AddScreenInput(
    ScreenLayout screen,
    string variable,
    double x = 0.5,
    double y = 0.5,
    int maximumLength = 24,
    string allowed = "",
    double width = 400,
    Condition when)

参数

名称类型默认值说明
屏幕Screen Layout—
变量文本—
X数字0.5
Y数字0.5
最大长度整数24
允许的字符文本—
宽度数字400
条件Condition—

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

添加屏幕按键

函数

Acts when a key is pressed while the screen is up: escape, enter, space, left, a letter, f1...

签名
添加屏幕按键 -> Screen Layout
    屏幕: Screen Layout
    键: 文本
    操作: Button Actions
ScreenLayout AddScreenKey(
    ScreenLayout screen,
    string key,
    ButtonActions action)

参数

名称类型默认值说明
屏幕Screen Layout—
键文本—
操作Button Actions—

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

添加屏幕空白

函数

Empty space of a size, to hold things apart in a box.

签名
添加屏幕空白 -> Screen Layout
    屏幕: Screen Layout
    宽度: 数字
    高度: 数字
ScreenLayout AddScreenSpace(
    ScreenLayout screen,
    double width,
    double height)

参数

名称类型默认值说明
屏幕Screen Layout—
宽度数字—
高度数字—

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

添加屏幕文本

函数

Text on the screen; it may show variables with [name].

签名
添加屏幕文本 -> Screen Layout
    屏幕: Screen Layout
    文本: 文本
    X: 数字
    Y: 数字
    大小: 数字
    颜色: 文本
    宽度: 数字
    条件: Condition
ScreenLayout AddScreenText(
    ScreenLayout screen,
    string text,
    double x = 0.5,
    double y = 0.5,
    double size = 0,
    string color = "",
    double width = 0,
    Condition when)

参数

名称类型默认值说明
屏幕Screen Layout—The screen.
文本文本—The text.
X数字0.5Across.
Y数字0.5Down.
大小数字0Its size; 0 for the theme's.
颜色文本—Its colour, such as #ffffff; empty for the theme's.
宽度数字0How wide it may run before wrapping, in pixels; 0 for most of the stage.
条件Condition—Shown only while this holds; empty always.

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

添加屏幕计时器

函数

Acts when some seconds have passed, as a timed choice runs out; again every time they pass, when repeating.

签名
添加屏幕计时器 -> Screen Layout
    屏幕: Screen Layout
    秒数: 数字
    操作: Button Actions
    重复: 真否
ScreenLayout AddScreenTimer(
    ScreenLayout screen,
    double seconds,
    ButtonActions action,
    bool repeat = false)

参数

名称类型默认值说明
屏幕Screen Layout—
秒数数字—
操作Button Actions—
重复真否False

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

添加屏幕变量

函数

A variable of the screen's own with its first value, as typed; its buttons can change it, and it lasts as long as the screen.

签名
添加屏幕变量 -> Screen Layout
    屏幕: Screen Layout
    名称: 文本
    值: 文本
ScreenLayout AddScreenVariable(
    ScreenLayout screen,
    string name,
    string value)

参数

名称类型默认值说明
屏幕Screen Layout—
名称文本—
值文本—

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

添加引用画面

函数

Another screen's elements in place, such as a status bar several screens share.

签名
添加引用画面 -> Screen Layout
    屏幕: Screen Layout
    使用中: 文本
    参数: 文本
ScreenLayout AddUseScreen(
    ScreenLayout screen,
    string used,
    string arguments = "")

参数

名称类型默认值说明
屏幕Screen Layout—The screen.
使用中文本—The other screen's name.
参数文本—Values for its parameters as a script writes them, separated by commas: trust, "Wen"; empty for none.

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

锚定最后一个元素

函数

Puts the element added last at a point of itself other than its centre: (0, 0) puts its top left corner at its position, (1, 1) its bottom right, so (1, 1) at (1, 1) sits it in the stage's corner. In a vbox, an hbox or a grid it lines the element up within its place instead: (0, 0.5) in a vbox puts it against the box's left edge.

签名
锚定最后一个元素 -> Screen Layout
    屏幕: Screen Layout
    X 锚点: 数字
    Y 锚点: 数字
ScreenLayout AnchorLastElement(
    ScreenLayout screen,
    double xAnchor = 0.5,
    double yAnchor = 0.5)

参数

名称类型默认值说明
屏幕Screen Layout—The screen.
X 锚点数字0.5The point across it, as a share of its width.
Y 锚点数字0.5The point down it, as a share of its height.

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

回答

函数

Answers a called screen with a value, as typed, which the story reads as _return.

签名
回答(值: 文本) -> Button Actions
ButtonActions Answer(string value)

参数

名称类型默认值说明
值文本—

返回

操作Button Actions
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

关闭画面

函数

Closes the screen; a called one answers nothing.

签名
关闭画面() -> Button Actions
ButtonActions CloseScreen()

返回

操作Button Actions
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

前往标签

函数

Leaves the screen and continues the story at a label.

签名
前往标签(标签: 文本) -> Button Actions
ButtonActions GoToLabel(string label)

参数

名称类型默认值说明
标签文本—

返回

操作Button Actions
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

隐藏画面操作

函数

Hides another screen.

签名
隐藏画面操作(屏幕: 文本) -> Button Actions
ButtonActions HideScreenAction(string screen)

参数

名称类型默认值说明
屏幕文本—

返回

操作Button Actions
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

通知操作

函数

Shows a notification.

签名
通知操作(文本: 文本) -> Button Actions
ButtonActions NotifyAction(string text)

参数

名称类型默认值说明
文本文本—

返回

操作Button Actions
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

打开菜单操作

函数

Opens one of the game's menus: save, load, preferences, history, gallery, music_room, achievements or main_menu.

签名
打开菜单操作(菜单: 文本) -> Button Actions
ButtonActions OpenMenuAction(string menu)

参数

名称类型默认值说明
菜单文本—

返回

操作Button Actions
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

播放声音操作

函数

Plays a sound once.

签名
播放声音操作(文件: 文本) -> Button Actions
ButtonActions PlaySoundAction(string file)

参数

名称类型默认值说明
文件文本—

返回

操作Button Actions
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

运行命令操作

函数

Runs a command the game registers.

签名
运行命令操作(命令: 文本) -> Button Actions
ButtonActions RunCommandAction(string command)

参数

名称类型默认值说明
命令文本—

返回

操作Button Actions
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

画面转为脚本

函数

A screen as a script writes it.

签名
画面转为脚本(屏幕: Screen Layout) -> 文本
string ScreenToScript(ScreenLayout screen)

参数

名称类型默认值说明
屏幕Screen Layout—

返回

脚本文本
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

设置最后一个元素的样式属性

函数

Sets a style property on the element added last itself, laid over its style: outline_width2; on a button, a property starting text_ styles its label.

签名
设置最后一个元素的样式属性 -> Screen Layout
    屏幕: Screen Layout
    属性: 文本
    值: 文本
ScreenLayout SetLastElementStyleProperty(
    ScreenLayout screen,
    string property,
    string value)

参数

名称类型默认值说明
屏幕Screen Layout—The screen.
属性文本—The property, as a script names it.
值文本—Its value, as a script writes it.

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

设置画面样式前缀

函数

A prefix for the styles of everything on the screen: with gold, its buttons draw with gold_button when there is one.

签名
设置画面样式前缀 -> Screen Layout
    屏幕: Screen Layout
    前缀: 文本
ScreenLayout SetScreenStylePrefix(
    ScreenLayout screen,
    string prefix)

参数

名称类型默认值说明
屏幕Screen Layout—
前缀文本—

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

设置变量操作

函数

Sets a variable to a value, as typed.

签名
设置变量操作(变量: 文本, 值: 文本) -> Button Actions
ButtonActions SetVariableAction(string variable, string value)

参数

名称类型默认值说明
变量文本—
值文本—

返回

操作Button Actions
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

把变量设为某值操作

函数

Sets a variable to what an expression gives when the button is pressed, such as the item of a For Each row: item.

签名
把变量设为某值操作(变量: 文本, 表达式: 文本) -> Button Actions
ButtonActions SetVariableToAction(
    string variable,
    string expression)

参数

名称类型默认值说明
变量文本—
表达式文本—

返回

操作Button Actions
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

显示画面操作

函数

Shows another screen.

签名
显示画面操作(屏幕: 文本) -> Button Actions
ButtonActions ShowScreenAction(string screen)

参数

名称类型默认值说明
屏幕文本—

返回

操作Button Actions
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

开始内容

函数

A set of elements with no screen of its own yet, to fill a box, a branch or a loop with; build it with the Add nodes as a screen is built.

签名
开始内容() -> Screen Layout
ScreenLayout StartContents()

返回

内容Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

开始画面

函数

A screen with nothing on it yet.

签名
开始画面 -> Screen Layout
    名称: 文本
    调暗背景: 真否
    背景: 文本
    模态: 真否
    参数: 文本
ScreenLayout StartScreen(
    string name,
    bool dim = true,
    string background = "",
    bool modal = false,
    string parameters = "")

参数

名称类型默认值说明
名称文本—What Show Screen and Call Screen name it by.
调暗背景真否TrueDarken the game behind it.
背景文本—An image covering the stage behind it; empty for none.
模态真否FalseWhen shown, keep the player's clicks from the story underneath.
参数文本—Parameters its arguments bind to, separated by commas: question="Who?"; empty for none.

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

最后一个元素的样式

函数

Gives the element added last a style of its own (style), and for a box, a prefix for the styles of what it holds (style_prefix).

签名
最后一个元素的样式 -> Screen Layout
    屏幕: Screen Layout
    样式: 文本
    前缀: 文本
ScreenLayout StyleLastElement(
    ScreenLayout screen,
    string style = "",
    string prefix = "")

参数

名称类型默认值说明
屏幕Screen Layout—The screen.
样式文本—The style it draws with; empty keeps its kind's.
前缀文本—For a box: with gold, the buttons in it draw with gold_button when there is one; empty for none.

返回

画面Screen Layout
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

然后执行操作

函数

One action and then another: set a variable, then go to a label.

签名
然后执行操作 -> Button Actions
    第一个: Button Actions
    第二个: Button Actions
ButtonActions ThenAction(
    ButtonActions first,
    ButtonActions second)

参数

名称类型默认值说明
第一个Button Actions—
第二个Button Actions—

返回

操作Button Actions
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说

切换变量操作

函数

Turns a true variable false and a false one true.

签名
切换变量操作(变量: 文本) -> Button Actions
ButtonActions ToggleVariableAction(string variable)

参数

名称类型默认值说明
变量文本—

返回

操作Button Actions
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
画面
所属包
Novella 视觉小说