FloatEditor.js 460 B

1234567891011121314151617181920212223
  1. import { NumberInput, Element } from '../../libs/flow.module.js';
  2. import { BaseNode } from '../core/BaseNode.js';
  3. import { UniformNode } from 'three/nodes';
  4. export class FloatEditor extends BaseNode {
  5. constructor() {
  6. const node = new UniformNode( 0 );
  7. super( 'Float', 1, node, 150 );
  8. const field = new NumberInput().setTagColor( 'red' ).onChange( () => {
  9. node.value = field.getValue();
  10. } );
  11. this.add( new Element().add( field ) );
  12. }
  13. }