Texture class

Create a texture to apply to a surface or as a reflection or refraction map.

Note: After the initial use of a texture, its dimensions, format, and type cannot be changed. Instead, call dispose on the texture and instantiate a new one.

// load a texture, set wrap mode to repeat
final texture = TextureLoader().fromAsset( "textures/water.jpg" );
texture.wrapS = RepeatWrapping;
texture.wrapT = RepeatWrapping;
texture.repeat.setValues( 4, 4 );
Mixed-in types
Implementers

Constructors

Texture([dynamic image, int? mapping, int? wrapS, int? wrapT, int? magFilter, int? minFilter, int? format, int? type, int? anisotropy, String? colorSpace])
Texture.fromJson(Map<String, dynamic> json, dynamic image)

Properties

anisotropy ↔ int
getter/setter pair
center ↔ Vector2
getter/setter pair
channel ↔ int
getter/setter pair
colorSpace ↔ String
getter/setter pair
flipY ↔ bool
getter/setter pair
format ↔ int
getter/setter pair
generateMipmaps ↔ bool
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
id ↔ int
getter/setter pair
image ↔ dynamic
getter/setter pair
internalFormat ↔ int?
getter/setter pair
isCompressedTexture ↔ bool
getter/setter pair
isDepthTexture ↔ bool
getter/setter pair
isOpenGLTexture ↔ bool
getter/setter pair
isRenderTargetTexture ↔ bool
getter/setter pair
isTexture ↔ bool
getter/setter pair
isVideoTexture ↔ bool
getter/setter pair
isWebGLRenderTarget ↔ bool
getter/setter pair
layerUpdates ↔ Set
getter/setter pair
magFilter ↔ int
getter/setter pair
mapping ↔ int?
getter/setter pair
matrix ↔ Matrix3
getter/setter pair
matrixAutoUpdate ↔ bool
getter/setter pair
minFilter ↔ int
getter/setter pair
mipmaps ↔ List
getter/setter pair
name ↔ String
getter/setter pair
needsPMREMUpdate ← bool
no getter
needsUpdate ← bool
no getter
offset ↔ Vector2
getter/setter pair
onUpdate ↔ Function?
getter/setter pair
pmremVersion ↔ int
getter/setter pair
premultiplyAlpha ↔ bool
getter/setter pair
renderTarget ↔ BaseRenderTarget?
getter/setter pair
repeat ↔ Vector2
getter/setter pair
rotation ↔ double
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
source ↔ Source
getter/setter pair
type ↔ int
getter/setter pair
unpackAlignment ↔ int
getter/setter pair
updateRanges ↔ List<TextureRangeInfo>
getter/setter pair
userData ↔ Map
getter/setter pair
uuid ↔ String
getter/setter pair
version ↔ int
getter/setter pair
wrapR ↔ int
getter/setter pair
wrapS ↔ int
getter/setter pair
wrapT ↔ int
getter/setter pair

Methods

addEventListener(String type, Function listener) → void
type - The type of event to listen to.
inherited
addLayerUpdate(dynamic layerIndex) → void
addUpdateRange(dynamic start, dynamic count) → void
clearLayerUpdates() → void
clearListeners() → void
Remove all Listeners.
inherited
clearUpdateRanges() → void
clone() → Texture
copy(Texture source) → Texture
dispatchEvent(Event event) → void
event - The event that gets fired.
inherited
dispose() → void
override
hasEventListener(String type, Function listener) → bool
type - The type of event to listen to.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeEventListener(String type, Function listener) → void
type - The type of the listener that gets removed.
inherited
toJson(dynamic meta) → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited
transformUv(Vector2 uv) → Vector2
updateMatrix() → void

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

defaultImage ↔ String?
getter/setter pair
defaultMapping ↔ int
getter/setter pair