Texture Class
Module: start
Texture class
Constructor
Texture
()
Methods
Atlas
(
static
-
srcImage
-
srcJSON
-
options
Creates a texture atlas
Parameters:
-
srcImage
Stringimage file name
-
srcJSON
StringJSON 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
Stringimage blov
-
options
Dict
fromCube
(
-
srcs
-
options
Creates a texture cube image files
Parameters:
-
srcs
Stringarray 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
Stringpath 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