Skip to content
Closed
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
8 changes: 8 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,14 @@
{
"group": "Scripting API",
"pages": [
{
"group": "@luau",
"pages": [
"scripting/api-reference/luau/date-type-arg",
"scripting/api-reference/luau/date-type-result",
"scripting/api-reference/luau/vector"
]
},
{
"group": "Artboards",
"pages": [
Expand Down
17 changes: 17 additions & 0 deletions scripting/api-reference/color/color.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,20 @@ print(Color.opacity(newColor))
```


### `toFloat`

{/* toFloat: (color: Color) -> { number } */}
<div class="signature">
```lua
toFloat(color: Color) -> {number}
```
</div>

Convert a Color (ARGB packed integer) to an {r, g, b, a} table
with values in 0–1 range. Use with `clearColor` in render passes.
```lua
local cc = Color.toFloat(Color.rgba(255, 0, 0, 128))
-- cc = {1.0, 0.0, 0.0, 0.502}
```


2 changes: 1 addition & 1 deletion scripting/api-reference/interfaces/listener-action.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Called once when the listener is created or attached.
```lua highlight={4,5,6,12}
type MyListenerAction = {}

-- Called once when the script initializes.
-- Called once when the script initiali zes.
function init(self: MyListenerAction, context: Context): boolean
return true
end
Expand Down
13 changes: 13 additions & 0 deletions scripting/api-reference/interfaces/view-model.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,16 @@ end
```


### `getIndex`

{/* getIndex: (self: ViewModel) -> number */}
<div class="signature">
```lua
getIndex() -> number
```
</div>

Returns the index.
Returns -1 if view model does not have an index available.


20 changes: 20 additions & 0 deletions scripting/api-reference/luau/date-type-arg.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: DateTypeArg
---

## Fields

### `year`

### `month`

### `day`

### `hour`

### `min`

### `sec`

### `isdst`

24 changes: 24 additions & 0 deletions scripting/api-reference/luau/date-type-result.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: DateTypeResult
---

## Fields

### `year`

### `month`

### `wday`

### `yday`

### `day`

### `hour`

### `min`

### `sec`

### `isdst`

12 changes: 12 additions & 0 deletions scripting/api-reference/luau/vector.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: vector
---

## Fields

### `x`

### `y`

### `z`