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
47 changes: 37 additions & 10 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -622,24 +622,51 @@
"github": "https://github.com/rive-app",
"discord": "https://discord.com/invite/FGjmaTr"
},
"links": [
"links": [
{
"header": "Resources",
"items": [
{ "label": "Community", "href": "https://community.rive.app/" },
{ "label": "Blog", "href": "https://rive.app/blog" },
{ "label": "Case Studies", "href": "https://rive.app/blog/case-studies" },
{ "label": "Marketplace", "href": "https://rive.app/marketplace" },
{ "label": "Feature Requests", "href": "https://community.rive.app/c/feature-requests/" }
{
"label": "Community",
"href": "https://community.rive.app/"
},
{
"label": "Blog",
"href": "https://rive.app/blog"
},
{
"label": "Case Studies",
"href": "https://rive.app/blog/case-studies"
},
{
"label": "Marketplace",
"href": "https://rive.app/marketplace"
},
{
"label": "Feature Requests",
"href": "https://community.rive.app/c/feature-requests/"
}
]
},
{
"header": "Company",
"items": [
{ "label": "Careers", "href": "https://rive.app/careers" },
{ "label": "Terms of Service", "href": "/legal/terms-of-service" },
{ "label": "Acceptable Use Policy", "href": "/legal/acceptable-use-policy" },
{ "label": "Privacy Policy", "href": "/legal/privacy-policy" }
{
"label": "Careers",
"href": "https://rive.app/careers"
},
{
"label": "Terms of Service",
"href": "/legal/terms-of-service"
},
{
"label": "Acceptable Use Policy",
"href": "/legal/acceptable-use-policy"
},
{
"label": "Privacy Policy",
"href": "/legal/privacy-policy"
}
]
}
]
Expand Down
8 changes: 8 additions & 0 deletions scripting/api-reference/artboards/animation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,31 @@ The duration of the animation.

### `advance`

to do

Advances the animation by the given time in seconds. Returns true if the
animation hasn't reached its end. If the animation is set to loop or ping
pong, it will always return true


### `setTime`

to do

set the animation time in seconds


### `setTimeFrames`

to do

set the animation time in frames


### `setTimePercentage`

to do

set the animation time as a percentage of the duration


22 changes: 22 additions & 0 deletions scripting/api-reference/artboards/artboard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,37 @@ end

### `draw`

to do

Draws the artboard using the provided renderer.


### `advance`

to do

Advances the artboard by the given time in seconds. Returns true if the
artboard should continue receiving advance calls.


### `instance`

to do

Creates a new instance of the artboard with independent state.


### `animation`

to do

Creates an animation instance linked to the artboard instance


### `bounds`

to do

Returns the bounding box of the artboard as two [Vector](/scripting/api-reference/vec2d/vector) values: the
minimum point and the maximum point.
```lua
Expand All @@ -76,35 +86,47 @@ print("Bounds height", maxPt.y - minPt.y)

### `node`

to do

Returns the node with the given name, or nil if no such node exists.


### `pointerDown`

to do

Pointer event down handler. Each returns a hit-test result, where 0
indicates no hit and non-zero values indicate a hit.


### `pointerUp`

to do

Pointer event up handler. Each returns a hit-test result, where 0
indicates no hit and non-zero values indicate a hit.


### `pointerMove`

to do

Pointer event move handler. Each returns a hit-test result, where 0
indicates no hit and non-zero values indicate a hit.


### `pointerExit`

to do

Pointer event exit handler. Each returns a hit-test result, where 0
indicates no hit and non-zero values indicate a hit.


### `addToPath`

to do

Adds the artboard’s geometry to the given path, optionally transformed
by the provided matrix.

Expand Down
2 changes: 2 additions & 0 deletions scripting/api-reference/artboards/node-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ The parent of the node, or nil if it has none.

### `decompose`

decompose(worldTransform: Mat2D) -> ()

Updates the node’s position, rotation, and scale from the given world
transform.

Expand Down
4 changes: 4 additions & 0 deletions scripting/api-reference/artboards/node-read-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ If node is a Path, paint trait is available with paint data

### `asPath`

asPath() -> PathData?

If node is a Path, returns the node as PathData


### `asPaint`

asPaint() -> Paint?

If node is a ShapePaint (Fill or Stroke), returns node as Paint


4 changes: 4 additions & 0 deletions scripting/api-reference/artboards/pointer-event.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ The unique identifier for the pointer.

### `new`

to do

## Methods

### `hit`

hit(isTranslucent: boolean?) -> ()

Marks the event as handled. If isTranslucent is true, the event may
continue to propagate through translucent hit targets.

Expand Down
16 changes: 16 additions & 0 deletions scripting/api-reference/color/color.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ title: Color

### `lerp`

to do

Linearly interpolates between two colors using the parameter t, where
t = 0 returns 'from' and t = 1 returns 'to'.
```lua highlight={7}
Expand All @@ -24,6 +26,8 @@ print(gray)

### `rgb`

to do

Returns a color constructed from red, green, and blue channels. Alpha
defaults to 255 (fully opaque). Channel values are clamped to [0, 255].
```lua
Expand All @@ -34,6 +38,8 @@ self.color = Color.rgb(255, 0, 0)

### `rgba`

to do

Returns a color constructed from red, green, blue, and alpha channels.
Channel values are clamped to [0, 255].
```lua
Expand All @@ -46,6 +52,8 @@ self.color = Color.rgba(255, 0, 0, 128)

### `red`

to do

Returns the red channel of the color. If a value is
provided, returns a new color with that channel updated.
```lua highlight={2,6}
Expand All @@ -62,6 +70,8 @@ print(Color.red(newColor))

### `green`

to do

Returns the green channel of the color. If a value is
provided, returns a new color with that channel updated.
```lua highlight={2,6}
Expand All @@ -78,6 +88,8 @@ print(Color.green(newColor))

### `blue`

to do

Returns the blue channel of the color. If a value is
provided, returns a new color with that channel updated.
```lua highlight={2,6}
Expand All @@ -94,6 +106,8 @@ print(Color.blue(newColor))

### `alpha`

to do

Returns the alpha channel of the color, or returns a new color with the
alpha channel set to the specified value. Values are clamped to [0, 255].
```lua highlight={2,6}
Expand All @@ -110,6 +124,8 @@ print(Color.alpha(newColor))

### `opacity`

to do

Returns the opacity of the color as a normalized value in the range
[0.0, 1.0], or returns a new color with its alpha set from the specified
opacity.
Expand Down
16 changes: 16 additions & 0 deletions scripting/api-reference/data-value/data-value.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ functions for checking the underlying value type.

### `number`

to do

Creates a [DataValueNumber](/scripting/api-reference/data-value/data-value-number) that stores a number.
```lua
local data = DataValue.number()
Expand All @@ -21,6 +23,8 @@ print(data.value) -- 42

### `string`

to do

Creates a [DataValueString](/scripting/api-reference/data-value/data-value-string) that stores a string.
```lua
local data = DataValue.string()
Expand All @@ -32,6 +36,8 @@ print(data.value) -- Rive for life!

### `boolean`

to do

Creates a [DataValueBoolean](/scripting/api-reference/data-value/data-value-boolean) that stores a boolean.
```lua
local data = DataValue.boolean()
Expand All @@ -43,6 +49,8 @@ print(data.value) -- false

### `color`

to do

Creates a [DataValueColor](/scripting/api-reference/data-value/data-value-color) that stores a [Color](/scripting/api-reference/color/color).
```lua
local data = DataValue.color()
Expand All @@ -56,6 +64,8 @@ print(Color.red(data.value)) -- 255

### `isNumber`

isNumber() -> boolean

Returns true if the value is a number.
```lua
local dv: DataValueNumber = DataValue.number()
Expand All @@ -65,6 +75,8 @@ print(dv.isNumber) -- true

### `isString`

isString() -> boolean

Returns true if the value is a string.
```lua
local dv: DataValueNumber = DataValue.number()
Expand All @@ -74,6 +86,8 @@ print(dv.isString) -- false

### `isBoolean`

isBoolean() -> boolean

Returns true if the value is a boolean.
```lua
local dv: DataValueNumber = DataValue.number()
Expand All @@ -83,6 +97,8 @@ print(dv.isBoolean) -- false

### `isColor`

isColor() -> boolean

Returns true if the value is a color.
```lua
local dv: DataValueNumber = DataValue.number()
Expand Down
2 changes: 2 additions & 0 deletions scripting/api-reference/data-value/property-trigger.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ end

### `fire`

to do

Fires the trigger and notifies all registered listeners.
```lua highlight={9}
local vmi = context:viewModel()
Expand Down
4 changes: 4 additions & 0 deletions scripting/api-reference/gradient/gradient.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ defined by a set of color stops ([GradientStop](/scripting/api-reference/gradien

### `linear`

to do

Creates a linear gradient that transitions between the specified color
stops along the line from 'from' to 'to'.

Expand All @@ -23,6 +25,8 @@ local g = Gradient.linear(Vector.xy(0, 0), Vector.xy(100, 0), {

### `radial`

to do

Creates a radial gradient centered at 'from', extending outward to the
given radius, using the specified color stops.

Expand Down
Loading