import * as React from "react"; import { Texture, Observable } from "babylonjs"; import { PropertyChangedEvent } from "../../../../propertyChangedEvent"; import { LineContainerComponent } from "../../../lineContainerComponent"; import { SliderLineComponent } from "../../../lines/sliderLineComponent"; import { TextLineComponent } from "../../../lines/textLineComponent"; import { CheckBoxLineComponent } from "../../../lines/checkBoxLineComponent"; import { TextureLineComponent } from "../../../lines/textureLineComponent"; import { FloatLineComponent } from "../../../lines/floatLineComponent"; import { AdvancedDynamicTexture } from "babylonjs-gui"; import { OptionsLineComponent } from "../../../lines/optionsLineComponent"; interface ITexturePropertyGridComponentProps { texture: Texture, onPropertyChangedObservable?: Observable } export class TexturePropertyGridComponent extends React.Component { constructor(props: ITexturePropertyGridComponentProps) { super(props); } render() { const texture = this.props.texture; const adtTexture = texture instanceof AdvancedDynamicTexture ? texture as AdvancedDynamicTexture : null; var samplingMode = [ { label: "Nearest", value: BABYLON.Texture.NEAREST_NEAREST }, { label: "Nearest & linear mip", value: BABYLON.Texture.NEAREST_LINEAR }, { label: "Linear", value: BABYLON.Texture.LINEAR_LINEAR_MIPLINEAR }, ]; return (
{ texture.updateSamplingMode && texture.updateSamplingMode(value)} /> } { adtTexture && } texture.wrapU === BABYLON.Texture.CLAMP_ADDRESSMODE} onSelect={(value) => texture.wrapU = value ? BABYLON.Texture.CLAMP_ADDRESSMODE : BABYLON.Texture.WRAP_ADDRESSMODE} /> texture.wrapV === BABYLON.Texture.CLAMP_ADDRESSMODE} onSelect={(value) => texture.wrapV = value ? BABYLON.Texture.CLAMP_ADDRESSMODE : BABYLON.Texture.WRAP_ADDRESSMODE} />
); } }