From cad4d6cb3f667f6174ec05cecead675b244285b9 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Mon, 5 Mar 2012 04:51:31 -0800 Subject: Added more materials/canvas2D drawing to runtime. --- js/helper-classes/RDGE/runtime/RuntimeGeomObj.js | 27 +++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'js/helper-classes/RDGE/runtime/RuntimeGeomObj.js') diff --git a/js/helper-classes/RDGE/runtime/RuntimeGeomObj.js b/js/helper-classes/RDGE/runtime/RuntimeGeomObj.js index da941b56..2539abc1 100644 --- a/js/helper-classes/RDGE/runtime/RuntimeGeomObj.js +++ b/js/helper-classes/RDGE/runtime/RuntimeGeomObj.js @@ -37,7 +37,10 @@ function RuntimeGeomObj() // Property accessors /////////////////////////////////////////////////////////////////////// - this.geomType = function() { return this.GEOM_TYPE_UNDEFINED; } + this.geomType = function() { return this.GEOM_TYPE_UNDEFINED; } + + this.setWorld = function(w) { this._world = w; } + this.getWorld = function() { return this._world; } /////////////////////////////////////////////////////////////////////// // Methods @@ -76,8 +79,22 @@ function RuntimeGeomObj() var materialType = getPropertyFromString( "material: ", importStr ); switch (materialType) { - case "flat": mat = new RuntimeFlatMaterial(); break; - case "pulse": mat = new RuntimePulseMaterial(); break; + case "flat": mat = new RuntimeFlatMaterial(); break; + + case "radialGradient": + case "linearGradient": mat = new RuntimeLinearGradientMaterial(); break; + + case "water": + case "tunnel": + case "reliefTunnel": + case "squareTunnel": + case "twist": + case "fly": + case "julia": + case "mandel": + case "star": + case "zinvert": + case "pulse": mat = new RuntimePulseMaterial(); break; default: console.log( "material type: " + materialType + " is not supported" ); @@ -146,8 +163,8 @@ function RuntimeRectangle() { // various declarations var pt, rad, ctr, startPt, bPts; - var width = Math.round(this.getWidth()), - height = Math.round(this.getHeight()); + var width = Math.round(this._width), + height = Math.round(this._height); pt = [inset, inset]; // top left corner -- cgit v1.2.3