Update: CC - Bacon - Entity Loaded (8ia8dlk7l5.js) 1098 bytes modified
parent
63cd324284
commit
65f73d99b7
|
@ -1484,41 +1484,79 @@ GameLib.CustomCode.prototype.clearGrid = function() {
|
||||||
|
|
||||||
GameLib.CustomCode.prototype.createTile = function(tileName, imageName, displace) {
|
GameLib.CustomCode.prototype.createTile = function(tileName, imageName, displace) {
|
||||||
|
|
||||||
var material = null;
|
var apiMaterial;
|
||||||
var apiMaterial = {};
|
|
||||||
|
|
||||||
if (imageName) {
|
if (imageName) {
|
||||||
|
|
||||||
apiMaterial.diffuseMap = new GameLib.D3.Texture.Image(
|
|
||||||
this.graphics,
|
|
||||||
{
|
|
||||||
image : this[imageName]
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
if (displace) {
|
if (displace) {
|
||||||
apiMaterial.displacementMap = this.textureDisplacement;
|
apiMaterial = new GameLib.D3.API.Material.Phong(
|
||||||
}
|
null,
|
||||||
|
null,
|
||||||
material = new GameLib.D3.Material.Phong(
|
null,
|
||||||
this.graphics,
|
null,
|
||||||
apiMaterial
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
this.textureDisplacement,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
new GameLib.D3.API.Texture.Image(
|
||||||
|
null,
|
||||||
|
this[imageName]
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
apiMaterial = new GameLib.D3.API.Material.Phong(
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
new GameLib.D3.API.Texture.Image(
|
||||||
|
null,
|
||||||
|
this[imageName]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
apiMaterial = new GameLib.D3.API.Material.Phong();
|
||||||
|
}
|
||||||
|
|
||||||
this[tileName] = new GameLib.D3.Mesh(
|
this[tileName] = new GameLib.D3.Mesh(
|
||||||
this.graphics,
|
this.graphics,
|
||||||
{
|
new GameLib.D3.API.Mesh(
|
||||||
geometry : {
|
null,
|
||||||
componentType : GameLib.Component.GEOMETRY_BUFFER_PLANE,
|
new GameLib.D3.API.Geometry.Buffer.Plane(
|
||||||
width : 1,
|
null,
|
||||||
height : 1,
|
1,
|
||||||
widthSegments : 10,
|
1,
|
||||||
heightSegments : 10
|
10,
|
||||||
},
|
10
|
||||||
parentScene : this.scene,
|
),
|
||||||
materials : [material]
|
[
|
||||||
}
|
apiMaterial
|
||||||
|
],
|
||||||
|
null,
|
||||||
|
this.scene
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
this[tileName].visible = false;
|
this[tileName].visible = false;
|
||||||
|
|
Loading…
Reference in New Issue