Sidebar.Properties.World.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. Sidebar.Properties.World = function ( signals ) {
  2. var container = new UI.Panel();
  3. container.setBorderTop( '1px solid #ccc' );
  4. container.setPadding( '10px' );
  5. var objectType = new UI.Text().setColor( '#666' ).setValue( 'WORLD' );
  6. container.add( objectType );
  7. container.add( new UI.Break(), new UI.Break() );
  8. // clear color
  9. var clearColorRow = new UI.Panel();
  10. var clearColor = new UI.Color( 'absolute' ).setLeft( '100px' ).setValue( '#aaaaaa' ).onChange( updateClearColor );
  11. clearColorRow.add( new UI.Text().setValue( 'Clear color' ).setColor( '#666' ) );
  12. clearColorRow.add( clearColor );
  13. container.add( clearColorRow );
  14. // fog
  15. var fogRow = new UI.Panel();
  16. var fog = new UI.Select( 'absolute' ).setOptions( {
  17. 'None': 'None',
  18. 'Fog': 'Fog',
  19. 'FogExp2': 'FogExp2'
  20. } ).setLeft( '100px' ).setWidth( '150px' ).setColor( '#444' ).setFontSize( '12px' ).onChange( updateFog );
  21. fogRow.add( new UI.Text().setValue( 'Fog' ).setColor( '#666' ) );
  22. fogRow.add( fog );
  23. container.add( fogRow );
  24. //
  25. function updateClearColor() {
  26. signals.clearColorChanged.dispatch( clearColor.getHexValue() );
  27. }
  28. function updateFog() {
  29. console.log( "fog", fog.getValue() );
  30. }
  31. // events
  32. return container;
  33. }
粤ICP备19079148号