##:@* slide ## ##@ extern #@proto proto-slide-elements-channel.vr ##@ info ## Needs IO, ## In: keyboard/mouse input for 'next-level' etc. ## Out: signal how many levels/is-done bg color-etc... ##@ proto PROTO Slide [ eventIn MFNode addChildren eventIn MFNode removeChildren exposedField SFFloat width 0 exposedField SFFloat height 0 exposedField SFInt32 showEffect -1 exposedField SFInt32 hideEffect -1 exposedField MFNode blocks [] eventOut SFInt32 nrLevels exposedField SFInt32 showLevel 0 exposedField SFInt32 level 0 exposedField SFVec3f location 0 0 0 exposedField SFVec3f translation 0 0 0 exposedField SFRotation rotation 0 0 1 0 exposedField SFVec3f scale 1 1 1 exposedField SFBool show FALSE exposedField SFBool hasBgColor FALSE exposedField MFColor bgColor [0 0 0] exposedField SFInt32 bgChoice -1 exposedField SFString id "anonymous" ] { ##@ body Transform { translation IS location children [ Transform { addChildren IS addChildren removeChildren IS removeChildren translation IS translation rotation IS rotation scale IS scale children IS blocks } ] } ##@ script Script { directOutput TRUE field MFNode blocks IS blocks eventOut SFInt32 nrLevels IS nrLevels eventIn SFInt32 showLevel IS showLevel eventOut SFInt32 level IS level url "javascript: function initialize() { var i = 0; var maxLevels = 0; for(i=0;i maxLevels) { maxLevels = blocks[i].lastLevel+1; } } nrLevels = maxLevels; } ##@ levels function showLevel(value,time) { level = value; var i = 0; for(i=0;i