diff options
Diffstat (limited to 'js')
42 files changed, 2033 insertions, 506 deletions
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index e9a5f865..0d6defe2 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js | |||
@@ -142,7 +142,7 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
142 | if(m) | 142 | if(m) |
143 | { | 143 | { |
144 | el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(m); | 144 | el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(m); |
145 | color = this.getMaterialColor(value); | 145 | color = this.getMaterialColor(m); |
146 | if(color) | 146 | if(color) |
147 | { | 147 | { |
148 | el.elementModel.shapeModel.GLGeomObj.setStrokeColor(color); | 148 | el.elementModel.shapeModel.GLGeomObj.setStrokeColor(color); |
@@ -156,7 +156,7 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
156 | if(m) | 156 | if(m) |
157 | { | 157 | { |
158 | el.elementModel.shapeModel.GLGeomObj.setFillMaterial(m); | 158 | el.elementModel.shapeModel.GLGeomObj.setFillMaterial(m); |
159 | color = this.getMaterialColor(value); | 159 | color = this.getMaterialColor(m); |
160 | if(color) | 160 | if(color) |
161 | { | 161 | { |
162 | el.elementModel.shapeModel.GLGeomObj.setFillColor(color); | 162 | el.elementModel.shapeModel.GLGeomObj.setFillColor(color); |
@@ -166,10 +166,10 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
166 | } | 166 | } |
167 | break; | 167 | break; |
168 | case "editStrokeMaterial": | 168 | case "editStrokeMaterial": |
169 | NJevent("showMaterialPopup",{materialId : this.getProperty(el, "strokeMaterial")}); | 169 | NJevent("showMaterialPopup",{materialId : this.getProperty(el, "strokeMaterial"), useSelection: true, whichMaterial: 'stroke'}); |
170 | break; | 170 | break; |
171 | case "editFillMaterial": | 171 | case "editFillMaterial": |
172 | NJevent("showMaterialPopup",{materialId : this.getProperty(el, "fillMaterial")}); | 172 | NJevent("showMaterialPopup",{materialId : this.getProperty(el, "fillMaterial"), useSelection: true, whichMaterial: 'fill'}); |
173 | break; | 173 | break; |
174 | case "animate": | 174 | case "animate": |
175 | if(value) | 175 | if(value) |
@@ -750,14 +750,34 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
750 | value: function(m) | 750 | value: function(m) |
751 | { | 751 | { |
752 | var css, | 752 | var css, |
753 | colorObj; | 753 | colorObj, |
754 | if(m === "LinearGradientMaterial") | 754 | c, |
755 | mName = m.getName(); | ||
756 | if(mName === "LinearGradientMaterial") | ||
755 | { | 757 | { |
756 | css = "-webkit-gradient(linear, left top, right top, from(rgb(255, 0, 0)), color-stop(0.3, rgb(0, 255, 0)), color-stop(0.6, rgb(0, 0, 255)), to(rgb(0, 255, 255)))"; | 758 | css = "-webkit-gradient(linear, left top, right top, from("; |
759 | c = this.webGlColorToCss(m, 1); | ||
760 | css += c.rgb + ")"; | ||
761 | c = this.webGlColorToCss(m, 2); | ||
762 | css += ", color-stop(" + c.stop + ", " + c.rgb + ")"; | ||
763 | c = this.webGlColorToCss(m, 3); | ||
764 | css += ", color-stop(" + c.stop + ", " + c.rgb + ")"; | ||
765 | c = this.webGlColorToCss(m, 4); | ||
766 | css += ", to(" + c.rgb + "))"; | ||
767 | // console.log(css); | ||
757 | } | 768 | } |
758 | else if(m === "RadialGradientMaterial") | 769 | else if(mName === "RadialGradientMaterial") |
759 | { | 770 | { |
760 | css = "-webkit-radial-gradient(50% 50%, ellipse cover, rgb(255, 0, 0) 0%, rgb(0, 255, 0) 30%, rgb(0, 0, 255) 60%, rgb(0, 255, 255) 100%)"; | 771 | css = "-webkit-radial-gradient(50% 50%, ellipse cover, "; |
772 | c = this.webGlColorToCss(m, 1); | ||
773 | css += c.rgb + " " + c.stop*100 + "%"; | ||
774 | c = this.webGlColorToCss(m, 2); | ||
775 | css += c.rgb + " " + c.stop*100 + "%"; | ||
776 | c = this.webGlColorToCss(m, 3); | ||
777 | css += c.rgb + " " + c.stop*100 + "%"; | ||
778 | c = this.webGlColorToCss(m, 4); | ||
779 | css += c.rgb + " " + c.stop*100 + "%)"; | ||
780 | // console.log(css); | ||
761 | } | 781 | } |
762 | 782 | ||
763 | if(css) | 783 | if(css) |
@@ -771,6 +791,18 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
771 | 791 | ||
772 | return null; | 792 | return null; |
773 | } | 793 | } |
794 | }, | ||
795 | |||
796 | webGlColorToCss: { | ||
797 | value: function(m, index) | ||
798 | { | ||
799 | var color, rgba, cStop; | ||
800 | color = m["getColor" + index](); | ||
801 | rgba = 'rgba(' + color[0]*255 + ',' + color[1]*255 + ',' + color[2]*255 + ',' + color[3] + ')'; | ||
802 | cStop = m["getColorStop" + index](); | ||
803 | |||
804 | return {rgb:rgba, stop: cStop}; | ||
805 | } | ||
774 | } | 806 | } |
775 | 807 | ||
776 | }); | 808 | }); |
diff --git a/js/helper-classes/RDGE/src/tools/compile-rdge-core.bat b/js/helper-classes/RDGE/src/tools/compile-rdge-core.bat deleted file mode 100644 index 50a9a460..00000000 --- a/js/helper-classes/RDGE/src/tools/compile-rdge-core.bat +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | java -jar ./compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS --manage_closure_dependencies --js ../core/script/math/vec2.js --js ../core/script/math/vec3.js --js ../core/script/math/vec4.js --js ../core/script/math/mat4.js --js ../core/script/math/quat.js --js ../core/script/objectManager.js --js ../core/script/precompiled.js --js ../core/script/renderer.js --js ../core/script/renderUtils.js --js ../core/script/jshader.js --js ../core/script/jpass.js --js ../core/script/RenderProcs.js --js ../core/script/RenderInitProcs.js --js ../core/script/MeshManager.js --js ../core/script/ShaderManager.js --js ../core/script/ScreenQuad.js --js ../core/script/box.js --js ../core/script/camera.js --js ../core/script/shadowLight.js --js ../core/script/utilities.js --js ../core/script/engine.js --js ../core/script/scenegraphNodes.js --js ../core/script/scenegraph.js --js ../core/script/lightmanager.js --js ../core/script/rendercontext.js --js ../core/script/particle.js --js ../core/script/run_state.js --js ../core/script/init_state.js --js ../core/script/runtime.js --js_output_file ../../rdge-compiled.js | ||
diff --git a/js/helper-classes/RDGE/src/tools/compile-rdge-core.sh b/js/helper-classes/RDGE/src/tools/compile-rdge-core.sh deleted file mode 100644 index ed6d521a..00000000 --- a/js/helper-classes/RDGE/src/tools/compile-rdge-core.sh +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | java -jar ./compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS --manage_closure_dependencies --js ../core/script/math/vec2.js --js ../core/script/math/vec3.js --js ../core/script/math/vec4.js --js ../core/script/math/mat4.js --js ../core/script/math/quat.js --js ../core/script/objectManager.js --js ../core/script/precompiled.js --js ../core/script/renderer.js --js ../core/script/renderUtils.js --js ../core/script/jshader.js --js ../core/script/jpass.js --js ../core/script/RenderProcs.js --js ../core/script/RenderInitProcs.js --js ../core/script/MeshManager.js --js ../core/script/ShaderManager.js --js ../core/script/ScreenQuad.js --js ../core/script/box.js --js ../core/script/camera.js --js ../core/script/shadowLight.js --js ../core/script/utilities.js --js ../core/script/engine.js --js ../core/script/scenegraphNodes.js --js ../core/script/scenegraph.js --js ../core/script/lightmanager.js --js ../core/script/rendercontext.js --js ../core/script/particle.js --js ../core/script/run_state.js --js ../core/script/init_state.js --js ../core/script/runtime.js --js_output_file rdge-compiled.js | ||
diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js index 0dde9af4..b46a002b 100755 --- a/js/lib/drawing/world.js +++ b/js/lib/drawing/world.js | |||
@@ -29,13 +29,20 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) { | |||
29 | } | 29 | } |
30 | 30 | ||
31 | this._canvas = canvas; | 31 | this._canvas = canvas; |
32 | if (this._useWebGL) { | 32 | if (this._useWebGL) |
33 | if(preserveDrawingBuffer) { | 33 | { |
34 | preserveDrawingBuffer = true; | ||
35 | if(preserveDrawingBuffer) | ||
36 | { | ||
34 | this._glContext = canvas.getContext("experimental-webgl", {preserveDrawingBuffer: true}); | 37 | this._glContext = canvas.getContext("experimental-webgl", {preserveDrawingBuffer: true}); |
35 | } else { | 38 | } |
39 | else | ||
40 | { | ||
36 | this._glContext = canvas.getContext("experimental-webgl"); | 41 | this._glContext = canvas.getContext("experimental-webgl"); |
37 | } | 42 | } |
38 | } else { | 43 | } |
44 | else | ||
45 | { | ||
39 | this._2DContext = canvas.getContext( "2d" ); | 46 | this._2DContext = canvas.getContext( "2d" ); |
40 | } | 47 | } |
41 | 48 | ||
@@ -72,11 +79,15 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) { | |||
72 | this._firstRender = true; | 79 | this._firstRender = true; |
73 | 80 | ||