project
The projects this machine has opened, the templates a new one starts from, and the folder picker the OS provides. What the editor's start screen is made…
In questa pagina
The projects this machine has opened, the templates a new one starts from, and the folder picker the OS provides. What the editor's start screen is made of.
15 functions, 0 constants. Scripts reach it as project::.
Functions
Argument kinds are the script values a call passes: node is a node handle, any a table or value of any kind, fn a callback.
| function | acts on | what it does |
|---|---|---|
copy(string, string) -> project::Project |
— | Copy the project folder at from, one fs.* may read, to into, which must not exist yet, and remember the copy. Answers { path, name }, or { error }. |
copy_system_font(string, string) -> bool |
— | Copy an installed face, one system_fonts lists, to to inside the project. Answers whether it was copied; a path the list does not name is refused. |
create(string, string) -> project::Project |
— | Write a new project at path from a template id, or from nothing when the id is empty. Answers { path, name }, or { error }. |
examples_directory() -> str? |
— | The folder of example projects shipped beside the editor, which fs.* may read and not write from then on. Nil where none ship. |
exists(string) -> bool |
— | Whether anything is at path, wherever it is: how a new project's folder is picked clear of one already there. |
forget(string) |
— | Drop one project from the list. The folder is not touched. |
home() -> string |
— | Where a new project goes unless the reader says otherwise: the home directory on a desktop, and the app's own writable directory where there is no such thing. |
in_tab() -> bool |
— | Whether this editor runs in a browser tab, where the page holds the projects and opening one is its call rather than this screen's. |
open(string) -> project::Opened |
— | Remember path and start the editor on it, then ask this one to quit. Answers { error } when there is no project there. |
open_beside(string) -> project::Opened |
— | Start a second editor on path and keep this one: Edit dependency on a path dependency, whose project is another folder. Answers { error } when there is no project there or no second editor can start. |
pick_directory() -> str? |
— | Open the OS folder picker and answer what was chosen, or () when it was dismissed. Blocks while the dialog is up, and answers () on a platform with no picker. |
recent() -> [project::Recent] |
— | The projects opened on this machine, newest first: { path, name, opened, exists } each, where opened is a Unix time in seconds and exists says whether the folder is still there. |
system_fonts() -> [project::SystemFont] |
— | The faces this machine has installed, by family and style: what the font picker offers to copy into a project, since an exported game cannot count on a face being installed. Empty in a browser tab. |
use_data(str?) -> str? |
— | Answer engine::user_data_directory() with the user data directory of the game named name, keep the device id there, and let fs reach it, so a game played here and run alone share saves and a device login. The editor names its own folder with engine::user_data_directory_of. Nil goes back to the editor's own. Answers the directory, or nil. |
version() -> string |
— | The version of the binary the editor is running in. |