JsonWidget
Values:
Functions:
- getEffect
- getUserString
- isEffectDone
- isEffectPlaying
- setPosition
- setPreview
- setPreview
- setPreview
- setUserString
- setVisible
- startEffect
- stopEffect
Operations:
| Operation | Return type | Description |
|---|---|---|
| JsonWidget == JsonWidget | boolean | Checks if two instances of JsonWidget refer to the same JsonWidget. |
name string
Get:
Client only
Get the name of the jsonWidget.
getEffect(jsonWidget, name)
Client only
Gets an effect from a widget.
Parameters:
| Type | Name | Description |
|---|---|---|
| JsonWidget | jsonWidget | The JsonWidget. |
| string | name | The name of the effect on the json widget to get. |
Returns:
| Type | Description |
|---|---|
| Effect | The effect. |
getUserString(jsonWidget, key)
Client only
Gets a string associated with the given key from a json widget.
Parameters:
| Type | Name | Description |
|---|---|---|
| JsonWidget | jsonWidget | The JsonWidget. |
| string | key | The key connected to the value. |
Returns:
| Type | Description |
|---|---|
| string value The value associated with the key. |
isEffectDone(jsonWidget, name)
Client only
Returns if a named effect is done or not.
Parameters:
| Type | Name | Description |
|---|---|---|
| JsonWidget | jsonWidget | The JsonWidget. |
| string | name | The name of the effect. |
Returns:
| Type | Description |
|---|---|
| boolean | True if the effect is done, false otherwise. |
isEffectPlaying(jsonWidget, name)
Client only
Returns if a named effect is playing or not.
Parameters:
| Type | Name | Description |
|---|---|---|
| JsonWidget | jsonWidget | The JsonWidget. |
| string | name | The name of the effect. |
Returns:
| Type | Description |
|---|---|
| boolean | True if the effect is playing, false otherwise. |
setPosition(jsonWidget, x, y)
Client only
Sets the position of the widget. This will not change the json data position.
Parameters:
| Type | Name | Description |
|---|---|---|
| JsonWidget | jsonWidget | The JsonWidget. |
| integer | x | The x position. |
| integer | y | The y position. |
setPreview(jsonWidget, uuid)
Client only
Sets the item preview uuid for a json widget. Passing nil clears the preview.
Parameters:
| Type | Name | Description |
|---|---|---|
| JsonWidget | jsonWidget | The JsonWidget. |
| uuid | uuid | The item uuid. |
setPreview(jsonWidget, string)
Client only
Sets the blueprint preview path for a json widget. Passing nil clears the preview.
Parameters:
| Type | Name | Description |
|---|---|---|
| JsonWidget | jsonWidget | The JsonWidget. |
| string | string | The blueprint path. |
setPreview()
Client only
setUserString(jsonWidget, key, value)
Client only
Sets a custom string on a json widget that can be fetched using the key.
Parameters:
| Type | Name | Description |
|---|---|---|
| JsonWidget | jsonWidget | The JsonWidget. |
| string | key | The key connected to the value. |
| string | value | The value being written onto the widget. |
setVisible(jsonWidget, stopImmediate)
Client only
Sets the visibility of a widget.
Parameters:
| Type | Name | Description |
|---|---|---|
| JsonWidget | jsonWidget | The JsonWidget. |
| boolean | stopImmediate | The widgets new visibility state. |
startEffect(jsonWidget, name)
Client only
Starts the effect applied to the widget.
Parameters:
| Type | Name | Description |
|---|---|---|
| JsonWidget | jsonWidget | The JsonWidget. |
| string | name | The name of the effect on the json widget to start. |
stopEffect(jsonWidget, name, stopImmediate?)
Client only
Stops the effect applied to the widget.
Parameters:
| Type | Name | Description |
|---|---|---|
| JsonWidget | jsonWidget | The JsonWidget. |
| string | name | The name of the effect to stop. |
| boolean | stopImmediate? | If the effect should stop immediately. (Optional) (Defaults to false) |