Texture Class

Extends Texture
Module: Textures

Image texture constructor, with support for GIF animations.

It is based on THREE.Texture, original documentation can be found here https://threejs.org/docs/index.html#Reference/Textures/Texture

Constructor

Texture

(
  • image
  • mapping
  • wrapS
  • wrapT
  • magFilter
  • minFilter
  • format
  • type
  • anisotropy
  • encoding
)

Parameters:

  • image Image
  • mapping Number
  • wrapS Number
  • wrapT Number
  • magFilter Number
  • minFilter Number
  • format Number
  • type Number
  • anisotropy Number
  • encoding Number

Methods

dispose

()

Dispose texture.

toJSON

(
  • meta
)

Create JSON description for texture, serializes image used in the texture THREE.Texture serialization is different inside nunuStudio, the THREE.Texture class does not serialize any image data.

Parameters:

  • meta Object

Properties

center

Vector2

Indicates where the center of rotation is. To rotate around the center point set this value to (0.5, 0.5).

disposed

Boolean

Flag used to know is the texture has been disposed.

Is used to control animation when using a gif as a texture.

Default: false

flipY

Boolean

Flips the image's Y axis to match the WebGL texture coordinate space.

image

DOM

DOM element attached to the texture

img

Image

Image attached to the texture

mipmaps

Array

Array of user-specified mipmaps (optional).

name

String

Name of the texture

Default: "texture"

name

String

Name of the texture (doesn't need to be unique).

offset

Vector2

How much a single repetition of the texture is offset from the beginning, in each direction U and V.

premultiplyAlpha

Boolean

False by default, which is the norm for PNG images. Set to true if the RGB values have been stored premultiplied by alpha.

repeat

Vector2

How many times the texture is repeated across the surface, in each direction U and V. If repeat is set greater than 1 in either direction, the corresponding Wrap parameter should also be set to .

rotation

Number

How much the texture is rotated around the center point, in radians. Postive values are counter-clockwise.

Default: 0

uuid

String

UUID of this object instance. This gets automatically assigned, so this shouldn't be edited.