Skip to content

Commit 22e890a

Browse files
committed
Added comments.
1 parent bf7a231 commit 22e890a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

docs/_posts/reference/script-node-authoring-interface.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,13 @@ Script {
263263
inputOutput SFTime duration 10
264264
url "ecmascript:
265265
266+
// Callback for 'inputOnly SFBool start'.
266267
function start (value, time)
267268
{
268269
...
269270
}
270271
272+
// Callback for 'inputOutput SFTime duration'.
271273
function set_duration (value, time)
272274
{
273275
...
@@ -292,6 +294,7 @@ Script {
292294
outputOnly SFFloat transparency_changed
293295
url "ecmascript:
294296
297+
// Callback for 'inputOnly SFBool set_active'.
295298
function set_active (value, time)
296299
{
297300
transparency_changed = value ? 0.5 : 0;
@@ -310,11 +313,13 @@ Script {
310313
initializeOnly SFBool active
311314
url "ecmascript:
312315
316+
// Callback for 'inputOnly SFBool set_active'.
313317
function set_active (value, time)
314318
{
315319
active = value;
316320
}
317321
322+
// Function to be called after all input fields are processed.
318323
function eventsProcessed ()
319324
{
320325
print (active);
@@ -361,7 +366,7 @@ Sometimes it is necessary to get access to the corresponding Script node. For th
361366
```vrml
362367
DEF Touch TouchSensor { }
363368
364-
Script {
369+
DEF SomeScript Script {
365370
inputOnly SFBool set_active
366371
initializeOnly SFNode touch USE Touch
367372
url "ecmascript:
@@ -373,12 +378,13 @@ function initialize ()
373378
// Add route from TouchSensor to this Script.
374379
const scene = Browser .currentScene;
375380
const route = scene .addRoute (touch, 'isActive', this, 'set_active');
376-
print (this .getNodeName ());
381+
print (`initialize`, this .getNodeName ());
377382
}
378383
379384
// Callback for 'inputOnly SFBool set_active'.
380-
function set_active (value, this)
385+
function set_active (value, time)
381386
{
387+
print (`set_active`, this .getNodeName ());
382388
// ...
383389
}
384390
"

0 commit comments

Comments
 (0)