Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions lua/docs/content/reference/box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,28 @@ properties:
description: |
[This] maximum point representing the upper extent along the axes.

- name: "Width"
type: "number"
description: |
Width of the box, shortcut to `box.Size.X`.

- name: "Height"
type: "number"
description: |
Height of the box, shortcut to `box.Size.Y`.

- name: "Depth"
type: "number"
description: |
Depth of the box, shortcut to `box.Size.Z`.

- name: "Size"
type: "Number3"
description: |
Size of the box from its minimum point. This automatically sets [This].[Max](/reference/box#property-max).

Can be set to a `number` for a uniform size.

- name: "Center"
type: "Number3"
read-only: true
Expand All @@ -53,25 +70,29 @@ functions:
Returns a copy of the [Box].

- name: "Fit"
return:
- type: "Box"
arguments:
- name: "target"
type: "Object"
- name: "config"
type: "table"
optional: true
description: |
Sets the box to a bounding box fitting the given target's model.
Sets the box to a bounding box fitting the given target's model, and return it.

Config table can contain any of the following: `{ recurse=boolean, localBox=boolean }`,
- `recurse`: the box will also fit all of target's descendants models. Default is `false`.
- `localBox`: result box will be in `target`'s parent local space. Default is `false`, returning a box in world space.

- name: "Merge"
return:
- type: "Box"
arguments:
- name: "b"
type: "Box"
description: |
Sets the box to the combination of both boxes.
Sets the box to the combination of both boxes, and return it.

- name: "Cast"
arguments:
Expand Down
57 changes: 34 additions & 23 deletions lua/docs/content/reference/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,6 @@ properties:
print("action3 released")
end

- name: "Camera"
type: "Camera"
description: "See [Camera]."

- name: "Clouds"
type: "Clouds"
description: "See [Clouds]."

- name: "DirectionalPad"
type: "function"
description: |
Expand Down Expand Up @@ -138,7 +130,7 @@ properties:
- name: "AnalogPad"
type: "function"
description: |
Triggered when the "analog pad" changes position.
Triggered when the "analog pad" changes position. It is turned off when [Pointer] is hidden (see [Pointer].[Hide](/reference/pointer#functions-hide)).

The "analog pad" maps to the mouse movements when using a mouse. When using a touch screen, it is activated when moving the finger after a touch down that isn't caught by any other screen component (like [DirectionalPad](/reference/client#property-directionalpad)).

Expand All @@ -164,10 +156,6 @@ properties:
Client.DirectionalPad = function(x, y)
Player.Motion = (Player.Forward * y + Player.Right * x) * 50
end

- name: "Fog"
type: "Fog"
description: "See [Fog]."

- name: "OnChat"
type: "function"
Expand Down Expand Up @@ -221,21 +209,44 @@ properties:
Player.Position = {Map.Width / 2, Map.Height + 10, Map.Depth / 2}
end

- name: "Player"
type: "Player"
description: "See [Player]."

- name: "Tick"
type: "function"
description: |
Executed ~30 times per second. Provides the elapsed time in seconds as parameter.
Tick is a [function] executed each frame. Provides the elapsed time in seconds as parameter.

The exact number of frames per second may fluctuate and depend on the device. It is typically around 60 frames per second.
samples:
- code: |
-- executed ~30 times per second on each user device
Client.Tick = function(dt)
print("elapsed:", dt, "seconds")
print("elapsed:", dt, "seconds since last frame")
end

- name: "Pointer"
type: "Pointer"
description: "See [Pointer]."
- name: "QualityTier"
type: "string"
description: |
Returns an aggregated quality tier as one of `low`, `medium` or `high`. You may use this to turn OFF some non-gameplay essential visual effects depending on the quality tier of the player.
samples:
- code: |
if Client.QualityTier == "high" then
addSomeExtraVFX()
end

- name: "IsMobile"
type: "boolean"
description: |
Returns true if the player is on a mobile device. You may use this to implement separate UI.

- name: "HasTouchScreen"
type: "boolean"
description: |
Returns true if the player's device uses a touch screen. You may use this to implement separate inputs/control schemes.

- name: "Connected"
type: "boolean"
description: |
Returns true if the player is connected to the world server.

- name: "AppVersion"
type: "string"
description: |
Returns the current app version.
2 changes: 2 additions & 0 deletions lua/docs/content/reference/clouds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ properties:
type: "Number3"
description: |
Size of the volume dedicated to clouds generation. This will set [Clouds.Max](#property-max) according to given size.

Can be set to a `number` for a uniform size.

Note: currently, vertical size isn't used.

Expand Down
5 changes: 5 additions & 0 deletions lua/docs/content/reference/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@ properties:
samples:
- code: |
Dev.DisplayFPS = true

- name: "CanRunCommands"
type: "boolean"
description: |
True if the world is launched in developer mode and the local player is its author.
2 changes: 1 addition & 1 deletion lua/docs/content/reference/light.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ properties:
- name: "PriorityGroup"
type: "integer"
description: |
`PriorityGroup` is a way to create light groups in order of importance from `0` to `255` (default group).
`PriorityGroup` is a way to create light groups in order of importance from `0` to `255` (default group is `128`).

If your world is played on a mobile or lower-end device, the maximum number of simultaneaous lights on screen may vary based on hardware capabilities.

Expand Down
2 changes: 1 addition & 1 deletion lua/docs/content/reference/mesh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ properties:

In the current version, whether or not a mesh uses a metallic-roughness map, an albedo texture, an emissive texture and a normal map depends on the file it was imported from. There is currently no way to access or change these textures.

Note that the mesh metallic-roughness will only be used if [Config.UsePBR](/reference/config/property-usepbr) is `true`.
Note that the mesh metallic-roughness will only be used if [Config.UsePBR](/reference/config#property-usepbr) is `true`.

Metallic-roughness is a lighting model that describes how a surface will look when under the effect of a [Light], it is made of three components,
- the `albedo` is the base color. It usually comes from an albedo texture.
Expand Down
24 changes: 14 additions & 10 deletions lua/docs/content/reference/number2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ type: "Number2"
description: A Number2 contains 3 [number] values (X & Y). It can represent different things in 2D space, like points or positions.

constructors:
- description: "Creates a Number2 with values x and y."
arguments:
- name: "x"
type: "number"
- name: "y"
type: "number"
samples:
- code: |
local myNumber2 = Number2(1, 2)
- description: |
A Number2 can be created,
- without parameter, equivalent to `Number2(0, 0)`
- with given x and y values
argument-sets:
-
-
- name: "x"
type: "number"
- name: "y"
type: "number"

properties:
- name: "Height"
Expand Down Expand Up @@ -127,8 +129,10 @@ functions:
type: "number"

- name: "Set"
return:
- type: "Number2"
description: |
Sets this `Number2`'s components to the given values.
Sets this `Number2`'s components to the given values, and return it.
argument-sets:
-
- name: "xy"
Expand Down
25 changes: 16 additions & 9 deletions lua/docs/content/reference/number3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ type: "Number3"
description: A Number3 contains 3 [number] values (X, Y & Z). It can represent different things in 3D space (points, vectors, forces).

constructors:
- description: "Creates a Number3 with values x, y and z."
arguments:
- name: "x"
type: "number"
- name: "y"
type: "number"
- name: "z"
type: "number"
- description: |
A Number3 can be created,
- without parameter, equivalent to `Number2(0, 0, 0)`
- with given x, y, and z values
argument-sets:
-
-
- name: "x"
type: "number"
- name: "y"
type: "number"
- name: "z"
type: "number"
samples:
- code: |
local myNumber3 = Number3(1, 2, 3)
Expand Down Expand Up @@ -229,8 +234,10 @@ functions:
type: "number"

- name: "Set"
return:
- type: "Number3"
description: |
Sets this `Number3`'s components to the given values.
Sets this `Number3`'s components to the given values, and return it.
argument-sets:
-
- name: "xyz"
Expand Down
Loading