Skip to content

Commit

Permalink
Document Attributes type (#74)
Browse files Browse the repository at this point in the history
* Document Attributes type.

* Document Attributes property.

- Use Attributes as the example property.
- Replace example property names with actual names (required for
  implicit form).

* Document additional supported attribute types.

List ColorSequence, NumberRange, and NumberSequence as supported
attribute types.
  • Loading branch information
Anaminus authored Jun 30, 2022
1 parent bd3736d commit 91c0ed5
Showing 1 changed file with 39 additions and 0 deletions.
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

0 comments on commit 91c0ed5

Please sign in to comment.