Texture Class
Module: start
Texture class
Constructor
Texture
()
Methods
Atlas
(
static
-
srcImage -
srcJSON -
options
Creates a texture atlas
Parameters:
-
srcImageStringimage file name
-
srcJSONStringJSON file name
-
optionsDict
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:
-
blobStringimage blov
-
optionsDict
fromCube
(
-
srcs -
options
Creates a texture cube image files
Parameters:
-
srcsStringarray to 6 path to image files
-
optionsDict
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:
-
srcStringpath to image file
-
optionsDict
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
Docs for Version: 1.0a