Being quite new to TypeScript, I just ran into this issue:
The doc suggests that a diffuse texture’s offset can be modified like this:
myMaterial.diffuseTexture.uOffset = 1.5;
- Solution 1:
(myMaterial.diffuseTexture.uOffset as Texture).uOffset = 1.5;
- Solution 2:
const myDiffuseTexture = new Texture(...); myDiffuseTexture.uOffset = 1.5; myMaterial.diffuseTexture = myDiffuseTexture;
As there are a few forum questions regarding just this, I was considering adding a small comment to the doc. But maybe I just hit the tip of the iceberg and there are 100’s of similar examples scattered through the doc? In that case a general warning for TypeScript users early in the doc might be more effective.
What do you think?