media @ VU 
  
 
 
 
 
  
    
    
  
proto-rif-interface-window.vr
proto-rif-interface-window.vr
(wrl
) 
[ flux /
bitmanagement / 
cortona / 
octaga 
]
  
  
window
  
  
Web3D/VR
  
#@extern @vr-extern-proto-object-box.wrl
PROTO Window [
    exposedField MFNode  children       []
    eventIn      MFNode  addChildren
    eventIn      MFNode  removeChildren 
    exposedField SFVec3f scale          1 1 1
    exposedField SFColor color          0.3 0.3 0.3
    exposedField SFFloat transparency   0
    exposedField SFBool  touchEnabled   FALSE
    eventOut     SFTime  touchTime  
    field        SFVec2f position       0 0
    field        SFVec2f size           1 1
    exposedField MFString title         "window"
] {
    DEF TRANS Transform {
        scale IS scale
        children [
            Transform {
                translation 0 0 0.01
                children       IS children
                addChildren    IS addChildren
                removeChildren IS removeChildren
            }
            DEF TEXTTRANSFORM Transform {
                children [
                    Shape {
                        appearance Appearance {
                            material Material {
                                transparency     IS transparency
                                emissiveColor 0 0 0
                                diffuseColor  0 0 0
                            }
                        }
                        geometry DEF TEXT Text {
                            string    IS title
                            fontStyle FontStyle {
                                family "TYPEWRITER"
                                style  "ITALIC"
                                size   0.05
                            }
                        }
                    }
                ]
            }
            Group {
                children [
                    DEF TOUCHSENSOR TouchSensor {
                        enabled   IS touchEnabled
                        touchTime IS touchTime
                    }
                    Shape {
                        appearance Appearance {
                            material Material {
                                transparency     IS transparency
                                emissiveColor    IS color
                                diffuseColor     0 0 0
                            }
                        }
                        geometry DEF WINDOWBOX box { }
                    }
                ]   
            }
        ]
    }
    DEF SCRIPT Script {
        field    SFNode  textTransform  USE TEXTTRANSFORM
        field    SFNode  transformNode USE TRANS
        eventOut SFVec3f set_size
        field    SFVec2f position      IS  position
        field    SFVec2f size          IS  size    
        url "vrmlscript:
            function initialize() {
                transformNode.translation =
                               new SFVec3f(position.x,position.y,0);
                set_size = new SFVec3f(size.x,size.y,0.02);
                textTransform.translation =
                               new SFVec3f(-size.x/2,size.y/2-0.05,0.015);
            }
        "
    }
    ROUTE SCRIPT.set_size TO WINDOWBOX.size
}
  
    
  
    
  
  
  
  
  
  
  
  (C) A. Eliëns 
  21/5/2007
  
  You may not copy or print any of this material without explicit permission of the author or the publisher. 
  
In case of other copyright issues, contact the author.