@splinetool/runtime 0.9.98 → 0.9.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -10
- package/build/runtime.cjs +6 -6
- package/build/runtime.js +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -72,7 +72,7 @@ const spline = new Application(canvas);
|
|
|
72
72
|
spline
|
|
73
73
|
.load('https://prod.spline.design/6Wq1Q7YGyM-iab9i/scene.splinecode')
|
|
74
74
|
.then(() => {
|
|
75
|
-
spline.addEventListener('
|
|
75
|
+
spline.addEventListener('mouseDown', (e) => {
|
|
76
76
|
if (e.target.name === 'Cube') {
|
|
77
77
|
console.log('I have been clicked!');
|
|
78
78
|
}
|
|
@@ -154,18 +154,20 @@ spline.load('https://prod.spline.design/6Wq1Q7YGyM-iab9i/scene.splinecode', {
|
|
|
154
154
|
|
|
155
155
|
You can call all these different methods on the Spline `Application` instance.
|
|
156
156
|
|
|
157
|
-
| Name
|
|
158
|
-
|
|
|
159
|
-
| `
|
|
160
|
-
| `
|
|
161
|
-
| `
|
|
162
|
-
| `
|
|
163
|
-
| `
|
|
164
|
-
| `
|
|
157
|
+
| Name | Type | Description |
|
|
158
|
+
| --------------------- | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
159
|
+
| `addEventListener` | `(eventName: SplineEventName, cb: (e: SplineEvent) => void) => void` | Add an event listener for Spline events |
|
|
160
|
+
| `removeEventListener` | `(eventName: SplineEventName, cb: (e: SplineEvent) => void) => void` | Remove an event listener for Spline events |
|
|
161
|
+
| `emitEvent` | `(eventName: SplineEventName, nameOrUuid: string) => void` | Triggers a Spline event associated to an object with provided name or uuid in reverse order. Starts from first state to last state. |
|
|
162
|
+
| `emitEventReverse` | `(eventName: SplineEventName, nameOrUuid: string) => void` | Triggers a Spline event associated to an object with provided name or uuid in reverse order. Starts from last state to first state. |
|
|
163
|
+
| `findObjectById` | `(uuid: string) => SPEObject` | Searches through scene's children and returns the object with that uuid. |
|
|
164
|
+
| `findObjectByName` | `(name: string) => SPEObject` | Searches through scene's children and returns the first object with that name. |
|
|
165
|
+
| `setZoom` | `(zoom: number) => void` | Sets the initial zoom of the scene. |
|
|
166
|
+
| `setSize` | `(width: number, height:number) => void` | Sets the size of the application and canvas. When called, Spline will stop automatic size updates. |
|
|
165
167
|
|
|
166
168
|
### Spline Events
|
|
167
169
|
|
|
168
|
-
These are all the Spline event types that you can pass to the `emitEvent`
|
|
170
|
+
These are all the Spline event types that you can pass to the `addEventListener`, `emitEvent` and `emitEventReverse` function.
|
|
169
171
|
|
|
170
172
|
| Name | Description |
|
|
171
173
|
| ------------ | --------------------------------------------- |
|