123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- Menubar.Add = function ( signals ) {
- var container = new UI.Panel();
- container.setClass( 'menu' );
- container.onMouseOver( function () { options.setDisplay( 'block' ) } );
- container.onMouseOut( function () { options.setDisplay( 'none' ) } );
- container.onClick( function () { options.setDisplay( 'none' ) } );
- var title = new UI.Panel();
- title.setTextContent( 'Add' ).setColor( '#666' );
- title.setMargin( '0px' );
- title.setPadding( '8px' );
- container.add( title );
- //
- var options = new UI.Panel();
- options.setClass( 'options' );
- options.setDisplay( 'none' );
- container.add( options );
- // add plane
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'Plane' );
- option.onClick( function () {
- editor.select( editor.createObject( 'Plane' ) );
- } );
- options.add( option );
- // add cube
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'Cube' );
- option.onClick( function () {
- editor.select( editor.createObject( 'Cube' ) );
- } );
- options.add( option );
- // add cylinder
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'Cylinder' );
- option.onClick( function () {
- editor.select( editor.createObject( 'Cylinder' ) );
- } );
- options.add( option );
- // add sphere
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'Sphere' );
- option.onClick( function () {
- editor.select( editor.createObject( 'Sphere' ) );
- } );
- options.add( option );
- // add icosahedron
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'Icosahedron' );
- option.onClick( function () {
- editor.select( editor.createObject( 'Icosahedron' ) );
- } );
- options.add( option );
- // add torus
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'Torus' );
- option.onClick( function () {
- editor.select( editor.createObject( 'Torus' ) );
- } );
- options.add( option );
- // add torus knot
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'TorusKnot' );
- option.onClick( function () {
- editor.select( editor.createObject( 'TorusKnot' ) );
- } );
- options.add( option );
- // add group
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'Group' );
- option.onClick( function () {
- editor.select( editor.createObject() );
- } );
- options.add( option );
- // divider
- options.add( new UI.HorizontalRule() );
- // add point light
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'Point light' );
- option.onClick( function () {
- editor.select( editor.createObject( 'PointLight' ) );
- } );
- options.add( option );
- // add spot light
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'Spot light' );
- option.onClick( function () {
- editor.select( editor.createObject( 'SpotLight' ) );
- } );
- options.add( option );
- // add directional light
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'Directional light' );
- option.onClick( function () {
- editor.select( editor.createObject( 'DirectionaLight' ) );
- } );
- options.add( option );
- // add hemisphere light
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'Hemisphere light' );
- option.onClick( function () {
- editor.select( editor.createObject( 'HemisphereLight' ) );
- } );
- options.add( option );
- // add ambient light
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'Ambient light' );
- option.onClick( function () {
- editor.select( editor.createObject( 'AmbientLight' ) );
- } );
- options.add( option );
- //
- options.add( new UI.HorizontalRule() );
- // add material
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'Phong material' );
- option.onClick( function () {
- editor.select( editor.createMaterial( 'Phong' ) );
- } );
- options.add( option );
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'Lambert material' );
- option.onClick( function () {
- editor.select( editor.createMaterial( 'Lambert' ) );
- } );
- options.add( option );
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'Normal material' );
- option.onClick( function () {
- editor.select( editor.createMaterial( 'Normal' ) );
- } );
- options.add( option );
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'Basic material' );
- option.onClick( function () {
- editor.select( editor.createMaterial( 'Basic' ) );
- } );
- options.add( option );
- //
- options.add( new UI.HorizontalRule() );
- // add texture
- var option = new UI.Panel();
- option.setClass( 'option' );
- option.setTextContent( 'Texture' );
- option.onClick( function () {
- editor.select( editor.createTexture() );
- } );
- options.add( option );
- return container;
- }
|