Welcome to Crapht Box
Crapht Box is a Fantasy Physics Sandbox, inspired by the Fantasy Console genre. It brings a simulated world with a number of disks and tools, and leaves you to play, program and share creations.
Table of content
- Part I. Fundamental
- Part II. Crafting
- Part III. Programming
- Part IV. Editors
- Part V. Sharing
Part I. Fundamental
Operations
Application:
LMB
: confirmEnter
: confirmEscape
: cancelY
/N
: yes/no-
Scroll wheel
: scroll F1
: show this manualF6
: take a screenshotF7
: record frames for GIFF8
: stop GIF recordingAlt
+Enter
: toggle fullscreenAlt
+F4
: exit application
Home:
Space
: load a selected disk
Crafting:
LMB
: confirm operations; move camera; or placing, holdShift
for continuous placingRMB
: select-
Scroll wheel
: scroll/zoom Ctrl
+Z
/Ctrl
+Y
: undo/redoCtrl
+H
: copy the history, holdShift
to escape double quotesCtrl
+F
: open the tool search box\
: hide the HUD-
/
: show wireframes Ctrl
+A
: select allCtrl
+C
: copy selectionCtrl
+X
: cut selectionCtrl
+V
: paste selectionLeft
/Right
/Up
/Down
: move selection, holdCtrl
for partial movingDelete
: delete selection
Capturing
Screenshot
Press F6
to take a screenshot, it prompts to save to your local storage.
GIF
Press F7
to record frames for GIF, press F8
to stop GIF recording, it prompts to save to your local storage.
Specifications
- Display: scalable from 640x480
- Audio: 2 music channels, 4 sound effect channels, 1 speech channel
- Circuit clock: 60Hz
- Code: Wren, Lua
- Gamepad: 6 buttons (D-Pad + A/B)
- Keyboard and mouse: supported
You can bind the gamepad buttons to keyboard or a gamepad device. The Left
, Right
, Up
, Down
, A
, B
are respectively binded to the A
, D
, W
, S
, J
, K
by default, you can change it in the Option
tab.
Disk structure
A typical disk comes with the following files under “${disk}
/content”:
File | Note | Editing |
---|---|---|
“info.json” | Meta data of this disk | External text editors |
“dictionary.json” | Localization data | External text editors |
“storyboard.json” | Storyboard data, including speech, dialog text, element indicator, etc. | External text editors |
“toolbox.json” | Availability data of the tools | External text editors |
“scene.json” | Scene data, including map path, instantiated elements and prefabs | Built-in map/level/element editors |
“map.map” | Map file | Open “scene.json” with built-in map editor |
“disk.wren” | Disk-wise utilities | N/A |
“main.wren” | Main source file | Built-in code editor, or external text editors |
“main.palette” | Palette file | N/A |
“sticker.png” | Disk sticker | Built-in capturing, or external image editors |
The meta data file “info.json” contains a number of fields that describe basic aspects of a disk. You might want to change some of it after creating a new disk. It can be loaded by Load.diskInfo()
with module “disk”. E.g.
{
"lang": 16, // 16 for Wren, 20 for Lua.
"usage": 0, // Reserved, always set to 0 for now.
"ugcid": 0, // 0 for common disk, otherwise with the Workshop ID of this disk.
"uid": "00000000-0000-0000-0000-000000000000", // Reserved.
"sticker": "sticker.png", // The sticker image.
"title": { // The display title in different languages.
"english": "Noname",
"chinese": "未命名"
},
"description": "", // The description on the Workshop web page.
"author": "Anonymous", // Your name here.
"version": "1.0", // The version number.
"genre": "ANY", // Reserved.
"email": "", // Reserved.
"url": "", // Reserved.
"creation": 0, // Reserved.
"controls": [ ], // Reserved.
"entries": { // The entry file path.
"main": "main.wren",
"editor": ""
},
"bundle": { // The bundle name in different languages.
"english": "Noname",
"chinese": "未命名"
},
"priority": 100, // A integer which controls display orders of disks.
"locked": false // You have to pass previous levels before unlocking
// this one with `true`, or ready to play with `false`.
}
The “dictionary.json” contains text information for runtime lookup. It can be loaded by the Dictionary
class in module “dictionary”. E.g.
{
"english": {
"greeting": "Ahoy!",
"stars": "Missions",
"stars/goal/tips": "Reach the goal",
"stars/defeat/tips": "Defeat the enemies",
"stars/time/tips": "Complete in 90s"
},
"chinese": {
"greeting": "嗨!",
"stars": "任务",
"stars/goal/tips": "到达目标点",
"stars/defeat/tips": "打败敌人",
"stars/time/tips": "在 90 秒内通关"
}
}
The “storyboard.json” can be loaded by the Storyboard
class in module “disk”. E.g.
{
"storyboard": {
"load": [
{
"type": "chat",
"text": "greeting"
},
{
"type": "say",
"text": "ahoy."
}
]
}
}
The “toolbox.json” can be loaded by Load.toolAvailability(...)
with module “disk”. E.g.
{
"availability": [
{
"category": "*",
"name": "*",
"value": true
}
]
}
The “scene.json” can be loaded by Load.sceneGraph(...)
with module “disk”. E.g.
{
"map": "map.map",
"toolbox": [
],
"prefab": [
{
"type": "create",
"category": "prefab",
"name": "goal_text",
"position": [
42.5, 2.5
],
"rotation": [
0, 1
],
"tag": "goal"
}
]
}
Part II. Crafting
There are four element categories in the crafting toolbox.
Physics elements
The physics category contains regular rigid bodies in a few shapes. It is the simplest structure in Crapht Box that does not conduct anything in a circuit, but it does work as framework in the physical scene. See physics elements for items. See tooltips in application for details.
Sensor elements
The sensor category contains gamepad input, mouse/touch input, in-scene interactable sensors, etc. Sensor can be used as signal source in a circuit. See sensor elements for items. See tooltips in application for details.
Chip elements
The chip category contains signal producers, conductors, mappers, consumers, etc. Chip can be used as signal source, intermediate node or output reactor in a circuit. See chip elements for items. See tooltips in application for details.
Dynamics elements
The dynamics category contains power sources, weapons, etc. Dynamics can be used as output reactor in a circuit. See dynamics elements for items. See tooltips in application for details.
Part III. Programming
Physics engine
Crapht Box uses the Box2D engine for physics simulation.
Syntax
Wren
Disk in Crapht Box is mainly programmed in the Wren programming language.
Lua
Experimental: It is also possible to program in the Lua programming language, using the B95 compiler implemented in Wren.
Importing
import "compiler/lua" for Lua
Class Lua
construct new()
: constructs a Lua compilerconstruct new(raise)
: constructs a Lua compilerraise
: the error raiser, defaults toFiber.abort
construct new(raise, options)
: constructs a Lua compilerraise
: the error raiser, defaults toFiber.abort
options
: a map of options, with range of values in the following table
Key of options |
Value | Note |
---|---|---|
"constructor" |
"new" , "ctor" |
Always use "ctor" in Crapht Box |
compile(code)
: compiles Lua code to Wrencode
: the source in Lua- returns the compiled code object
E.g.
import "b95" for Lua
var lua = Lua.new()
var code = lua.compile("print(22 / 7)")
System.print(code.toString)
Subscribe to the “Lua Loader” (ID: 1984358157) for details.
Directories
All data and editable disks are stored in a library directory on local storage. The root path of ${Documents}
is:
- “C:/Users/YourName/Documents/Crapht Box/” on Windows
Lookup priorities for import
:
Priority | Directory | Note |
---|---|---|
1 | Built-in | For Meta , Random |
2 | ”${disk} /content/” |
${disk} is the current running one |
3 | ”${app} /shell/content/” |
|
4 | Falls to reading/writing solvers |
Reading/writing solvers for IO accessing:
Prefix | Directory | Note |
---|---|---|
“app://” | ”./” | The current working directory |
“disk://” | ”${disk} /” |
${disk} is the current running one |
“doc://” | ”${Documents} /” |
|
- | - | Can be relative or absolute path |
Coordinates
Crapht Box implements two kinds of coordinate systems. The first one starts from the top-left corner for graphics primitives, GUI overlays, etc. and the second one starts from the bottom-left corner for in-scene objects.
Screen space:
World space:
Besides, there’s another local space which is similar to the world space, but the axises rotate along with an element itself.
Basic
Basic module
Crapht Box runs on top of a BASIC system. This module contains wrappers to communicate to it.
Importing
import "basic" for Basic, Terminal, Resource
Class Basic
- static
callRoutine(func [, ...])
: calls a BASIC functionfunc
: the function name to be called...
: optional variadic- returns optional return value from BASIC
- static
retainValue(name, val)
: retains a BASIC value to prevent from collected by the GCname
: a custom name for the valueval
: the value to be retained- returns
true
for success, otherwisefalse
- static
releaseValue(name)
: releases a BASIC value to give up retainment by Wrenval
: the value to be released- returns
true
for success, otherwisefalse
- static
clip(x, y, w, h)
: sets clip state in screen space - static
clip()
: resets clip state - static
text(x, y, txt, col)
: draws an ASCII text in screen space, same astext(x, y, txt, col, false)
col
:Color
- static
text(x, y, txt, col, isutf)
: draws an ASCII or UTF text in screen spacecol
:Color
isutf
:true
for UTF text, otherwise for ASCII; UTFString
is cached until ejecting a disk, so it’s recommended to use ASCII for frequently changing text, e.g. FPS, RAM stat. etc. only set this parameter totrue
for relatively static text when you really need
- static
plot(x, y, col)
: draws a point in screen spacecol
:Color
- static
line(x0, y0, x1, y1, w, col)
: draws a line in screen spacew
: the line widthcol
:Color
- static
circ(x, y, r, col)
: draws a circle in screen spacer
: the radiuscol
:Color
- static
circfill(x, y, r, col)
: fills a circle in screen spacer
: the radiuscol
:Color
- static
ellipse(x, y, rx, ry, col)
: draws an ellipse in screen spacerx
: the radius in the x axisry
: the radius in the y axiscol
:Color
- static
ellipsefill(x, y, rx, ry, col)
: fills an ellipse in screen spacerx
: the radius in the x axisry
: the radius in the y axiscol
:Color
- static
arc(x, y, r, sa, ea, pie, col)
: draws an arc/bow in screen spacer
: the radiussa
: start angleea
: end anglepie
:true
for pie shapecol
:Color
- static
arcfill(x, y, r, sa, ea, pie, col)
: fills a bow in screen spacer
: the radiussa
: start angleea
: end anglepie
:true
for pie shapecol
:Color
- static
rect(x0, y0, x1, y1, col)
: draws a rectangle in screen spacecol
:Color
- static
rectfill(x0, y0, x1, y1, col)
: fills a rectangle in screen spacecol
:Color
- static
sget(sprite, x, y [, frame])
: gets a palette index at a specific position of a spriteframe
: the frame index, defaults to 0- returns the palette index
- static
sset(sprite, x, y, val [, frame])
: sets a palette index to a specific position of a spriteframe
: the frame index, defaults to 0
- static
mget(map, x, y [, layer])
: gets a tile index at a specific position of a maplayer
: the map layer index, defaults to 0- returns the tile index
- static
mset(map, x, y, val [, layer])
: sets a tile index to a specific position of a maplayer
: the map layer index, defaults to 0
- static
iget(quantized, x, y)
: gets a palette index at a specific position of a quantized image- returns the palette index
- static
iset(quantized, x, y, val)
: sets a palette index to a specific position of a quantized image - static
tget(truecolor, x, y)
: gets a color value at a specific position of a true color image- returns the color value
-
static
tset(truecolor, x, y, val)
: sets a color value to a specific position of a true color image - static
btn(k)
: gets whether a specific key on the virtual gamepad is pressedk
: the specific key, can beKeyCode.GamepadLeft
,KeyCode.GamepadRight
,KeyCode.GamepadUp
,KeyCode.GamepadDown
,KeyCode.GamepadA
orKeyCode.GamepadB
- returns
true
for pressed, otherwisefalse
- static
btnp(k)
: gets whether a specific key on the virtual gamepad is just released from pressingk
: the specific key, can beKeyCode.GamepadLeft
,KeyCode.GamepadRight
,KeyCode.GamepadUp
,KeyCode.GamepadDown
,KeyCode.GamepadA
orKeyCode.GamepadB
- returns
true
for released, otherwisefalse
- static
key(k)
: gets whether a specific key on the keyboard is pressedk
: the specific key, can be one of the keyboard values of theKeyCode
class in module “keycode”- returns
true
for pressed, otherwisefalse
- static
keyp(k)
: gets whether a specific key on the keyboard is just released from pressingk
: the specific key, can be one of the keyboard values of theKeyCode
class in module “keycode”- returns
true
for released, otherwise `false
- static
touch()
: gets whether the left mouse button is pressed- returns
Vec2
for the pressing position, otherwisenull
- returns
- static
touch(k)
: gets whether a specific mouse button is pressedk
: the specific key, can beKeyCode.MouseLeft
,KeyCode.MouseMiddle
orKeyCode.MouseRight
- returns
Vec2
for the pressing position, otherwisenull
- static
touchp()
: gets whether the left mouse button is just released from pressing- returns
Vec2
for the releasing position, otherwisenull
- returns
- static
touchp(k)
: gets whether a specific mouse button is just released from pressingk
: the specific key, can beKeyCode.MouseLeft
,KeyCode.MouseMiddle
orKeyCode.MouseRight
- returns
Vec2
for the releasing position, otherwisenull
- static
touchm()
: gets the current mouse position- returns
Vec2
for the valid position, otherwisenull
- returns
- static
play(seq, channel, preset, loop)
: plays an MML (Music Macro Language)String
; useBasic.play("P", ch, 0, false)
to stop music at a specific channel, or use the followingstop
insteadseq
: the MML formatString
channel
: the channel to play withpreset
: the preset index in the sound fontloop
:true
for loop, otherwisefalse
- static
stop(channel)
: stops music started byplay
channel
: the channel to stop
The tones are indicated by letters A
through G
. Accidentals are indicated with a +
or #
(for sharp) or -
(for flat) immediately after the note letter. See this example:
Basic.play("C C# C C#", 0, 0, false)
Whitespaces are ignored inside the string expression. There are also codes that set the duration, octave and tempo. They are all case-insensitive. play
executes the commands or notes the order in which they appear in the string. Any indicators that change the properties are effective for the notes following that indicator.
Ln Sets the duration (length) of the notes. The variable n does not indicate an actual duration
amount but rather a note type; L1 - whole note, L2 - half note, L4 - quarter note, etc.
(L8, L16, L32, L64, ...). By default, n = 4.
For triplets and quintets, use L3, L6, L12, ... and L5, L10, L20, ... series respectively.
The shorthand notation of length is also provided for a note. E.g. "L4 CDE L8 FG L4 AB"
can be shortened to "L4 CDE F8G8 AB". F and G play as eighth notes while others play as quarter notes.
On Sets the current octave. Valid values for n are 0 through 6. An octave begins with C and ends with B.
Remember that C- is equivalent to B.
< > Changes the current octave respectively down or up one level.
Nn Plays a specified note in the seven-octave range. Valid values are from 0 to 84. (0 is a pause).
Cannot use with sharp and flat. Cannot use with the shorthand notation neither.
MN Stand for Music Normal. Note duration is 7/8ths of the length indicated by Ln. It is the default mode.
ML Stand for Music Legato. Note duration is full length of that indicated by Ln.
MS Stand for Music Staccato. Note duration is 3/4ths of the length indicated by Ln.
Pn Causes a silence (pause) for the length of note indicated (same as Ln).
Tn Sets the number of "L4"s per minute (tempo). Valid values are from 32 to 255. The default value is T120.
. When placed after a note, it causes the duration of the note to be 3/2 of the set duration.
This is how to get "dotted" notes. "L4 C#." would play C sharp as a dotted quarter note.
It can be used for a pause as well.
- static
say(words [, speed, pitch, throat, mouth])
: synthesises speechwords
: the textString
to synthesisespeed
: with range of values from 0 to 255, defaults to 72pitch
: with range of values from 0 to 255, defaults to 64throat
: with range of values from 0 to 255, defaults to 128mouth
: with range of values from 0 to 255, defaults to 128
Class Terminal
- static
show()
: shows the terminal -
static
hide()
: hides the terminal - static
write(t)
: writes something to the terminalt
: the text to write
- static
write(t, c)
: writes something to the terminal in a specific colort
: the text to writec
:Color
- static
write(t, r, g, b, a)
: writes something to the terminal in a specific colort
: the text to write
- static
writeLine(t)
: writes something to the terminal with a following newlinet
: the text to write
- static
writeLine(t, c)
: writes something to the terminal with a following newline in a specific colort
: the text to writec
:Color
- static
writeLine(t, r, g, b, a)
: writes something to the terminal with a following newline in a specific colort
: the text to write
- static
backspace()
: deletes a character backward - static
deleteLine()
: deletes a line - static
clear()
: clears the terminal
Class Resource
construct load(path)
: constructs aResource
by loading from file, same asconstruct load(path, false)
path
: the file path to load
construct load(path, isrel)
: constructs aResource
by loading from filepath
: the file path to loadisrel
:true
for relative path, otherwise for absolute; can use shurtcut prefixes ("app://"
,"disk://"
,"doc://"
) if set tofalse
construct load(type, width, height)
: constructs aResource
by loading a blank datapath
: can be"sprite"
,"map"
,"quantized"
construct load(type, width, height, n)
: constructs aResource
by loading a blank datapath
: can be"sprite"
,"map"
,"quantized"
-
unload()
: unloads this resource -
count
: gets the frame count width
: gets the width of any frameheight
: gets the height of any frame
Standard
Collection module
Importing
import "collection" for Stack, Mapper
Class Stack
Stack is a kind of LIFO data structure.
construct new()
: constructs aStack
construct new(threshold)
: constructs aStack
with a specific capacity thresholdthreshold
: the capacity threshold
isEmpty
: gets whether this stack is empty- returns
true
for empty, otherwisefalse
- returns
peek
: gets the top element in this stack- returns the top element in this stack
push(val)
: pushes a value to the top of this stackval
: the specific value to push
pop()
: pops a value from the top of this stack- returns the popped element from this stack
Class Mapper
- static
merge(...)
: merges a number of WrenMap
s into a new one, latter entries override former...
: the specificMap
s- returns the merged
Map
- static
mustBe(obj, k)
: gets the value corresponding to a specific key in aMap
, raises an error if not foundobj
: theMap
objectk
: the specific key- returns the corresponding value, or
- throws error
- static
mayBe(obj, k, fall)
: gets the value corresponding to a specific key in aMap
, returns an alternative if not foundobj
: theMap
objectk
: the specific keyfall
: the alternative value- returns the corresponding value, or
fall
Coroutine module
Importing
import "coroutine" for Coroutine
Class Coroutine
Coroutine can suspend their execution and allows re-entry at multiple entry points. This Coroutine
dispatcher accepts and manages Wren Fiber
and updates them at a specific time point, just acts similar to the Unity3D’s.
-
construct new()
: constructs aCoroutine
dispatcher isEmpty
: gets whether there’s no alive coroutine in this dispatcher- returns
true
for empty, otherwisefalse
- returns
clear()
: clears all coroutinesstart(co [, ...])
: starts a coroutine with optional argumentsco
:Fn
/Fiber
...
: the option arguments
update(delta)
: updates through all fibers of this dispatcher; this function is often called in aProgram
-wiseupdate
proceduredelta
: the elapsed time in seconds since last updating
Datetime module
Importing
import "datetime" for DateTime
Class DateTime
- static
ticks
: gets ticks in seconds since startup; similar to Wren’sSystem.clock
but do not mix them together for time counting- returns the wall clock independent ticks in seconds since startup
- static
now
: gets current data- returns a
List
ofNum
s respectively for year, month, day, hour, minute and second
- returns a
Image module
Importing
import "image" for Image
Class Image
-
construct new()
: constructs an image object [x, y]
: gets the color value at a specific position- returns the color value
-
[x, y] = (col)
: sets the color value to a specific position width
: gets the width in pixels-
height
: gets the height in pixels resize(w, h)
: resizes this image object- returns
true
for success, otherwisefalse
- returns
load(w, h)
: loads from blank data with a specific size- returns
true
for success, otherwisefalse
- returns
load(path)
: loads from a file- returns
true
for success, otherwisefalse
- returns
save(path)
: saves to a file- returns
true
for success, otherwisefalse
- returns
IO module
Importing
import "io" for Path, File, FileInfo, DirectoryInfo
Class Path
- static
absoluteOf(path)
: gets the absolute path of a pathString
path
: the pathString
- returns the absolute path
- static
parentOf(path)
: gets the parent path of a pathString
path
: the pathString
- returns the parent path
String
- static
nameOf(path)
: gets the name of a pathString
path
: the pathString
- returns the name
String
- static
extensionOf(path)
: gets the extension of a pathString
path
: the pathString
- returns the extension
String
- static
split(path)
: splits a pathString
into partspath
: the pathString
- returns the splitted result as a
List
of the parent, name and extensionString
- static
concat(patha, pathb)
: concatenates path parts into oneString
patha
: the first pathString
pathb
: the secondString
- returns the concatenated path
String
- static
exists(path)
: checks whether a specific path exists as either file or directorypath
: the pathString
- returns
true
for exists, otherwisefalse
- static
move(path, target)
: moves a file or directory to somewhere else, use this to rename something as wellpath
: the source pathString
target
: the target pathString
- returns
true
for success, otherwisefalse
- static
copy(path, target)
: copies a file or directory to somewhere elsepath
: the source pathString
target
: the target pathString
- returns
true
for success, otherwisefalse
- static
remove(path [, toTrashBin])
: removes a file or directory from local storagepath
: the pathString
toTrashBin
: whether removes to the trash bin, defaults totrue
- returns
true
for success, otherwisefalse
- static
createFile(path)
: creates a file at a specific pathpath
: the pathString
- returns
true
for success, otherwisefalse
- static
createDirectory(path)
: creates a directory at a specific pathpath
: the pathString
- returns
true
for success, otherwisefalse
- static
getFiles(path, pattern [, recursive])
: gets all files under a specific directorypath
: the pathString
pattern
: the searching pattern, e.g."*"
,"*.json"
,"*_data_??.txt"
recursive
: whether searches recursively, defaults tofalse
- returns the matched files as a
List
of pathString
- static
getDirectories(path [, recursive])
: gets all directories under a specific directorypath
: the pathString
pattern
: the searching pattern, e.g."*"
,"*saved*"
recursive
: whether searches recursively, defaults tofalse
- returns the matched directories as a
List
of pathString
- static
explore(path)
: explores to a specific path with the file explorer on your computerpath
: the pathString
Class File
-
construct new()
: constructs aFile
object open(path [, write])
: opens a specific file pathpath
: the file pathwrite
: defaults tofalse
- returns
true
for success, otherwisefalse
close()
: closes this file- returns
true
for success, otherwisefalse
- returns
length
: gets the length in bytes of this fileendOfStream
: gets whether the IO cursor is at the end of this file- returns
true
for end of file, otherwisefalse
- returns
peek
: gets the IO cursor- returns the IO cursor
poke(pos)
: sets the IO cursor to a specific positionpos
: the expected IO cursor
readAll()
: reads all content in this file asString
and moves the IO cursor- returns the read
String
- returns the read
read()
: read a byteNum
and moves the IO cursor- returns the read byte
Num
- returns the read byte
readU8()
: read a byteNum
and moves the IO cursor- returns the read byte
Num
- returns the read byte
readI32()
: read a 32bit integerNum
and moves the IO cursor- returns the read 32bit integer
Num
- returns the read 32bit integer
readFloat()
: reads an IEEE-754 single floatNum
and moves the IO cursor- returns the read single float
Num
- returns the read single float
readString(length)
: reads a specific length of bytes asString
and moves the IO cursorlength
: the expected reading length- returns the read
String
readLine()
: read a line ofString
and moves the IO cursor- returns the read
String
- returns the read
readBytes()
: reads all content in this file as aList
of bytes and moves the IO cursor- returns the read
List
of bytes
- returns the read
write(data)
: writes a byteNum
and moves the IO cursordata
: the byteNum
to write
writeU8(data)
: writes a byteNum
and moves the IO cursordata
: the byteNum
to write
writeI32(data)
: writes a 32bit integerNum
and moves the IO cursordata
: the 32bit integerNum
to write
writeFloat(data)
: writes an IEEE-754 single floatNum
and moves the IO cursordata
: the single floatNum
to write
writeString(data)
: writes aString
without ending'\0'
and moves the IO cursordata
: theString
to write
writeLine(data)
: writes aString
with newline but without ending'\0'
and moves the IO cursordata
: theString
to write
writeBytes(data)
: writes aList
of bytes and moves the IO cursordata
: theList
of bytes to write
Class FileInfo
construct new(path)
: constructs a file information objectpath
: the specific file path
isEmpty
: gets whether this file is empty- returns
true
for empty, otherwisefalse
- returns
fullName
: gets the full pathparentName
: gets the parent directory namename
: gets the file name-
extension
: gets the extension name exists
: gets whether this file exists on local storage- returns
true
for exists, otherwisefalse
- returns
create()
: creates this file onto local storage if it doesn’t exist yet- returns
true
for success, otherwisefalse
- returns
remove([toTrashBin])
: removes this file from local storagetoTrashBin
: whether removes to the trash bin, defaults totrue
- returns
true
for success, otherwisefalse
moveTo(target)
: moves this file to somewhere elsetarget
: the target pathString
- returns
true
for success, otherwisefalse
copyTo(target)
: copies this file to somewhere elsetarget
: the target pathString
- returns
true
for success, otherwisefalse
readAll()
: reads all content in this file asString
- returns the read
String
- returns the read
parent
: gets the parent directory information object of this file- returns the parent
DirectoryInfo
of this file
- returns the parent
Class DirectoryInfo
construct new(path)
: constructs a directory information objectpath
: the specific directory path
isEmpty
: gets whether this directory is empty- returns
true
for empty, otherwisefalse
- returns
fullName
: gets the full pathparentName
: gets the parent directory name-
name
: gets the directory name exists
: gets whether this directory exists on local storage- returns
true
for exists, otherwisefalse
- returns
create()
: creates this directory onto local storage if it doesn’t exist yet- returns
true
for success, otherwisefalse
- returns
remove([toTrashBin])
: removes this directory from local storagetoTrashBin
: whether removes to the trash bin, defaults totrue
- returns
true
for success, otherwisefalse
moveTo(target)
: moves this directory to somewhere elsetarget
: the target pathString
- returns
true
for success, otherwisefalse
copyTo(target)
: copies this directory to somewhere elsetarget
: the target pathString
- returns
true
for success, otherwisefalse
getFiles(pattern [, recursive])
: gets all files under this directorypattern
: the searching pattern, e.g."*"
,"*.json"
,"*_data_??.txt"
recursive
: whether searches recursively, defaults tofalse
- returns the matched files as a
List
of pathString
getDirectories([recursive])
: gets all sub directories under this directorypattern
: the searching pattern, e.g."*"
,"*saved*"
recursive
: whether searches recursively, defaults tofalse
- returns the matched directories as a
List
of pathString
parent
: gets the parent directory information object of this directory- returns the parent
DirectoryInfo
of this directory
- returns the parent
JSON module
Importing
import "json" for Json
Class Json
- static
parse(string [, ordered])
: parses a JSONString
to Wren objectstring
: the JSONString
to parseordered
: whether keeps the order of the original JSON, defaults tofalse
- returns the parsed Wren object
- static
stringify(object [, compact])
: stringfies a Wren object to JSONString
object
: the Wren object to stringifycompact
: whether compacts the stringfiedString
, defaults tofalse
- returns the stringfied
String
Keycode module
Importing
import "keycode" for KeyCode
Class KeyCode
This class contains constants for mouse, gamepad and keyboard keys, the names quite tell what they are.
- static
MouseLeft
- static
MouseMiddle
-
static
MouseRight
- static
GamepadLeft
- static
GamepadRight
- static
GamepadUp
- static
GamepadDown
- static
GamepadA
-
static
GamepadB
- static
Return
- static
Esc
- static
Backspace
- static
Tab
-
static
Space
-
static
A
~Z
-
static
Num0
~Num9
-
static
F1
~F12
- …
See “${app}
/shell/content/keycode.wren” for more.
OS module
Importing
import "os" for Os
Class Os
-
static
info
: gets the current OS information, including name and version - static
clipboardText
: gets the text in the clipboard - static
clipboardText = (txt)
: sets a text to the clipboard
Random module
Importing
import "random" for Random
Class Random
See Random
for details.
Web module
Importing
import "web" for Web
Class Web
-
static
surf(url)
: navigates to a specific URL with browser -
static
request(url [, method [, field]])
: performs an HTTP requesturl
: the URL to requestmethod
: the request method, can be"get"
or"post"
, defaults to"get"
field
: the fields for post, defaults tonull
Common
Common module
Importing
import "common" for Direction, Component, Group, Vec2, Vec3, Vec4, Rect, Rot, Color, Handle
Class Direction
- static
Left
- static
Right
- static
Up
- static
Down
- static
Any
Class Component
- static
None
- static
Fixture
- static
Joint
- static
Conduction
- static
Particle
- static
Contact
- static
Target
- static
All
: composited by all above
Class Group
- static
Void
- static
Environment
- static
Player
- static
Ai
- static
All
: composited by all above
Class Vec2
construct new()
: constructs aVec2
valueconstruct new(x, y)
: constructs aVec2
valuex
: the x componenty
: the y component
-
toString
: gets theString
representation of the value x
: gets the x componentx = (value)
: sets the x componenty
: gets the y component-
y = (value)
: sets the component -
: gets the component-wise negative value of this value+ (other)
: gets the component-wise sum value of this and another valueother
:Vec2
- (other)
: gets the component-wise difference value of this and another valueother
:Vec2
* (other)
: gets the component-wise product value of this value and anotherNum
other
:Num
normalize()
: normalizes this valuenormalized
: gets the normalized value of this value- returns
Vec2
- returns
length
: gets the length of this value- returns
Num
- returns
lengthSquared
: gets the square of the length of this value- returns
Num
- returns
distance(other)
: gets the distance between this and another valueother
:Vec2
- returns
Num
distanceSquared(other)
: gets the square of the distance between this and another valueother
:Vec2
- returns
Num
dot(other)
: gets the dot product of this and another valueother
:Vec2
- returns
Num
cross(other)
: gets the cross product of this and another value orNum
other
:Vec2
/Num
- returns
Num
/Vec2
angle()
: gets the angle from the x+ axis to this value- returns
Num
- returns
angle(other)
: gets the angle from this value to anotherother
:Vec2
- returns
Num
rotated(angle)
: gets the rotatedVec2
of this value around the origin by a specific angleother
:Vec2
- returns
Vec2
rotated(angle, pivot)
: gets the rotatedVec2
of this value around a specific pivot by a specific angleangle
:Num
pivot
:Vec2
- returns
Vec2
Class Vec3
construct new()
: constructs aVec3
valueconstruct new(x, y, z)
: constructs aVec3
valuex
: the x componenty
: the y componentz
: the z component
-
toString
: gets theString
representation of this value x
: gets the x componentx = (value)
: sets the x componenty
: gets the y componenty = (value)
: sets the y componentz
: gets the z component-
z = (value)
: sets the z component -
: gets the component-wise negative value of this value+ (other)
: gets the component-wise sum value of this and another valueother
:Vec3
- (other)
: gets the component-wise difference value of this and another valueother
:Vec3
* (other)
: gets the component-wise product value of this and another valueother
:Num
normalize()
: normalizes this valuenormalized
: gets the normalized value of this value- returns
Vec3
- returns
length
: gets the length of this value- returns
Num
- returns
lengthSquared
: gets the square of the length of this value- returns
Num
- returns
distance(other)
: gets the distance between this and another valueother
:Vec3
- returns
Num
distanceSquared(other)
: gets the square of the distance between this and another valueother
:Vec3
- returns
Num
dot(other)
: gets the dot product of this and another valueother
:Vec3
- returns
Num
cross(other)
: gets the cross product of this and another valueother
:Vec3
- returns
Num
Class Vec4
construct new()
: constructs aVec4
valueconstruct new(x, y, z, w)
: constructs aVec4
valuex
: the x componenty
: the y componentz
: the z componentw
: the w component
-
toString
: gets theString
representation of this value x
: gets the x componentx = (value)
: sets the x componenty
: gets the y componenty = (value)
: sets the y componentz
: gets the z componentz = (value)
: sets the z componentw
: gets the w componentw = (value)
: sets the w component
Class Rect
construct new()
: constructs aRect
valueconstruct new(x, y, w, h)
: constructs aRect
valuex
: the x componenty
: the y componentw
: the widthh
: the height
-
toString
: gets theString
representation of this value x
: gets the x componentx = (value)
: sets the x componenty
: gets the y componenty = (value)
: sets the y componentwidth
: gets the widthwidth = (value)
: sets the widthheight
: gets the heightheight = (value)
: sets the height
Class Rot
construct new()
: constructs aRot
valueconstruct new(a)
: constructs aRot
valuea
: the angle value
construct new(s, c)
: constructs aRot
values
: the sine componentc
: the cosine component
-
toString
: gets theString
representation of this value s
: gets the sine components = (value)
: sets the sine componentc
: gets the cosine component-
c = (value)
: sets the cosine component angle
: gets the angle represented by this value-
angle = (value)
: sets the angle representation to this value * (other)
: gets the product of this value and anotherRot
orVec2
other
: anotherRot
to combine both to a new rotation,Vec2
to rotate the vector- returns the combined rotation or rotated vector
Class Color
- static
Black
: with0, 0, 0, 255
respectively for components - static
White
: with220, 220, 220, 255
respectively for components - static
Red
: with204, 127, 118, 255
respectively for components - static
Green
: with92, 173, 95, 255
respectively for components - static
Blue
: with106, 193, 200, 255
respectively for components - static
Yellow
: with203, 214, 137, 255
respectively for components -
static
Orange
: with239, 128, 32, 255
respectively for components construct new()
: constructs aColor
valueconstruct new(r, g, b)
: constructs aColor
valuer
: the red component as byteNum
g
: the green component as byteNum
b
: the blue component as byteNum
construct new(r, g, b, a)
: constructs aColor
valuer
: the red component as byteNum
g
: the green component as byteNum
b
: the blue component as byteNum
a
: the alpha component as byteNum
-
toString
: gets theString
representation of this value r
: gets the red componentr = (value)
: sets the red componentg
: gets the green componentg = (value)
: sets the green componentb
: gets the blue componentb = (value)
: sets the blue componenta
: gets the alpha component-
a = (value)
: sets the alpha component rgba
: gets the 32bit integerNum
representation of this valuergba = (value)
: sets the 32bit integerNum
representation to this value
Class Handle
-
static
Invalid
: -
toString
: gets theString
representation of this value id
: gets the ID of thisHandle
-
isValid
: gets whether thisHandle
is valid type
: gets the type of the element of thisHandle
, can beBody.Static
,Body.Kinematic
orBody.Dynamic
-
type = (value)
: sets the type of the element of thisHandle
category
: gets the category of the element- returns
String
/null
- returns
-
category = (value)
: sets the category of the element name
: gets the name of the element- returns
String
/null
- returns
-
name = (value)
: sets the name of the element nature
: gets the nature of the element, can be one of the values of theNature
class in module “alchemy”-
nature = (value)
: sets the nature of the element group
: gets the group of the element, can be on of the values of theGroup
class in module “common”-
group = (value)
: sets the group of the element instantiated
: gets whether the element is instantiated from toolbox- returns
Bool
- returns
operable
: gets whether the element is operable- returns
Bool
- returns
queriable
: gets whether the element is queriable by filter, query and ray casting- returns
Bool
- returns
-
queriable = (value)
: sets whether the element is queriable by filter, query and ray casting joinable
: gets whether the element is joinable with neighbor elements- returns
Bool
- returns
-
joinable = (value)
: sets whether the element is joinable with neighbor elements conductible
: gets whether the element is conductible with neighbor chip elements- returns
Bool
- returns
-
conductible = (value)
: sets whether the element is conductible with neighbor chip elements contactable
: gets whether the element triggers contact callbacks- returns
Bool
- returns
-
contactable = (value)
: sets whether the element triggers contact callbacks platform
: gets whether the element is a platform- returns
Bool
- returns
-
platform = (value)
: sets whether the element is a platform visible
: gets whether the element is visible- returns
Bool
- returns
-
visible = (value)
: sets whether the element is visible awake
: gets whether the element is awake- returns
Bool
- returns
-
awake = (value)
: sets whether the element is awake position
: gets the position of the element- returns
Vec2
- returns
-
position = (value)
: sets the position of the element rotation
: gets the rotation of the element- returns
Rot
- returns
-
rotation = (value)
: sets the rotation of the element size
: gets the size of the element- returns
Vec2
- returns
-
size = (value)
: sets the size of the element aabb
: gets the AABB of the element- returns
Rect
- returns
up
: gets the normalizedVec2
on the y+ axis in local space of the element- returns
Vec2
- returns
down
: gets the normalizedVec2
on the y- axis in local space of the element- returns
Vec2
- returns
left
: gets the normalizedVec2
on the x- axis in local space of the element- returns
Vec2
- returns
right
: gets the normalizedVec2
on the x+ axis in local space of the element- returns
Vec2
- returns
direct(vec)
: gets theVec2
in a specific direction in local space of the element- returns
Vec2
- returns
inverse(vec)
: gets the inverseVec2
in a specific direction in local space of the element- returns
Vec2
- returns
-
vibrate(interval, amplitude)
: vibrates the element resource
: gets the resource of the element-
resource = (value)
: sets the resource of the element color
: gets the color of the element- returns
Color
- returns
-
color = (value)
: sets the color of the element renderableRotation
: gets the rotation of the renderable resource of the element- returns
Rot
- returns
-
renderableRotation = (value)
: sets the rotation of the renderable resource of the element renderableHFlip
: gets whether flips horizontally for the renderable resource of the element- returns
Bool
- returns
-
renderableHFlip = (value)
: sets whether flips horizontally for the renderable resource of the element renderableVFlip
: gets whether flips vertically for the renderable resource of the element- returns
Bool
- returns
-
renderableVFlip = (value)
: sets whether flips vertically for the renderable resource of the element length
: gets the total frame count of any loaded sprite resource of the element- returns
Num
- returns
play([begin, end [, loop, init]])
: plays a specific range of frames for animationbegin
: beginning frame index or tagString
, starts from 0, defaults to -1end
: ending frame index or tagString
, starts from 0, defaults to -1loop
: whether loops the playing, defaults totrue
init
: whether initializes to the beginning frame, defaults totrue
hp
: gets the hitpoints of the element- returns
Num
- returns
-
hp = (points)
: sets the hitpoints of the element conduct([conn])
: conducts this chip element with neighborsconn
:true
for connected,false
for broken, defaults totrue
get(type, key)
: gets the value of a specific type and key of the elementget(key)
: gets the value of a specific key of the elementset(type, key, val)
: sets the value to a specific type and key of the element-
set(key, val)
: sets the value to a specific key of the element bounce
: gets the bounce rate of the element- returns
Num
- returns
-
bounce = (rate)
: sets the bounce rate of the element fixedRotation
: gets whether the rotation of the element is fixed- returns
Bool
- returns
-
fixedRotation = (fixed)
: sets whether the rotation of the element is fixed linearDamping
: gets the linear damping of the element- returns
Num
- returns
linearDamping = (damping)
: sets the linear damping of the elementangularDamping
: gets the angular damping of the element- returns
Num
- returns
-
angularDamping = (damping)
: sets the angular damping of the element linearVelocity
: gets the linear velocity of the element- returns
Vec2
- returns
linearVelocity = (velocity)
: sets the linear velocity of the elementangularVelocity
: gets the angular velocity of the element- returns
Num
- returns
-
angularVelocity = (omega)
: sets the angular velocity of the element applyForce(force, point)
: applies specific force to a specific point of the elementforce
:Vec2
point
:Vec2
applyForceToCenter(force)
: applies specific force to the center point of the elementforce
:Vec2
applyTorque(torque)
: applies specific torque to the elementtorque
:Num
applyLinearImpulse(impulse, point)
: applies specific linear impulse to a specific point of the elementimpulse
:Vec2
point
:Vec2
applyAngularImpulse(impulse)
: applies specific angular impulse to the elementimpulse
:Num
addFixture(params, shape)
: adds a fixture to the element-
clearFixtures()
: clears all fixtures of the element destroy()
: destroies the element
Elements
Physics module
Importing
import "physics" for WorldParam, World, Shape, Fixture, Body, JointParam, Joint
Class WorldParam
Use the following constants to get/set properties with Handle.get
/Handle.set
of a World
.
- static
MapLayerScale
Class World
-
static
unit
: gets how much in world space a unit of grid is -
static
new(g)
: creates aWorld
elementg
: the gravity of theWorld
element- returns the created
World
handle ornull
Class Shape
- static
Circle
- static
Edge
- static
Polygon
- static
Chain
Class Fixture
- static
density
: gets the recommended density of a fixture
Class Body
- static
Static
- static
Kinematic
-
static
Dynamic
- static
new(hworld, type, pos)
: creates aBody
elementhworld
: the parentWorld
handletype
: the type of theBody
element, can be one of the above constantspos
: the initial position- returns the created
Body
handle ornull
Class JointParam
Use the following constants to get/set properties with Handle.get
/Handle.set
of a Joint
.
- static
BreakForceSquare
- static
Joint1
- static
Joint2
- static
GroundAnchorA
- static
GroundAnchorB
- static
LocalAnchorA
- static
LocalAnchorB
- static
LocalAxisA
- static
LinearOffset
- static
Target
- static
LowerTranslation
- static
UpperTranslation
- static
LowerAngle
- static
UpperAngle
- static
ReferenceAngle
- static
Length
- static
LengthA
- static
LengthB
- static
Ratio
- static
DampingRatio
- static
FrequencyHz
- static
CorrectionFactor
- static
AngularOffset
- static
MotorSpeed
- static
MaxLength
- static
MaxForce
- static
MaxMotorForce
- static
MaxTorque
- static
MaxMotorTorque
- static
CollideConnected
- static
EnableLimit
- static
EnableMotor
Class Joint
- static
Unknown
- static
Revolute
- static
Prismatic
- static
Distance
- static
Pulley
- static
Mouse
- static
Gear
- static
Wheel
- static
Weld
- static
Friction
- static
Rope
-
static
Motor
- static
new(hworld, type, params)
: creates aJoint
elementhworld
: the parentWorld
handletype
: the type of theJoint
element, can be one of the above constants- returns the created
Joint
handle ornull
- static
new(hworld, type, params, options)
: creates aJoint
elementhworld
: the parentWorld
handletype
: the type of theJoint
element, can be one of the above constants- returns the created
Joint
handle ornull
- static
new(hworld, type, params, options , refocusOnBroken)
: creates aJoint
elementhworld
: the parentWorld
handletype
: the type of theJoint
element, can be one of the above constants- returns the created
Joint
handle ornull
Particles module
Importing
import "particles" for Particle, ParticleSystem, ParticleGroupParam, ParticleGroup, ParticleEmitter
Class Particle
- static
Water
- static
Zombie
- static
Wall
- static
Spring
- static
Elastic
- static
Viscous
- static
Powder
- static
Tensile
- static
Barrier
- static
StaticPressure
- static
Reactive
- static
Repulsive
Class ParticleSystem
- static
new(hworld)
: creates aParticleSystem
elementhworld
: the parentWorld
handle- returns the created
ParticleSystem
handle ornull
- static
new(hworld, gravityScale)
: creates aParticleSystem
elementhworld
: the parentWorld
handlegravityScale
: the gravity scale- returns the created
ParticleSystem
handle ornull
- static
new(hworld, gravityScale, density)
: creates aParticleSystem
elementhworld
: the parentWorld
handlegravityScale
: the gravity scaledensity
: the density- returns the created
ParticleSystem
handle ornull
Class ParticleGroupParam
Use the following constants to get/set properties with Handle.get
/Handle.set
of a ParticleGroup
.
- static
LifetimeBegin
- static
LifetimeEnd
- static
ColorBegin
- static
ColorEnd
- static
ColorFadingBegin
- static
ColorFadingEnd
- static
Direction
- static
Velocity
- static
CouldCollide
- static
Shape
- static
Radius
- static
Flags
- static
Count
Class ParticleGroup
- static
new(handle)
: creates aParticleGroup
elementhandle
: the parentWorld
orParticleSystem
handle- returns the created
ParticleGroup
handle ornull
- static
new(handle, shape)
: creates aParticleGroup
elementhandle
: the parentWorld
orParticleSystem
handleshape
: the shape of the initial emitting area- returns the created
ParticleGroup
handle ornull
Class ParticleEmitter
- static
emit(hgroup)
: emits a piece of particlehgroup
: the parentParticleGroup
handle- returns
true
for success, otherwisefalse
Electronics module
Importing
import "electronics" for CircuitParam, Circuit, ChipParam, Chip
Class CircuitParam
Blank.
Class Circuit
Blank.
Class ChipParam
Use the following constants to get/set properties with Handle.get
/Handle.set
of a Chip
.
- static
Value
- static
Switchable
- static
SwitchTo
- static
SwitchFor
- static
Switchmost
- static
Flippable
- static
Flipped
Class Chip
- static
ConstantByte
- static
ConstantAscii
- static
RandomizerByte
- static
Pulse
- static
Register
- static
Accumulator
- static
Relay
- static
Delay
- static
Fuse
- static
TriggerEdge
- static
TriggerDifference
- static
WireI
- static
WireL
- static
WireY
- static
WirelessSender
- static
WirelessReceiver
- static
ReactorEmitter
- static
ReactorDot
- static
ReactorLed
- static
ReactorAscii
- static
ReactorSsd
- static
DecoderNum2Ssd
- static
AlgebraNeg
- static
AlgebraAdd
- static
AlgebraSub
- static
AlgebraMul
- static
AlgebraDiv
- static
AlgebraMod
- static
AlgebraAbs
- static
CompareEq
- static
CompareNeq
- static
CompareLt
- static
CompareLeq
- static
CompareGt
- static
CompareGeq
- static
LogicAnd
- static
LogicOr
- static
LogicNot
- static
LogicXor
- static
BitwiseAnd
- static
BitwiseOr
- static
BitwiseNot
- static
BitwiseXor
- static
BitwiseLShift
- static
BitwiseRShift
-
static
EnvironmentNow
-
static
frequency
: gets the frequency of the circuit clock, always returns 60(Hz) - static
new(hworld, type, pos)
: creates aChip
elementhworld
: the parentWorld
handletype
: the type of theChip
element, can be one of the above constants plus aBody
type constant, e.g.Body.Dynamic | Chip.ConstantByte
pos
: the initial position- returns the created
Chip
handle ornull
Sensor module
Importing
import "sensor" for Sensor
Class Sensor
- static
GamepadDown
- static
GamepadUp
- static
Toggle
- static
TouchDown
- static
TouchUp
- static
TouchDownRelay
- static
TouchUpRelay
- static
CrossGate
- static
ContactGate
-
static
Gravity
- static
new(hworld, type, pos)
: creates aSensor
elementhworld
: the parentWorld
handletype
: the type of theSensor
element, can be one of the above constants plus aBody
type constant, e.g.Body.Dynamic | Sensor.GamepadDown
pos
: the initial position- returns the created
Sensor
handle ornull
Dynamics module
Importing
import "dynamics" for Power, DynamicsParam, Dynamics
Class Power
Blank.
Class DynamicsParam
Use the following constants to get/set properties with Handle.get
/Handle.set
of a Dynamics
.
- static
QuotaCycles
Class Dynamics
- static
Jet
- static
Rocket
- static
Airscrew
- static
Tnt
- static
Motor
- static
CrawlerBelt
- static
Rifle
- static
Shotgun
- static
Flamethrower
- static
Laser
- static
Magnet
- static
SpiderSilk
- static
Hydropress
- static
Escapement
- static
Catcher
-
static
Tone
- static
new(hworld, type, pos)
: creates aDynamics
elementhworld
: the parentWorld
handletype
: the type of theDynamics
element, can be one of the above constants plus aBody
type constant, e.g.Body.Dynamic | Dynamics.Jet
pos
: the initial position- returns the created
Dynamics
handle ornull
AI module
Importing
import "ai" for Behaviour, AiParam, Ai
Class Behaviour
- static
Idle
- static
Chase
- static
Jump
- static
Attack
- static
Escape
- static
Fallen
- static
Dead
Class AiParam
Use the following constants to get/set properties with Handle.get
/Handle.set
of an Ai
.
- static
AwakeDistance
: read, write - static
SleepingDistance
: read, write - static
Behaviour
: readonly - static
Motion
: writeonly
Class Ai
- static
Dweller
- static
Warrior
-
static
Archer
- static
new(hworld, type, pos)
: creates anAi
elementhworld
: the parentWorld
handletype
: the type of theAi
element, can be one of the above constantspos
: the initial position- returns the created
AI
handle ornull
Alchemy module
Importing
import "alchemy" for Nature
Class Nature
- static
None
- static
Solid
- static
Liquid
- static
Gaseous
- static
Plasma
- static
Photic
- static
Metal
: composited byNature.Ferromagnetic
andNature.Nonferromagnetic
- static
Ferromagnetic
- static
Nonferromagnetic
- static
Lithoid
- static
Wood
- static
Goo
- static
Biotic
: composited byNature.Vegetal
andNature.Creatural
- static
Vegetal
- static
Creatural
- static
ReducingAgent
- static
OxidizingAgent
- static
Combustible
- static
Ignis
- static
Inert
- static
Active
- static
All
: composited by all above
Camera, boxes and history
Camera module
Importing
import "camera" for Camera
Class Camera
This class controls the behaviour of the main camera in-scene.
- static
wireframe
: gets the wireframe style of this camera, can be on of the values of theComponent
class in module “common” -
static
wireframe = (value)
: sets the wireframe style of this camera - static
following
: gets the following targetHandle
of this camera -
static
following = (value)
: sets the following targetHandle
of this camera - static
autoFollow
: gets whether this camera follows a target automatically -
static
autoFollow = (value)
: sets whether this camera follows a target automatically - static
movable
: gets whether this camera is movable -
static
movable = (value)
: sets whether this camera is movable - static
zoomable
: gets whether this camera is zoomable -
static
zoomable = (value)
: sets whether this camera is zoomable -
static
vibrate(interval, amplitude)
: vibrates this camera - static
position
: gets the position of this camera -
static
position = (value)
: sets the position of this camera - static
size
: gets the size of this camera -
static
size = (value)
: sets the size of this camera - static
pixelsPerUnit
: gets the value of pixels per unit of this camera -
static
pixelsPerUnit = (value)
: sets the value of pixels per unit of this camera - static
toScreen(value)
: converts a value from world space to screen space observed by this cameravalue
:Vec2
/Num
- returns
Vec2
/Num
- static
fromScreen(value)
: converts a value from screen space to world space observed by this cameravalue
:Vec2
/Num
- returns
Vec2
/Num
Minimap module
Importing
import "minimap" for Minimap
Class Minimap
This class controls the behaviour of the top-right minimap in-scene.
- static
visible
: gets whether the minimap overlay is visible -
static
visible = (value)
: sets whether the minimap overlay is visible - static
mapVisible
: gets whether map layers in the minimap overlay is visible - static
mapVisible = (value)
: sets whether map layers in the minimap overlay is visible
Toolbox module
Importing
import "toolbox" for Toolbox
Class Toolbox
This class controls the behaviour of the right side toolbox in-scene.
- static
visible
: gets whether the toolbox overlay is visible -
static
visible = (value)
: sets whether the toolbox overlay is visible - static
setAvailable(available [, category [, name]])
: sets the availability of a specific tool in the toolboxavailable
:true
for available, otherwise for unavailablecategory
: the specific category, defaults to"*"
for allname
: the specific name, defaults to"*"
for all- returns the count of the affected elements
- static
instantiate(hparent, category, name, pos, rot [, contactable [, operable [, group]]])
: instantiates a specific tool from the toolbox into the sandboxhparent
: the parentHandle
, generally pass a validWorld
handle to itcategory
: the specific categoryname
: the specific namepos
: the initial position to instantiaterot
: the initial rotation to instantiatecontactable
: defaults tofalse
operable
: defaults tofalse
group
: defaults toGroup.Environment
- returns the instantiated element
Handle
ornull
Sandbox module
Importing
import "sandbox" for AskParam, Sandbox
Class AskParam
- static
None
- static
IgnoreSensor
- static
IgnoreFixed
- static
InstantiatedOnly
- static
OperableOnly
- static
JoinableOnly
- static
ConductibleOnly
- static
Multiple
- static
Default
: composited byAskParam.InstantiatedOnly
,AskParam.OperableOnly
andAskParam.Multiple
Class Sandbox
This class controls the behaviour of the main scene itself.
- static
operable
: gets whether the sandbox is operable -
static
operable = (value)
: sets whether the sandbox is operable - static
selectable
: gets whether the elements in the sandbox is selectable -
static
selectable = (value)
: sets whether the elements in the sandbox is selectable - static
draggable
: gets whether the elements in the sandbox is draggable - static
draggable = (value)
: sets whether the elements in the sandbox is draggable - static
dragForce
: gets the drag force when dragging an element in the sandbox -
static
dragForce = (value)
: sets the drag force when dragging an element in the sandbox - static
setPlacingRect(rect)
: sets the placing rectangle in the sandbox where a player can instantiate tools intorect
: the placingRect
- static
setPlacingSnapToGrid(snap)
: sets whether snaps the elements to grid placed by playersnap
:true
for snap, otherwisefalse
- static
setPlacingCanOverlap(ovlp)
: sets whether the elements can overlap each other placed by playerovlp
:true
for overlap, otherwisefalse
- static
setRotatingAxiallyAligned(rot)
: sets whether the axially-aligned rotation is enabled for playerrot
:true
for rotatable, otherwisefalse
- static
setRotatingFree(rot)
: sets whether the free rotation is enabled for playerrot
:true
for rotatable, otherwisefalse
- static
filter(hworld, category, name [, options [, group]])
: performs a filter with specific conditions over elements in the sandboxhworld
: the targetWorld
handleoptions
: defaults toAskParam.Default
group
: defaults toGroup.All
- returns the matched
List
ofHandle
s
- static
query(hworld, point, radius [, options [, group [, filter]]])
: performs a ranged query with specific conditions on elements in the sandboxhworld
: the targetWorld
handleoptions
: defaults toAskParam.Default
group
: defaults toGroup.All
filter
: defaults tonull
- returns the matched
List
ofHandle
s
- static
raycast(hworld, point1, point2 [, options [, group [, filter]]])
: performs a ray casting with specific conditions across elements in the sandboxhworld
: the targetWorld
handleoptions
: defaults toAskParam.Default
group
: defaults toGroup.All
filter
: defaults tonull
- returns the matched
List
ofHandle
s
History module
Importing
import "history" for History
Class History
This class controls the behaviour of the history stack in-scene.
- static
isEmpty
: gets whether the history stack does not contain any undoable operation -
static
count
: gets the count of the undoable operations of the history stack - static
undoable
: gets whether the history stack is undoable- returns
true
for undoable, otherwisefalse
- returns
- static
undoable = (value)
: sets whether the history stack is undoablevalue
:true
for undoable, otherwisefalse
- static
sealed
: gets whether the history stack is sealed- returns
true
for sealed, otherwisefalse
- returns
- static
sealed = (value)
: sets whether the history stack is sealedvalue
:true
for sealed, otherwisefalse
- static
load()
: loads persisted records to the history stack from local storage- returns the number of the loaded operations
- static
save()
: saves records in the history stack to local storage for persistence- returns the number of the saved operations
- static
reload()
: reloads each record in the history stack- returns the number of the reloaded operations
- static
unload()
: unloads all records in the history stack- returns
true
for success, otherwisefalse
- returns
- static
parse(json [, undoable])
: parses records to the history stack from a specific JSONString
json
: the JSONString
to loadundoable
: whether appends it to the operation stack, defaults totrue
- returns
true
for success, otherwisefalse
- static
serialize()
: serializes records in the history stack to a JSONString
- returns the serialized JSON
String
- returns the serialized JSON
GUI
GUI module
Importing
import "gui" for Alignment, PackingStyle, CheckBox, ComboBox, IntegerField, RealField, Tab, Scroll, Block, MessageBoxButtons, DialogResult, Gui
Class Alignment
- static
Middle
- static
Left
- static
Right
Class PackingStyle
- static
None
- static
NineGrid
- static
ThreeGrid
Class CheckBox
construct new(txt, checked)
: constructs aCheckBox
overlaytxt
: the text contentchecked
: the ticking state
readonly
: gets whether this overlay is readonly-
readonly = (value)
: sets whether this overlay is readonly value
: gets whether this overlay is unticked-
value = (value)
: sets whether this overlay is unticked content
: gets the text content of this overlay-
content = (value)
: sets the text content of this overlay style
: gets the style of this overlay, can be"star"
or"tick"
style = (value)
: sets the style of this overlay
Class ComboBox
-
construct new()
: constructs aComboBox
overlay [index]
: gets the item text at a specific index[index] = (value)
: sets the item text to a specific indexcount
: gets the item countadd(item)
: adds an item to the end of this overlayinsert(index, item)
: inserts an item after a specific indexremoveAt(index)
: removes an item from a specific index-
clear()
: clears all items readonly
: gets whether this overlay is readonly-
readonly = (value)
: sets whether this overlay is readonly value
: gets the selected index of this overlayvalue = (value)
: sets the selected index of this overlay
Class IntegerField
construct new()
: constructs anIntegerField
overlayconstruct new(min, max, val)
: constructs anIntegerField
overlaymin
: the lower boundmax
: the upper boundval
: the initial value
construct new(min, max, val, step)
: constructs anIntegerField
overlaymin
: the lower boundmax
: the upper boundval
: the initial valuestep
: the adjustment step
readonly
: gets whether this overlay is readonly-
readonly = (value)
: sets whether this overlay is readonly value
: gets the value of this overlay-
value = (value)
: sets the value of this overlay format
: gets the format of this overlayformat = (value)
: sets the format of this overlay
Class RealField
construct new()
: constructs aRealField
overlayconstruct new(min, max, val)
: constructs aRealField
overlaymin
: the lower boundmax
: the upper boundval
: the initial value
construct new(min, max, val, step)
: constructs aRealField
overlaymin
: the lower boundmax
: the upper boundval
: the initial valuestep
: the adjustment step
readonly
: gets whether this overlay is readonly-
readonly = (value)
: sets whether this overlay is readonly value
: gets the value of this overlay-
value = (value)
: sets the value of this overlay format
: gets the format of this overlayformat = (value)
: sets the format of this overlay
Class Tab
-
construct new()
: constructs aTab
overlay [index]
: gets the item text at a specific index[index] = (value)
: sets the item text to a specific indexcount
: gets the item countadd(item)
: adds an item to the end of this overlayinsert(index, item)
: inserts an item after a specific indexremoveAt(index)
: removes an item from a specific index-
clear()
: clears all items value
: gets the selected index of this overlayvalue = (value)
: sets the selected index of this overlay
Class Scroll
-
construct new()
: constructs aScroll
overlay [index]
: gets the item text at a specific index[index] = (value)
: sets the item text to a specific indexcount
: gets the item countadd(item)
: adds an item to the end of this overlayinsert(index, item)
: inserts an item after a specific indexremoveAt(index)
: removes an item from a specific index-
clear()
: clears all items value
: gets the selected index of this overlayvalue = (value)
: sets the selected index of this overlay
Class Block
-
isValid
: gets whether this block is valid -
value
: gets the result value of this block
Class MessageBoxButtons
- static
Ok
- static
OkCancel
- static
YesNo
- static
YesNoCancel
Class DialogResult
- static
Ok
- static
Yes
- static
OkOrYes
- static
No
- static
Cancel
Class Gui
- static
screenArea
: gets the screen rectangle of the Crapht Box process -
static
activeArea
: gets the active area of the Crapht Box process - static
panel(x, y, w, h)
: draws a panel overlay - static
text(content, x, y, w, h [, width, align])
: draws a text overlaywidth
: defaults to 0align
: defaults toAlignment.Left
- static
image(content, x, y, w, h [, packing])
: draws an image overlaypacking
: defaults toPackingStyle.Normal
- static
tooltip(content, x, y)
: draws a tooltip overlay - static
link(content, x, y)
: draws a link overlay -
static
button(content, x, y, w, h)
: draws a button overlay - static
checkBox(ctrl, x, y, w, h)
: draws aCheckBox
overlay - static
comboBox(ctrl, x, y, w, h)
: draws aComboBox
overlay - static
integerField(ctrl, x, y, w, h)
: draws anIntegerField
overlay - static
realField(ctrl, x, y, w, h)
: draws aRealField
overlay - static
tab(ctrl, x, y, w, h)
: draws aTab
overlay -
static
scroll(ctrl, x, y, w, h)
: draws aScroll
overlay - static
block(timeout)
: begins no overlay, but performs a block behaviour- returns
Block
- returns
- static
block()
: finishes a block behaviour - static
indicate(target [, size])
: begins an indicator overlay- returns
Block
- returns
- static
indicate()
: finishes an indicator behaviour - static
chat(content)
: begins a chat overlay- returns
Block
- returns
- static
messageBox(content, buttons)
: begins a message box overlay- returns
Block
- returns
- static
inputBox(content)
: begins an input box overlay- returns
Block
- returns
- static
openFileDialog([type [, multiple]])
: begins an open file dialog windowtype
: defaults tonull
multiple
: defaults tofalse
- static
saveFileDialog([type])
: begins a save file dialog windowtype
: defaults tonull
- static
pickDirectoryDialog([dir])
: begins a pick directory dialog windowdir
: defaults tonull
Crapht Box implements an immediate mode for common GUI layouts, which draws and performs immediately when you call the corresponding functions, then return necessary states. It also implements a retained mode for block boxes, dialogs, etc. which returns a Block
object, check the values on it for detail states.
Layout module
The “layout” module is a wrapper above the GUI primitives. It offers a data-driven way to organize layouts and behaviours under the immediate mode.
Importing
import "layout" for Container, Panel, Flow, Grid, Layout
Class Container
construct new()
: constructs aContainer
overlay
construct new(x, y)
: constructs aContainer
overlayx
: the x positiony
: the y position
construct new(x, y, w, h)
: constructs aContainer
overlayx
: the x positiony
: the y positionw
: the widthh
: the height
Class Panel
construct new(w, h)
: constructs aPanel
overlayw
: the widthh
: the height
Class Flow
construct new()
: constructs aFlow
overlayconstruct new(txt)
: constructs aFlow
overlaytxt
: the text content
construct new(txt, ext)
: constructs aFlow
overlaytxt
: the text contentext
: the expanding state
text
: gets the text content of this overlay-
text = (value)
: sets the text content of this overlay expanded
: gets whether this overlay is expandedexpanded = (value)
: sets whether this overlay is expanded
Class Grid
construct new(hCount, vCount)
: constructs aGrid
overlayhCount
: the item count in horizontalvCount
: the item count in vertical
count
: gets the count in both dimensions of this overlay
Class Layout
construct new()
: constructs aLayout
controller
with(ctrl)
: draws specific overlaysrefresh(ctrl)
: refreshes with specific overlays
Localization
Localization module
Importing
import "localization" for Language, Localization
Class Language
- static
English
- static
Chinese
- static
Japanese
- static
German
- static
French
- static
Italian
- static
Spanish
-
static
Portuguese
- static
fromString(lang)
: converts from languageString
to enumeration - static
toString(lang)
: converts from language enumeration toString
Class Localization
- static
[lang, id]
: gets the text of a specific language and ID, same asget(lang, id)
-
static
[lang, id] = (txt)
: sets the text to a specific language and ID, same asset(lang, id, txt)
- static
get(lang, id)
: gets the text of a specific language and ID - static
set(lang, id, txt)
: (txt)`: sets the text to a specific language and ID - static
remove(lang, id)
: removes the text of a specific language and ID - static
clear()
: clears all data
Dictionary module
Importing
import "dictionary" for Dictionary
Class Dictionary
This class stores text information with specific ID for different languages.
-
construct new()
: constructs aDictionary
collection [id]
: gets the text of a specific ID, same asget(id)
[lang, id]
: gets the text of a specific language and ID, same asget(lang, id)
-
[lang, id] = (txt)
: sets the text to a specific language and ID, same asset(lang, id, txt)
isEmpty
: gets whether this dictionary is empty- returns
true
for empty, otherwisefalse
- returns
-
data
: gets all data get(id)
: gets the text of a specific IDget(lang, id)
: gets the text of a specific language and IDset(lang, id, txt)
: sets the text to a specific language and IDremove(id)
: removes the text of a specific IDremove(lang, id)
: removes the text of a specific language and ID-
clear()
: clears all data fill(dict)
: fills this dictionary with specific data
Utilities
Star module
Importing
import "star" for Star
Class Star
This class stores a number of customizable missions for each disk. The Star
class is just a data structure excluding any GUI layout.
construct new(hasVar, getVar, setVar)
: constructs aStar
objecthasVar
: the function to check a variable in the current program, e.g.Fn.new { | key | hasVariable(key) }
getVar
: the function to get a variable in the current program, e.g.Fn.new { | key | getVariable(key) }
setVar
: the function to set a variable in the current program, e.g.Fn.new { | key, value | setVariable(key, value) }
-
toString
: gets theString
representation of the value -
[index]
: gets the star point of a specific index, same asget(index)
isEmpty
: gets whether thisStar
object is empty- returns
true
for empty, otherwisefalse
- returns
count
: gets the star point count
indexOf(key)
: gets the index of a specific star keycontains(key)
: gets whether this object contains a specific star keyget(index)
: gets the star point of a specific indexadd(key, msg)
: adds a star point with a specific key and message-
clear()
: clears all star points complete(index [, shadow])
: marks a specific star point completedindex
:Num
/String
; either the index or key of a star pointshadow
:false
to set the corresponding variable,true
for shadowy, defaults tofalse
completed(index)
: gets whether a specific star point is completedindex
:Num
/String
; either the index or key of a star point
Prefab module
Importing
import "prefab" for Prefab
Class Prefab
- static
instantiate(hworld, name, options)
: instantiates a prefabhworld
: the parentWorld
handle- returns the instantiated element
Handle
ornull
Application
Application module
Importing
import "application" for Application
Class Application
- static
basicAllocatedBytes
: gets the allocated bytes by BASIC - static
wrenAllocatedBytes
: gets the allocated bytes by Wren -
static
vramAllocatedBytes
: gets the allocated bytes for V-RAM - static
language
: gets the current language -
static
language = (value)
: sets the current language - static
setOption(key, val [, append])
: sets the option value of specific keyappend
: defaults tofalse
- static
exit()
: exits the Crapht Box process
Program
Program module
Importing
import "program" for Program
Class Program
debug
: gets whether the current program is under debug modeautoPlay
: gets whether the current program is played automaticallyautoPlay = (value)
: sets whether the current program is played automaticallyplaying
: gets whether the current program is playingplaying = (value)
: sets whether the current program is playingplayed
: gets whether the current program is ever playedended
: gets whether the current program is endedwin([stars [, hypnotize [, tips]]])
: sets the state of the current program to winstars
: defaults tonull
hypnotize
: defaults tofalse
tips
: defaults tonull
lose([stars [, hypnotize [, tips]]])
: sets the state of the current program to losestars
: defaults tonull
hypnotize
: defaults tofalse
tips
: defaults tonull
-
unlock(disk)
: unlocks a specific disk totalEnergy
: gets the energy budget of the current programtotalEnergy = (value)
: sets the energy budget of the current programenergy
: gets the remaining energy of the current program-
energy = (value)
: sets the remaining energy of the current program hasVariable(key)
: gets whether a specific variable exists in the current programgetVariable(key)
: gets the value of a specific variable in the current programsetVariable(key, value)
: sets the value to a specific variable in the current programremoveVariable(key)
: removes the entry of a specific variable in the current program-
clearVariables()
: clears all variables in the current program addUpdater(signature)
: adds an updater to the current programremoveUpdater(signature)
: removes an updater from the current program-
clearUpdaters()
: clears all updaters in the current program -
loadResource(path)
: loads and caches a specific resource world
: gets theWorld
handle of the current programworld = (value)
: sets theWorld
handle of the current programborder = (value)
: sets the borderHandle
of the current program
- async virtual
load()
: callback when the current program is being loaded - async virtual
reload()
: callback when the current program is being reloaded -
async virtual
unload()
: callback when the current program is being unloaded - virtual
start()
: callback when the current program is being started - virtual
quit()
: callback when the current program is being quited -
virtual
resize(width, height)
: callback when the Crapht Box process is being resized - virtual
gui()
: callback when the current program is drawing GUI -
virtual
update(delta)
: callback when the current program is updating a frame - virtual
onCreated(handle)
: callback when an element is created - virtual
onDeleted(handle)
: callback when an element is deleted - virtual
onContacted(handlea, handleb)
: callback when two elements contact - virtual
onLeft(handlea, handleb)
: callback when two elements leave from contacting - virtual
onDamaged(hself, hother)
: callback when an element is damaged -
virtual
onTransfered(handle, newState, oldState)
: callback when an AI element’s state is transfered -
async static
waitFor(t)
: helper function to wait for a specific interval - static
eval(code)
: helper function to evaluate specific Wren code
In-disk
Disk module
This module is experimental.
Importing
import "disk" for Convert, Operate, Load, Storyboard, Stopwatch
Class Convert
- static
lineToScene(data)
: converts in-scene line index to scene position in world space - static
sceneToLine(data [, snap])
: converts scene position in world space to in-scene line indexsnap
: defaults totrue
- static
gridToScene(data)
: converts in-scene grid index to scene position in world space - static
sceneToGrid(data [, snap])
: converts scene position in world space to in-scene grid indexsnap
: defaults totrue
- static
byteCountToString(data)
: gets the shortString
representation of a specific byte count
Class Operate
- static
create(cmd, index, hworld, built, tagged)
: creates and performs a creating operationhworld
: the targetWorld
handle
- static
delete(cmd, index, hworld, built, tagged)
: creates and performs a deleting operationhworld
: the targetWorld
handle
- static
move(cmd, index, hworld, built)
: creates and performs a moving operationhworld
: the targetWorld
handle
- static
rotate(cmd, index, hworld, built)
: creates and performs a rotating operationhworld
: the targetWorld
handle
- static
switchover(cmd, index, hworld, built)
: creates and performs a switching-over operationhworld
: the targetWorld
handle
- static
flip(cmd, index, hworld, built)
: creates and performs a flipping operationhworld
: the targetWorld
handle
- static
build(obj, entry, hworld, tagged, onstep)
: builds elements according to specific operationshworld
: the targetWorld
handle
Class Load
- static
jsonFile(path [, ordered])
: loads a JSON filejsonFile
: defaults tofalse
-
static
diskInfo()
: loads the disk information of the current program -
static
toolAvailability(data)
: loads the availability data of the tools for the current program -
static
world(map, gravity, program)
: loads a world element to the current program - static
mapInfo(map, index, fill)
: loads the map information from specific data - static
mapPattern(map, index, fill)
: loads the map pattern from specific filler -
static
mapFixture(map, index, program)
: loads the map fixtures from specific data - static
sceneGraph(hworld, data [, onstep])
: loads the scene graph from specific datahworld
: the parentWorld
handleonstep
: defaults tonull
Class Storyboard
construct new()
: constructs aStoryboard
objectconstruct new(dict)
: constructs aStoryboard
objectdict
: the storyboard data
isEmpty
: gets whether the storyboard is empty- returns
true
for empty, otherwisefalse
- returns
fill(data)
: fills the storyboard with specific data-
clear()
: clears all data play(story)
: plays a specific storylineplaying
: gets the current playing storylinestop()
: stops playing a storylinepend(p)
: produces a pending actionpend()
: consumes until there’s no more pending actionupdate(delta)
: updates the storyboard
Class Stopwatch
construct new()
: constructs aStopwatch
objectconstruct new(rushtime)
: constructs aStopwatch
objectrushtime
: the rush time in seconds
-
toString
: gets theString
representation of the object paused
: gets whether the stopwatch is paused-
paused = (value)
: sets whether the stopwatch is paused rushTime
: gets the rush time in secondsticks
: gets the ticks in secondsticks = (value)
: sets the ticks in seconds-
missed
: gets whether it has missed the rush time -
update(delta)
: updates the timing with a time interval since last updating gui()
: draws the GUI overlay of the stopwatch
Part IV. Editors
Crapht Box offers built-in editors to edit entry source code, map, level and element.
Switch to the Workshop
tab, then click the explore button to browse the directory of your disk:
Code editor
Switch to the Workshop
tab, then click the edit button to edit your main source code:
Notice that you cannot edit readonly disks.
The built-in code editor loads the entry source code of the selected disk. To edit other assets, navigate to the directory of a specific disk on your local storage, then use proper external text or image editors to open it.
Map editor
Switch to the Packs
tab, then load the Editor/Map Editor
disk. See in-disk help for details.
This editor is for static graphics layers, e.g. background, sky, terrain. In the usual case it saves to the “${disk}
/content/map.map” and “${disk}
/content/scene.json” file.
Level editor
Switch to the Packs
tab, then load the Editor/Level Editor
disk. See in-disk help for details.
This editor is for static environments, e.g. goal, credit, wall. In the usual case it saves to the “${disk}
/content/scene.json” file.
Element editor
Switch to the Packs
tab, then load the Editor/Element Editor
disk. See in-disk help for details.
This editor is for placing regular elements. In the usual case it saves to the “${disk}
/content/scene.json” file.
Part V. Sharing
Switch to the Workshop
tab on the main screen to use the following operations.
Workshop
You can share your creative disks with the Steam community via Workshop, subscribe to play others’ games and programs, and discuss or comment on any submitted disk.
Submitting
To submit a new disk to Workshop, select it, then click Push
.
Use an external text editor to modify the “info.json” meta file before pushing as you need. Don’t forget to close any external editors that are opening the source disk you are going to push or pull.
It’s recommended to pick a proper disk and bundle name, apply a good looking sticker, and write necessary introduction and notes to help others to get better acquainted with your submission before pushing. You can edit submitted information in browser after that, including changing the description, changing the visibility, updating the sticker images and videos, etc.
Notice that Crapht Box only uploads the disk itself, which excludes any persistence files.
You need to agree to the Steam Workshop’s terms of service for submitting.
Subscribing
Use a web browser to explore the Crapht Box Workshop on Steam to make subscriptions:
All subscribed disks are automatically downloaded for mounting.
Unsubscribing
Click Unsubscribe
on an already subscribed disk in browser or application to stop following it.
Pushing
When you want to push modifications of a submitted disk, select the disk, then click Push
.
Pulling
All subscribed disks are supposed to be updated automatically when Crapht Box boots up, but in case you’d like to check updates manually, just click Pull
.
Forking
Click Fork
to clone a selected disk.
Archiving
Exporter and importer
Click Export...
for exporting.
Click Import...
for importing.
Exported disk is archived in standard zip package.