Docs for Version: 1.0a
Show:
Module: start

Texture class

Constructor

Texture

()

Item Index

Methods

Methods

Atlas

(
  • srcImage
  • srcJSON
  • options
)
static

Creates a texture atlas

Parameters:

  • srcImage String

    image file name

  • srcJSON String

    JSON file name

  • options Dict

Example:

 var imageAtlas = Texture.Atlas("map.png","map.json")
                                             var image = Texture.fromAtlas(imageAtlas,"foot.png")
                                             podstawaMat = new Material({color: [0.3,0.9,0.9]})
                                            

var tat = Texture.Atlas("into.png","into.json") podstawaMat.setTexture("diffuse",tat,"tap to play.png")

fromBlob

(
  • blob
  • options
)

Creates a texture from image blob

Parameters:

  • blob String

    image blov

  • options Dict

fromCube

(
  • srcs
  • options
)

Creates a texture cube image files

Parameters:

  • srcs String

    array to 6 path to image files

  • options Dict

Example:

 var imageSuper = Texture.fromCube(["cube1.png",
                                                                                "cube2.png",
                                                                                "cube3.png",
                                                                                "cube4.png",
                                                                                "cube5.png",
                                                                                "cube6.png"],{})

fromImage

(
  • src
  • options
)

Creates a texture from image file

Parameters:

  • src String

    path to image file

  • options Dict

Example:

 var imageSuper = Texture.fromImage("img/imgsuper.png",{
                                                 wrap: gl.CLAMP_TO_EDGE,
                                                 filter: gl.LINEAR_MIPMAP_LINEAR
                                             })
 var imageSuper = Texture.fromImage("img/imgsuper.png",{
                                                 wrap: gl.REPEAT,
                                                 filter: gl.LINEAR
                                             })

glStart()

() static

Starts webgl