OSDN Git Service

three.jsをThirdPartyに追加
[webglgame/webgl_framework.git] / webglFramework / Thirdparty / three.js-master / editor / js / Menubar.Play.js
diff --git a/webglFramework/Thirdparty/three.js-master/editor/js/Menubar.Play.js b/webglFramework/Thirdparty/three.js-master/editor/js/Menubar.Play.js
new file mode 100644 (file)
index 0000000..75a3cb2
--- /dev/null
@@ -0,0 +1,38 @@
+/**
+ * @author mrdoob / http://mrdoob.com/
+ */
+
+Menubar.Play = function ( editor ) {
+
+       var signals = editor.signals;
+
+       var container = new UI.Panel();
+       container.setClass( 'menu' );
+
+       var isPlaying = false;
+
+       var title = new UI.Panel();
+       title.setClass( 'title' );
+       title.setTextContent( 'Play' );
+       title.onClick( function () {
+
+               if ( isPlaying === false ) {
+
+                       isPlaying = true;
+                       title.setTextContent( 'Stop' );
+                       signals.startPlayer.dispatch();
+
+               } else {
+
+                       isPlaying = false;
+                       title.setTextContent( 'Play' );
+                       signals.stopPlayer.dispatch();
+
+               }
+
+       } );
+       container.add( title );
+
+       return container;
+
+};