wep ....
Pour regler ce pb de fenetre TV appelée qui est dur à fermer et qui s'ouvre toute seule a rezize de la fenetre, et où on ne sait pas
Où la fermer ....
Pouquoi ne pas employer ce que m'avait fait magnus ?
c'est dans le theatre !!! Ca marche parfaitement !!
et ptet qu'on peux encore nettoyer le code et l'integrer completement dans l'avatar ...
Le bouton "fermer la fenetre"
apparait de manière fixe juste en dessous de la fenetre ouverte
dans le monde du theatre il y a inclus :
###############proto ouverture fichier #############
EXTERNPROTO WebBrowserTV[
exposedField MFString url
exposedField SFString title
exposedField MFString description
exposedField SFString left
exposedField SFString top
exposedField SFString width
exposedField SFString height
field SFBool autoload
eventIn SFTime open
eventIn SFTime close
eventOut SFTime opened
eventOut SFTime closed
] ["protowebbrowserTVdirect.wrl#WebBrowser" ]
DEF concours3 WebBrowserTV{
url "http://tv-wmpk.blog-video.tv/tele_export.swf?id=94190c7d26f024a5d6ea927195c29eb9"
title ""
description ""
left "0%"
top "0%"
width "480"
height "400"
autoload FALSE
}
###############################################
et dans le proto appelé
il y a :
PROTO WebBrowser[ #1.02
exposedField MFString url ""
exposedField SFString title "untitled"
exposedField MFString description ""
exposedField SFString left "1%"
exposedField SFString top "1%"
exposedField SFString width "350"
exposedField SFString height "300"
field SFBool autoload TRUE
eventIn SFTime open
eventIn SFTime close
eventOut SFTime opened
eventOut SFTime closed
eventOut SFInt32 choix0
eventOut SFInt32 choix1
]{
# PositionBOULE VERTE DOUVERTURE
Transform {
#translation -6.75 1.3 19.85
translation -25.06 -13.17 -75
rotation 0 0 0 0
# Position txt DOUVERTURE
children [Transform {
translation -2.3 -1 0
rotation 0 0 0 0
children Shape {
appearance Appearance {
material Material {
diffuseColor .9 .9 .9
ambientIntensity .1
shininess .6
transparency 0
}
}
geometry Text {
fontStyle FontStyle {
size 1
style "PLAIN"
family "Arial"
}
string "Direct-TV"
}
}
}
DEF touch TouchSensor {}
Shape {
appearance Appearance {
material Material {
diffuseColor .0 .6 .0
emissiveColor .1 .1 .1
ambientIntensity .1
shininess .6
}
}
geometry Sphere {
radius .5
}
}]
}
DEF swi1 Switch { choice [
Collision { collide FALSE children [
DEF HudProx ProximitySensor { size 100000 100000 100000 }
DEF Hud_Exit Transform { children [
Transform { translation 0 -0.055 -0.15 scale .1 .1 .1 children [
#PositionBOULE rouge fermeture
# Transform {
#translation -7.2 1.3 19.85
#rotation 0 0 0 0
# Position txt fermeture
# children [Transform {
# translation -7.75 1.4 19.75
# rotation 0 1 0 3.14
# children
# Shape {
# appearance Appearance {
# material Material {
# diffuseColor .9 .9 .9
# ambientIntensity .1
# shininess .6
# transparency 0
# }
# }
# geometry Text {
# fontStyle FontStyle {
# size .1
# style "PLAIN"
# family "Arial"
# }
# string ""
# }
# }
#}
DEF touch2 TouchSensor {}
Shape {
appearance Appearance {
material Material {
diffuseColor .6 .0 .0
emissiveColor .1 .1 .1
ambientIntensity .1
shininess .6
}
}
geometry Text {
fontStyle FontStyle {
size 0.1
style "PLAIN"
family "Arial"
}
string "Close Direct-TV"
}
}]
}
]}]}]}
DEF gr Transform{scale 0 0 0 }
DEF brain Script{
field SFString proto "
EXTERNPROTO Object [
exposedField MFString url
exposedField SFString type
exposedField SFString title
exposedField MFString description
exposedField MFString properties
exposedField MFNode children
eventIn SFBool set_open
eventOut SFBool isOpen
] [\"urn:inet:blaxxun.com:node:Object\",\"http://www.blaxxun.com/vrml/protos/nodes.wrl#Object\",\"nodes.wrl#Object\"]
"
exposedField MFString address IS url
exposedField SFString left IS left
exposedField SFString top IS top
exposedField SFString width IS width
exposedField SFString height IS height
field SFBool autoload IS autoload
field SFNode gr USE gr
field SFBool isOpen FALSE
field SFNode current_object NULL
field SFBool isAbove60 FALSE
eventIn SFTime open IS open
eventIn SFTime close IS close
eventIn SFVec2f window_resized
eventOut SFTime opened IS opened
eventOut SFTime closed IS closed
eventOut SFInt32 choix0 IS choix0
eventOut SFInt32 choix1 IS choix1
directOutput TRUE
url "javascript:
function createObject(){
str = proto + ' Object {';
str += ' url \"' + address + '\" ';
str += ' type \"text/html\" ';
str += ' title \"Testing\" ';
str += ' description \"Testing\" ';
str += ' properties [\"application=WebBrowser\" \"left=' + left + '\" \"top=' + top;
str += '\" \"width=' + width + '\" \"height=' + height + '\"] ';
str += '} ';
return Browser.createVrmlFromString(str);
}
function recreateObject(){
if (isOpen) current_object.set_open = false;
gr.children = new MFNode();
nodes = createObject();
gr.addChildren = nodes;
nodes[0].set_open = true;
current_object = nodes[0];
isOpen = true;
}
function initialize(){
isAbove60 = parseFloat(Browser.getVersion()) > 6.0;
nodes = createObject();
gr.addChildren = nodes;
if (autoload) nodes[0].set_open = true;
current_object = nodes[0];
isOpen = autoload;
Browser.addRoute(Browser, 'windowSize', Browser.getScript(), 'window_resized');
}
function shutdown() {
Browser.deleteRoute(Browser,'windowSize',Browser.getScript(),'window_resized');
}
function address(v){
if (!isAbove60) recreateObject();
else current_object.url = new MFString(v);
}
function top(v){
if (!isAbove60) recreateObject();
else current_object.properties[2] = 'top=' + v;
}
function left(v){
if (!isAbove60) recreateObject();
else current_object.properties[1] = 'left=' + v;
}
function width(v){
if (!isAbove60) recreateObject();
else current_object.properties[3] = 'width=' + v;
}
function height(v){
if (!isAbove60) recreateObject();
else current_object.properties[4] = 'height=' + v;
}
function open(v,t){
if (isOpen) return false;
current_object.set_open = true;
isOpen = true;
opened = t;
choix0 = 0;
}
function close(v,t){
if (!isOpen) return false;
current_object.set_open = false;
isOpen = false;
closed = t;
choix1 = -1;
}
function window_resized(){ Stop ();}
"
}
ROUTE touch.touchTime TO brain.open
ROUTE touch2.touchTime TO brain.close
ROUTE HudProx.position_changed TO HudProx.set_center
ROUTE HudProx.orientation_changed TO Hud_Exit.set_rotation
ROUTE HudProx.position_changed TO Hud_Exit.set_translation
ROUTE brain.choix0 TO swi1.set_whichChoice
ROUTE brain.choix1 TO swi1.set_whichChoice
}
#####################################
Voilà, voilou ....
voir le lien du fichier proto
http://wmpk.fnet.fr/Testphp/Monde3D/no_cache/d3theatre/protowebbrowserTVdirect.wrl