Constructor
new CubeTexture(param)
The cube texture that load image resource and use by style.
Parameters:
Name | Type | Description |
---|---|---|
param |
Object | The initial parameters. |
- Source:
Example
// Create cube texture from cube map images
let cubeTexture = new THING.CubeTexture([
'./skyboxes/bluesky/posx.jpg', './skyboxes/bluesky/negx.jpg',
'./skyboxes/bluesky/posy.jpg', './skyboxes/bluesky/negy.jpg',
'./skyboxes/bluesky/posz.jpg', './skyboxes/bluesky/negz.jpg'
]);
// Create cube texture
let cubeTexture = new THING.CubeTexture({
url:{
negx: './images/Night/negx.jpg', // 左
negy: './images/Night/negy.jpg', // 下
negz: './images/Night/negz.jpg', // 前
posx: './images/Night/posx.jpg', // 右
posy: './images/Night/posy.jpg', // 上
posz: './images/Night/posz.jpg' // 后
}
});
// Create cube texture from folder path
let cubeTexture = new THING.CubeTexture({
url: './images/Night/?png'
}};
Extends
Members
anisotropy :Number
Get/Set the anisotropy.
Type:
- Number
- Overrides:
- Source:
colorFormat :Number
Get/Set the color format.
Type:
- Number
- Overrides:
- Source:
encoding :ImageEncodingType
Get/Set the encoding.
Type:
- Overrides:
- Source:
flipY :Boolean
Enable/Disable flipY.
Type:
- Boolean
- Overrides:
- Source:
generateMipmaps :Boolean
Enable/Disable generate mipmaps.
Type:
- Boolean
- Overrides:
- Source:
isCubeTexture :Boolean
Check class type.
Type:
- Boolean
- Source:
Example
if (texture.isCubeTexture) {
console.log(`It's cube texture`);
}
loaded :Boolean
Get the loaded flag.
Type:
- Boolean
- Overrides:
- Source:
magFilterType :ImageFilterType
Get/Set the mag filter type.
Type:
- Overrides:
- Source:
mappingType :ImageMappingType
Get/Set the mappingType type.
Type:
- Overrides:
- Source:
minFilterType :ImageFilterType
Get/Set the min filter type.
Type:
- Overrides:
- Source:
premultiplyAlpha :Boolean
Enable/Disable premultiply alpha.
Type:
- Boolean
- Overrides:
- Source:
url :String
Get/Set url.
Type:
- String
- Overrides:
- Source:
uuid :String
Get the unique ID.
Type:
- String
- Overrides:
- Source:
wrapType :ImageWrapType
Get/Set the wrapping behavior for the both S and T texture coordinates.
Type:
- Overrides:
- Source:
wrapTypeS :ImageWrapType
Get/Set the wrapping behavior for the S texture coordinate.
Type:
- Overrides:
- Source:
wrapTypeT :ImageWrapType
Get/Set the wrapping behavior for the T texture coordinate.
Type:
- Overrides:
- Source:
Methods
waitForComplete() → {Promise.<any>}
Wait for object load completed.
- Overrides:
- Source:
Returns:
- Type
- Promise.<any>