.. role:: clio-static
   :class: clio-flag clio-flag-static


#######
Texture
#######

.. js:class:: cee.Texture

   Factory for creating texture objects
   
   
   Index
   =====
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~static cee.Texture.fromHTMLImageElement`
   * :js:meth:`~static cee.Texture.fromImageData`
   
   



.. rst-class:: kind-group kind-methods

.. rubric:: Methods
   :class: kind-group-title


.. js:method:: static cee.Texture.fromHTMLImageElement

      .. rst-class:: clio-flags
      
         :clio-static:`static`
      
      .. rst-class:: sig-pretty-signature
      
         | fromHTMLImageElement(**htmlImageElement**\ : *HTMLImageElement*\ , **textureOptions**\ : :js:class:`TextureOptions <cee.TextureOptions>`\ ): :js:class:`Texture <cee.Texture>`
      
      Creates a texture image object from an HTMLImageElement
      
      **Note:** A general rule is that both dimensions must be a power of two.
      
      To avoid this limitation, pass in texture options with generateMipmaps set to false, wrapMode set to TextureWrapMode.CLAMP_TO_EDGE and minFilter set to LINEAR or NEAREST. E.g.:
      
      .. code-block:: javascript
      
         const texture = cee.Texture.fromImageData(imageData, 
             { generateMipmaps: false, 
               wrapMode: cee.TextureWrapMode.CLAMP_TO_EDGE, 
               minFilter: cee.TextureMinFilter.LINEAR 
             });  
      
      **Parameters**
      
      
         **htmlImageElement**\ : *HTMLImageElement*
      
         **textureOptions**\ : :js:class:`TextureOptions <cee.TextureOptions>`
      
      
      **Returns**\ : :js:class:`Texture <cee.Texture>`
      



.. js:method:: static cee.Texture.fromImageData

      .. rst-class:: clio-flags
      
         :clio-static:`static`
      
      .. rst-class:: sig-pretty-signature
      
         | fromImageData(**imageData**\ : *ImageData*\ , **textureOptions**\ : :js:class:`TextureOptions <cee.TextureOptions>`\ ): :js:class:`Texture <cee.Texture>`
      
      Creates a texture image object from ImageData
      
      **Note:** A general rule is that both dimensions must be a power of two.
      
      To avoid this limitation, pass in texture options with generateMipmaps set to false, wrapMode set to TextureWrapMode.CLAMP_TO_EDGE and minFilter set to LINEAR or NEAREST. E.g.:
      
      .. code-block:: javascript
      
         const texture = cee.Texture.fromImageData(imageData, 
             { generateMipmaps: false, 
               wrapMode: cee.TextureWrapMode.CLAMP_TO_EDGE, 
               minFilter: cee.TextureMinFilter.LINEAR 
             });  
      
      **Parameters**
      
      
         **imageData**\ : *ImageData*
      
         **textureOptions**\ : :js:class:`TextureOptions <cee.TextureOptions>`
      
      
      **Returns**\ : :js:class:`Texture <cee.Texture>`
      




