# new Texture()
- Source:
Extends
Members
# (static) ALPHA :number
- Source:
Type:
- number
# (static) BYTE :number
- Source:
Type:
- number
# (static) CLAMP_TO_EDGE :number
- Source:
Type:
- number
# (static) DEPTH_COMPONENT :number
- Source:
Type:
- number
# (static) DEPTH_STENCIL :number
- Source:
Type:
- number
# (static) FLOAT :number
- Source:
Type:
- number
# (static) HALF_FLOAT :number
- Source:
Type:
- number
# (static) INT :number
- Source:
Type:
- number
# (static) LINEAR :number
- Source:
Type:
- number
# (static) LINEAR_MIPMAP_LINEAR :number
- Source:
Type:
- number
# (static) LINEAR_MIPMAP_NEAREST :number
- Source:
Type:
- number
# (static) LUMINANCE :number
- Source:
Type:
- number
# (static) LUMINANCE_ALPHA :number
- Source:
Type:
- number
# (static) MIRRORED_REPEAT :number
- Source:
Type:
- number
# (static) NEAREST :number
- Source:
Type:
- number
# (static) NEAREST_MIPMAP_LINEAR :number
- Source:
Type:
- number
# (static) NEAREST_MIPMAP_NEAREST :number
- Source:
Type:
- number
# (static) REPEAT :number
- Source:
Type:
- number
# (static) RGB :number
- Source:
Type:
- number
# (static) RGBA :number
- Source:
Type:
- number
# (static) SHORT :number
- Source:
Type:
- number
# (static) SRGB :number
Type:
- number
# (static) SRGB_ALPHA :number
Type:
- number
# (static) UNSIGNED_BYTE :number
- Source:
Type:
- number
# (static) UNSIGNED_INT :number
- Source:
Type:
- number
# (static) UNSIGNED_INT_24_8_WEBGL :number
- Source:
UNSIGNED_INT_24_8_WEBGL for WEBGL_depth_texture extension
Type:
- number
# (static) UNSIGNED_SHORT :number
- Source:
Type:
- number
# __uid__ :number
- Source:
- Inherited From:
Type:
- number
# anisotropic :number
- Source:
- See:
Anisotropic filtering, enabled if value is larger than 1
Type:
- number
# dynamic :boolean
- Source:
Dynamic option for texture like video
Type:
- boolean
# flipY :boolean
- Source:
- Default Value:
- true
If flip in y axis for given image source
Type:
- boolean
# format :number
- Source:
Format of texel data Possible values:
Type:
- number
# height :number
- Source:
Texture height, readonly when the texture source is image
Type:
- number
# magFilter :number
- Source:
Possible values:
Type:
- number
# minFilter :number
- Source:
Possible values:
Type:
- number
# premultiplyAlpha :boolean
- Source:
- Default Value:
- false
Type:
- boolean
# sRGB
- Source:
A flag to indicate if texture source is sRGB
# type :number
- Source:
Texel data type. Possible values:
Type:
- number
# unpackAlignment :number
- Source:
- Default Value:
- 4
Type:
- number
# useMipmap :boolean
- Source:
If enable mimap.
Type:
- boolean
# width :number
- Source:
Texture width, readonly when the texture source is image
Type:
- number
# wrapS :number
- Source:
Texture wrap. Default to be REPEAT. Possible values:
Type:
- number
# wrapT :number
- Source:
Texture wrap. Default to be REPEAT. Possible values:
Type:
- number
Methods
# after(name, action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Alias of once('after' + name)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | ||
action |
function | ||
context |
Object |
<optional> |
# before(name, action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Alias of once('before' + name)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | ||
action |
function | ||
context |
Object |
<optional> |
# dirty()
- Source:
Mark texture is dirty and update in the next frame
# dispose(renderer)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
renderer |
clay.Renderer |
# error(action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Alias of on('error')
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
action |
function | ||
context |
Object |
<optional> |
# has(name, action) → {boolean}
- Source:
- Inherited From:
- Mixes In:
If registered the event handler
Parameters:
Name | Type | Description |
---|---|---|
name |
string | |
action |
function |
Returns:
- Type
- boolean
# isPowerOfTwo() → {boolean}
- Source:
Test if texture size is power of two
Returns:
- Type
- boolean
# isRenderable() → {boolean}
- Source:
Test if image of texture is valid and loaded.
Returns:
- Type
- boolean
# off(action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Remove event listener
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
action |
function | ||
context |
Object |
<optional> |
# on(name, action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Register event handler
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | ||
action |
function | ||
context |
Object |
<optional> |
# once(name, action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Register event, event will only be triggered once and then removed
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | ||
action |
function | ||
context |
Object |
<optional> |
# success(action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Alias of on('success')
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
action |
function | ||
context |
Object |
<optional> |
# trigger(name)
- Source:
- Inherited From:
- Mixes In:
Trigger event
Parameters:
Name | Type | Description |
---|---|---|
name |
string |