texture property

Texture? get texture

Implementation

Texture? get texture => this.uniforms['projectedTexture']['value'];
set texture (Texture? texture)

Implementation

set texture(Texture? texture) {
  this.uniforms['projectedTexture']['value'] = texture;
  this.uniforms['isTextureLoaded']['value'] = texture?.image != null;

  if (this.uniforms['isTextureLoaded']['value'] == null) {
    print('Texture not loaded');
    ProjectedMaterialUtils.addLoadListener(texture!, (t){
      this.uniforms['isTextureLoaded']['value'] = true;
      this.dispatchEvent(Event(type: 'textureload'));
      _saveDimensions();
    });
  }
  else {
    print('Texture loaded');
    _saveDimensions();
  }
}