Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhonnyg committed Nov 21, 2024
1 parent 05d8bec commit 545b43e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
23 changes: 23 additions & 0 deletions defold-rive/api/rive.script_api
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,26 @@
- name: value
type: number|bool
desc: The value of the input

#*****************************************************************************************************

- name: set_state_machine_input
type: function
desc: Set the input values from a state machine input, either from the current top-level artboard, or from a nested artboard inside the Rive model artboard. Note - To set input for a trigger, use a bool value.

parameters:
- name: url
type: url
desc: The Rive model

- name: name
type: string
desc: The name of the input

- name: value
type: number|bool
desc: The value of the input to set

- name: nested_artboard
type: string
desc: (OPTIONAL) If specified, the input will be queried for the specified nested artboard
9 changes: 9 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ local v = rive.get_state_machine_input("#rivemodel", "Number 1", "My_Nested_Artb

-- To go deeper into the nested hierarchy, you can add slashes between each scope
local v = rive.get_state_machine_input("#rivemodel", "Number 1", "My_Nested_Artboard/My_Inner_Nested_Artboard")

-- Set the input value of the current state machine
rive.set_state_machine_input("#rivemodel", "Number 1", 0.5)

-- Set the input value of a nested artboard
rive.set_state_machine_input("#rivemodel", "Number 1", 0.5, "My_Nested_Artboard")

-- Same as the example above, to go even deeper, separate the scopers with slashes!
rive.set_state_machine_input("#rivemodel", "Number 1", 0.5, "My_Nested_Artboard/My_Inner_Nested_Artboard")
```

#### Events
Expand Down

0 comments on commit 545b43e

Please sign in to comment.