Viewport.Shading.js 465 B

123456789101112131415161718192021
  1. import { UISelect } from './libs/ui.js';
  2. function ViewportShading( editor ) {
  3. const select = new UISelect();
  4. select.setPosition( 'absolute' );
  5. select.setRight( '10px' );
  6. select.setTop( '10px' );
  7. select.setOptions( { 'default': 'default', 'normals': 'normals', 'wireframe': 'wireframe' } );
  8. select.setValue( 'default' );
  9. select.onChange( function () {
  10. editor.setViewportShading( this.getValue() );
  11. } );
  12. return select;
  13. }
  14. export { ViewportShading };