Texture class
class Texture { int id; var image; var mapping; //UVMapping appears to be missing.. int wrapS, wrapT, magFilter, minFilter, format, type, anisotropy; Vector2 offset, repeat; bool generateMipmaps; bool premultiplyAlpha; bool needsUpdate; var onUpdate; bool flipY; int unpackAlignment = 4; // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml) List mipmaps = []; //TODO: resolve dynamic vars, find out what UVMapping is! Texture( [ this.image, this.mapping = null, this.wrapS = ClampToEdgeWrapping, this.wrapT = ClampToEdgeWrapping, this.magFilter = LinearFilter, this.minFilter = LinearMipMapLinearFilter, this.format = RGBAFormat, this.type = UnsignedByteType, this.anisotropy = 1] ) { id = TextureCount ++; this.mapping = mapping != null ? mapping : new UVMapping(); offset = new Vector2.zero(); repeat = new Vector2( 1.0, 1.0 ); generateMipmaps = true; premultiplyAlpha = false; flipY = true; needsUpdate = false; onUpdate = null; } Texture clone() { Texture clonedTexture = new Texture( image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); clonedTexture.mipmaps = new List.from( mipmaps ); clonedTexture.offset.setFrom( offset ); clonedTexture.repeat.setFrom( repeat ); return clonedTexture; } // Quick hack to allow setting new properties (used by the renderer) Map __data; get _data { if (__data == null) { __data = {}; } return __data; } operator [] (String key) => _data[key]; operator []= (String key, value) => _data[key] = value; }
Subclasses
CompressedTexture, DataTexture, WebGLRenderTarget
Constructors
new Texture([image, mapping = null, int wrapS = ClampToEdgeWrapping, int wrapT = ClampToEdgeWrapping, int magFilter = LinearFilter, int minFilter = LinearMipMapLinearFilter, int format = RGBAFormat, int type = UnsignedByteType, int anisotropy = 1]) #
Creates a new Object instance.
Object instances have no meaningful state, and are only useful through their identity. An Object instance is equal to itself only.
docs inherited from Object
Texture( [ this.image, this.mapping = null, this.wrapS = ClampToEdgeWrapping, this.wrapT = ClampToEdgeWrapping, this.magFilter = LinearFilter, this.minFilter = LinearMipMapLinearFilter, this.format = RGBAFormat, this.type = UnsignedByteType, this.anisotropy = 1] ) { id = TextureCount ++; this.mapping = mapping != null ? mapping : new UVMapping(); offset = new Vector2.zero(); repeat = new Vector2( 1.0, 1.0 ); generateMipmaps = true; premultiplyAlpha = false; flipY = true; needsUpdate = false; onUpdate = null; }
Operators
Methods
Texture clone() #
Texture clone() { Texture clonedTexture = new Texture( image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); clonedTexture.mipmaps = new List.from( mipmaps ); clonedTexture.offset.setFrom( offset ); clonedTexture.repeat.setFrom( repeat ); return clonedTexture; }