Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Attributes type #74

Merged
merged 3 commits into from
Jun 30, 2022
Merged
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
39 changes: 39 additions & 0 deletions docs/properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Rojo supports most Roblox properties. This page documents all of the properties

| Property Type | Example Property | Build | Live Sync | Project Files |
|:----------------------------------------------------|:--------------------------------|:--:|:--:|:--:|
| [Attributes](#attributes) | `Instance.Attributes` | ✔ | ✔ | ✔ |
| [Axes](#axes) | `ArcHandles.Axes` | ✔ | ✔ | ✔ |
| [BinaryString](#binarystring) | `Terrain.MaterialColors` | ✔ | ❌ | ✔ |
| [Bool](#bool) | `Part.Anchored` | ✔ | ✔ | ✔ |
Expand Down Expand Up @@ -51,6 +52,44 @@ Rojo supports most Roblox properties. This page documents all of the properties
## Properties in Project Files
Many types have an **implicit** and **explicit** format. The [Project format page](../project-format#instance-property-value) decribes these formats in more detail.

### Attributes
Rojo defines the "Attributes" property on any instance to have the Attributes type, allowing it to be specified implicitly.

For both implicit and explicit values, the format is an object where each field represents an attribute, where the key is the name of the attribute, and the value must be an explicit value.

```json
{
"$properties": {
"Attributes": {
"Foo": {"Bool": true},
"Bar": {"Vector3": [1.0, 2.0, 3.0]},
},
"AttributesSerialized": {
"Attributes": {
"Foo": {"Bool": true},
"Bar": {"Vector3": [1.0, 2.0, 3.0]},
}
}
}
}
```

The following types are supported for attribute values:

- [Bool](#bool)
- [BrickColor](#brickcolor)
- [Color3](#color3)
- [ColorSequence](#colorsequence)
- [Float64](#float64)
- [NumberRange](#numberrange)
- [NumberSequence](#numbersequence)
- [Rect](#rect)
- [String](#string)
- [UDim](#udim)
- [UDim2](#udim2)
- [Vector2](#vector2)
- [Vector3](#vector3)

### Axes
The Axes type cannot be specified implicitly. For explicit values, the format is a list of strings, each of which may be either "X", "Y", or "Z". Each string sets the corresponding component.

Expand Down