Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/defold/doc
Browse files Browse the repository at this point in the history
  • Loading branch information
britzl committed Oct 3, 2024
2 parents 2e6a2db + f2c5c11 commit b0d2019
Show file tree
Hide file tree
Showing 22 changed files with 286 additions and 132 deletions.
34 changes: 20 additions & 14 deletions docs/en/manuals/bob.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ usage: bob [options] [commands]
binary will be placed. Default is
"<build-output>/<platform>/"
-bo,--bundle-output <arg> Bundle output directory
-br,--build-report <arg> DEPRECATED in Defold 1.4.6! Use
-br,--build-report <arg> DEPRECATED! Use
--build-report-json instead
-brhtml,--build-report-html <arg> Filepath where to save a build
report as HTML
-brjson,--build-report-json <arg> Filepath where to save a build
report as JSON (from Defold 1.4.6)
report as JSON
--build-artifacts <arg> If left out, will default to
build the engine. Choices:
'engine', 'plugins'. Comma
separated list.
'engine', 'plugins', 'library'.
Comma separated list.
--build-server <arg> The build server (when using
native extensions)
--build-server-header <arg> Additional build server header to
Expand All @@ -58,6 +58,8 @@ usage: bob [options] [commands]
instead
--debug-ne-upload Outputs the files sent to build
server as upload.zip
--debug-output-spirv <arg> Force build SPIR-V shaders
--debug-output-wgsl <arg> Force build WGSL shaders
--defoldsdk <arg> What version of the defold sdk
(sha1) to use
-e,--email <arg> User email
Expand All @@ -66,11 +68,10 @@ usage: bob [options] [commands]
create an empty Defold
application for use as a build
target
--exclude-build-folder <arg> DEPRECATED from Defold 1.5.1! Use
'.defignore' file instead
--exclude-build-folder <arg> DEPRECATED! Use '.defignore' file
instead
-h,--help This help message
-i,--input <arg> Source directory. Default is
current directory
-i,--input <arg> DEPRECATED! Use --root instead
--identity <arg> Sign identity (iOS)
-kp,--key-pass <arg> Password of the deployment key if
different from the keystore
Expand All @@ -88,8 +89,13 @@ usage: bob [options] [commands]
--manifest-public-key <arg> Public key to use when signing
manifest and archive.
--max-cpu-threads <arg> Max count of threads that bob.jar
can use (from Defold 1.4.6)
can use
-mp,--mobileprovisioning <arg> mobileprovisioning profile (iOS)
--ne-build-dir <arg> Specify a folder with includes or
source, to build a specific
library. More than one occurrance
is allowed.
--ne-output-name <arg> Specify a library target name
-o,--output <arg> Output directory. Default is
"build/default"
-p,--platform <arg> Platform (when building and
Expand All @@ -106,9 +112,9 @@ usage: bob [options] [commands]
--resource-cache-remote-user <arg> Username to authenticate access
to the remote resource cache.
--settings <arg> Path to a game project settings
file. More than one occurrance
are allowed. The settings files
are applied left to right.
file. More than one occurrance is
allowed. The settings files are
applied left to right.
--strip-executable Strip the dmengine of debug
symbols (when bundling iOS or
Android)
Expand All @@ -117,8 +123,8 @@ usage: bob [options] [commands]
-tp,--texture-profiles <arg> DEPRECATED! Use
--texture-compression instead
-u,--auth <arg> User auth token
--use-async-build-server DEPRECATED! Asynchronous build
is now the default.
--use-async-build-server DEPRECATED! Asynchronous build is
now the default.
--use-lua-bytecode-delta Use byte code delta compression
when building for multiple
architectures
Expand Down
14 changes: 7 additions & 7 deletions docs/en/manuals/editor-scripts-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ brief: This manual explains how to create UI elements in the editor using Lua

# Editor scripts and UI

This manual explains how to create interactive UI elements in the editor using editor scripts written in Lua. To get started with editor scripts, see [Editor Scripts manual](/manuals/editor-scripts). Currently, it's only possible to create interactive dialogs, though we want to expand the UI scripting support to the rest of the editor in the future.
This manual explains how to create interactive UI elements in the editor using editor scripts written in Lua. To get started with editor scripts, see [Editor Scripts manual](/manuals/editor-scripts). You can find the full editor API reference [here](https://defold.com/ref/alpha/editor/). Currently, it's only possible to create interactive dialogs, though we want to expand the UI scripting support to the rest of the editor in the future.

## Hello world

Expand Down Expand Up @@ -46,7 +46,7 @@ return M

This code snippet defines a **View → Do with confirmation** command. When you execute it, you will see the following dialog:

![Hello world dialog](images/editor_scripts/[email protected])
![Hello world dialog](images/editor_scripts/perform_action_dialog.png){srcset="images/editor_scripts/perform_action_dialog@2x.png 2x"}

Finally, after pressing <kbd>Enter</kbd> (or clicking on the `Perform` button), you'll see the following line in the editor console:
```
Expand Down Expand Up @@ -76,7 +76,7 @@ editor.ui.label({
```
The visible part is the `Hello` text, and it's aligned within the assigned component bounds:

![Alignment](images/editor_scripts/[email protected])
![Alignment](images/editor_scripts/alignment.png){srcset="images/editor_scripts/alignment@2x.png 2x"}

## Built-in components

Expand All @@ -86,7 +86,7 @@ The editor defines various built-in components that can be used together to buil

Layout components are used for placing other components next to each other. Main layout components are **`horizontal`**, **`vertical`** and **`grid`**. These components also define props such as **padding** and **spacing**, where padding is an empty space from the edge of the assigned bounds to the content, and spacing is an empty space between children:

![Padding and Spacing](images/editor_scripts/[email protected])
![Padding and Spacing](images/editor_scripts/padding_and_spacing.png){srcset="images/editor_scripts/padding_and_spacing@2x.png 2x"}

Editor defines `small`, `medium` and `large` padding and spacing constants. When it comes to spacing, `small` is intended for spacing between different sub-elements of an individual UI element, `medium` is for spacing between individual UI elements, and `large` is a spacing between groups of elements. Default spacing is `medium`. With paddings, `large` means padding from the edges of the window to content, `medium` is padding from the edges of a significant UI element, and `small` is a padding from the edges of small UI elements like context menus and tooltips (not implemented yet).

Expand Down Expand Up @@ -119,7 +119,7 @@ editor.ui.grid({
```
The code above will produce the following dialog form:

![New Level Dialog](images/editor_scripts/[email protected])
![New Level Dialog](images/editor_scripts/new_level_dialog.png){srcset="images/editor_scripts/new_level_dialog@2x.png 2x"}

### Data presentation components

Expand Down Expand Up @@ -184,7 +184,7 @@ When issue is specified, it changes how the input component looks, and adds a to

Here is a demo of all inputs with their issue variants:

![Inputs](images/editor_scripts/[email protected])
![Inputs](images/editor_scripts/inputs_demo.png){srcset="images/editor_scripts/inputs_demo@2x.png 2x"}

### Dialog-related components

Expand Down Expand Up @@ -258,7 +258,7 @@ end

When you execute a menu command that runs this code, the editor will show a dialog with disabled `"Create File"` dialog at the start, but, when you type a name and press <kbd>Enter</kbd>, it will become enabled:

![New File Dialog](images/editor_scripts/[email protected])
![New File Dialog](images/editor_scripts/reactive_new_file_dialog.png){srcset="images/editor_scripts/reactive_new_file_dialog@2x.png 2x"}

So, how does it work? On the very first render, `use_state` hook creates a local state associated with the component and returns it with a setter for the state. When the setter function is invoked, it schedules a component re-render. On subsequent re-renders, the component function is invoked again, and `use_state` returns the updated state. New view component returned by the component function is then diffed against the old one, and the UI is updated where the changes were detected.

Expand Down
2 changes: 2 additions & 0 deletions docs/en/manuals/editor-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ You can interact with the editor using `editor` package that defines this API:
- `editor.transact(txs)` — modify the editor in-memory state using 1 or more transaction steps created with `editor.tx.*` functions.
- `editor.ui.*` — various UI-related functions, see [UI manual](/manuals/editor-scripts-ui).

You can find the full editor API reference [here](https://defold.com/ref/alpha/editor/).

## Commands

If editor script module defines function `get_commands`, it will be called on extension reload, and returned commands will be available for use inside the editor in menu bar or in context menus in Assets and Outline panes. Example:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b0d2019

Please sign in to comment.