|
@@ -1,34 +1,26 @@
|
|
Menubar.Add = function ( signals ) {
|
|
Menubar.Add = function ( signals ) {
|
|
|
|
|
|
var container = new UI.Panel();
|
|
var container = new UI.Panel();
|
|
- container.setFloat( 'left' );
|
|
|
|
- container.setWidth( '50px' );
|
|
|
|
- container.setCursor( 'pointer' );
|
|
|
|
- container.onMouseOver( function () { options.setDisplay( '' ) } );
|
|
|
|
- container.onMouseOut( function () { options.setDisplay( 'none' ) } );
|
|
|
|
- container.onClick( function () { options.setDisplay( 'none' ) } );
|
|
|
|
|
|
+ container.setClass( 'menu' );
|
|
|
|
|
|
var title = new UI.Panel();
|
|
var title = new UI.Panel();
|
|
title.setTextContent( 'Add' ).setColor( '#666' );
|
|
title.setTextContent( 'Add' ).setColor( '#666' );
|
|
title.setMargin( '0px' );
|
|
title.setMargin( '0px' );
|
|
- title.setPadding( '8px' )
|
|
|
|
|
|
+ title.setPadding( '8px' );
|
|
container.add( title );
|
|
container.add( title );
|
|
|
|
|
|
//
|
|
//
|
|
|
|
|
|
var options = new UI.Panel();
|
|
var options = new UI.Panel();
|
|
|
|
+ options.setClass( 'options' );
|
|
options.setWidth( '140px' );
|
|
options.setWidth( '140px' );
|
|
- options.setBackgroundColor( '#ddd' );
|
|
|
|
- options.setPadding( '0px' );
|
|
|
|
- options.setBorderTop( 'solid 1px #ccc' );
|
|
|
|
- options.setStyle( 'box-shadow', [ '0 3px 6px rgba(0,0,0,0.1), 3px 3px 6px rgba(0,0,0,0.2)' ] );
|
|
|
|
- options.setDisplay( 'none' );
|
|
|
|
container.add( options );
|
|
container.add( options );
|
|
|
|
|
|
// add sphere
|
|
// add sphere
|
|
|
|
|
|
var option = new UI.Panel();
|
|
var option = new UI.Panel();
|
|
- option.setTextContent( 'Sphere' ).setColor( '#666' ).setPadding( '6px 12px' );
|
|
|
|
|
|
+ option.setClass( 'option' );
|
|
|
|
+ option.setTextContent( 'Sphere' );
|
|
option.onClick( function () {
|
|
option.onClick( function () {
|
|
|
|
|
|
var radius = 75;
|
|
var radius = 75;
|
|
@@ -44,12 +36,11 @@ Menubar.Add = function ( signals ) {
|
|
} );
|
|
} );
|
|
options.add( option );
|
|
options.add( option );
|
|
|
|
|
|
- addHoverStyle( option );
|
|
|
|
-
|
|
|
|
// add cube
|
|
// add cube
|
|
|
|
|
|
var option = new UI.Panel();
|
|
var option = new UI.Panel();
|
|
- option.setTextContent( 'Cube' ).setColor( '#666' ).setPadding( '6px 12px' );
|
|
|
|
|
|
+ option.setClass( 'option' );
|
|
|
|
+ option.setTextContent( 'Cube' );
|
|
option.onClick( function () {
|
|
option.onClick( function () {
|
|
|
|
|
|
var width = 100;
|
|
var width = 100;
|
|
@@ -70,12 +61,11 @@ Menubar.Add = function ( signals ) {
|
|
} );
|
|
} );
|
|
options.add( option );
|
|
options.add( option );
|
|
|
|
|
|
- addHoverStyle( option );
|
|
|
|
-
|
|
|
|
// add plane
|
|
// add plane
|
|
|
|
|
|
var option = new UI.Panel();
|
|
var option = new UI.Panel();
|
|
- option.setTextContent( 'Plane' ).setColor( '#666' ).setPadding( '6px 12px' );
|
|
|
|
|
|
+ option.setClass( 'option' );
|
|
|
|
+ option.setTextContent( 'Plane' );
|
|
option.onClick( function () {
|
|
option.onClick( function () {
|
|
|
|
|
|
var width = 200;
|
|
var width = 200;
|
|
@@ -95,18 +85,15 @@ Menubar.Add = function ( signals ) {
|
|
} );
|
|
} );
|
|
options.add( option );
|
|
options.add( option );
|
|
|
|
|
|
- addHoverStyle( option );
|
|
|
|
-
|
|
|
|
// divider
|
|
// divider
|
|
|
|
|
|
- var option = new UI.Panel();
|
|
|
|
- option.setBackgroundColor( '#ccc' ).setPadding( '1px 12px' );
|
|
|
|
- options.add( option );
|
|
|
|
|
|
+ options.add( new UI.HorizontalRule() );
|
|
|
|
|
|
// add directional light
|
|
// add directional light
|
|
|
|
|
|
var option = new UI.Panel();
|
|
var option = new UI.Panel();
|
|
- option.setTextContent( 'Directional light' ).setColor( '#666' ).setPadding( '6px 12px' );
|
|
|
|
|
|
+ option.setClass( 'option' );
|
|
|
|
+ option.setTextContent( 'Directional light' );
|
|
option.onClick( function () {
|
|
option.onClick( function () {
|
|
|
|
|
|
var color = 0xffffff;
|
|
var color = 0xffffff;
|
|
@@ -125,12 +112,11 @@ Menubar.Add = function ( signals ) {
|
|
} );
|
|
} );
|
|
options.add( option );
|
|
options.add( option );
|
|
|
|
|
|
- addHoverStyle( option );
|
|
|
|
-
|
|
|
|
// add point light
|
|
// add point light
|
|
|
|
|
|
var option = new UI.Panel();
|
|
var option = new UI.Panel();
|
|
- option.setTextContent( 'Point light' ).setColor( '#666' ).setPadding( '6px 12px' );
|
|
|
|
|
|
+ option.setClass( 'option' );
|
|
|
|
+ option.setTextContent( 'Point light' );
|
|
option.onClick( function () {
|
|
option.onClick( function () {
|
|
|
|
|
|
var color = 0xffffff;
|
|
var color = 0xffffff;
|
|
@@ -145,22 +131,12 @@ Menubar.Add = function ( signals ) {
|
|
} );
|
|
} );
|
|
options.add( option );
|
|
options.add( option );
|
|
|
|
|
|
- addHoverStyle( option );
|
|
|
|
-
|
|
|
|
// add spot light
|
|
// add spot light
|
|
|
|
|
|
// add hemisphere light
|
|
// add hemisphere light
|
|
|
|
|
|
// add ambient light
|
|
// add ambient light
|
|
|
|
|
|
- //
|
|
|
|
-
|
|
|
|
- function addHoverStyle( element ) {
|
|
|
|
-
|
|
|
|
- element.onMouseOver( function () { element.setBackgroundColor( '#356' ).setColor( '#eee' ); } );
|
|
|
|
- element.onMouseOut( function () { element.setBackgroundColor( 'transparent' ).setColor( '#666' ) } );
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
|
|
function createDummyMaterial() {
|
|
function createDummyMaterial() {
|
|
|
|
|