BlueGit

timfa frameworkv3

Fixed IE issues, added polyfill for Math.sign

timfa Tim Falken · pushed by timfa

Authored 2017-02-03 · 9 years ago

Hash
f1074bf915eadd1719ff06f7dbba232112020092
Parent
550bd5d2
4 files changed +29 −2
frameworkv3/image.js +4 −1
@@ -1,7 +1,10 @@
1 1 //<DOC> <category> Image
2 2 //<DOC> <function> Constructor: new image(urlToImage, subImages = 1, subImagesPerRow = 1)
3 function image(url, subImgTotal = 1, perRow = 1)
3 function image(url, subImgTotal, perRow)
4 4 {
5 subImgTotal = subImgTotal || 1;
6 perRow = perRow || 1;
7
5 8 //<DOC> <parameter> image.subImages<br><br>The total number of subimages in the image. Defaults to 1.
6 9 this.subImages = subImgTotal;
7 10 //<DOC> <parameter> image.subImagesPerRow<br><br>The total number of subimages per row. Defaults to 1.
@@ -1,7 +1,10 @@
1//<DOC> <category> Image
1//<DOC> <category> Image
2//<DOC> <function> Constructor: new image(urlToImage, subImages = 1, subImagesPerRow = 1)
2//<DOC> <function> Constructor: new image(urlToImage, subImages = 1, subImagesPerRow = 1)
3function image(url, subImgTotal = 1, perRow = 1)
3function image(url, subImgTotal, perRow)
4{
4{
5 subImgTotal = subImgTotal || 1;
6 perRow = perRow || 1;
7
5 //<DOC> <parameter> image.subImages<br><br>The total number of subimages in the image. Defaults to 1.
8 //<DOC> <parameter> image.subImages<br><br>The total number of subimages in the image. Defaults to 1.
6 this.subImages = subImgTotal;
9 this.subImages = subImgTotal;
7 //<DOC> <parameter> image.subImagesPerRow<br><br>The total number of subimages per row. Defaults to 1.
10 //<DOC> <parameter> image.subImagesPerRow<br><br>The total number of subimages per row. Defaults to 1.
frameworkv3/polyfills.js added +9 −0
@@ -0,0 +1,9 @@
1 if (!Math.sign) {
2 Math.sign = function(x) {
3 x = +x; // convert to a number
4 if (x === 0 || isNaN(x)) {
5 return Number(x);
6 }
7 return x > 0 ? 1 : -1;
8 };
9 }
@@ -0,0 +1,9 @@
1if (!Math.sign) {
2 Math.sign = function(x) {
3 x = +x; // convert to a number
4 if (x === 0 || isNaN(x)) {
5 return Number(x);
6 }
7 return x > 0 ? 1 : -1;
8 };
9}
js/framework.js +14 −1
@@ -569,8 +569,11 @@ Math.clamp = function(number, min, max)
569 569
570 570 //<DOC> <category> Image
571 571 //<DOC> <function> Constructor: new image(urlToImage, subImages = 1, subImagesPerRow = 1)
572 function image(url, subImgTotal = 1, perRow = 1)
572 function image(url, subImgTotal, perRow)
573 573 {
574 subImgTotal = subImgTotal || 1;
575 perRow = perRow || 1;
576
574 577 //<DOC> <parameter> image.subImages<br><br>The total number of subimages in the image. Defaults to 1.
575 578 this.subImages = subImgTotal;
576 579 //<DOC> <parameter> image.subImagesPerRow<br><br>The total number of subimages per row. Defaults to 1.
@@ -1154,6 +1157,16 @@ var GameObject =
1154 1157 }
1155 1158 }
1156 1159
1160 if (!Math.sign) {
1161 Math.sign = function(x) {
1162 x = +x; // convert to a number
1163 if (x === 0 || isNaN(x)) {
1164 return Number(x);
1165 }
1166 return x > 0 ? 1 : -1;
1167 };
1168 }
1169
1157 1170 // Basic event listeners, modeled after Phaser Signals
1158 1171
1159 1172 function signal()
@@ -569,8 +569,11 @@ Math.clamp = function(number, min, max)
569
569
570//<DOC> <category> Image
570//<DOC> <category> Image
571//<DOC> <function> Constructor: new image(urlToImage, subImages = 1, subImagesPerRow = 1)
571//<DOC> <function> Constructor: new image(urlToImage, subImages = 1, subImagesPerRow = 1)
572function image(url, subImgTotal = 1, perRow = 1)
572function image(url, subImgTotal, perRow)
573{
573{
574 subImgTotal = subImgTotal || 1;
575 perRow = perRow || 1;
576
574 //<DOC> <parameter> image.subImages<br><br>The total number of subimages in the image. Defaults to 1.
577 //<DOC> <parameter> image.subImages<br><br>The total number of subimages in the image. Defaults to 1.
575 this.subImages = subImgTotal;
578 this.subImages = subImgTotal;
576 //<DOC> <parameter> image.subImagesPerRow<br><br>The total number of subimages per row. Defaults to 1.
579 //<DOC> <parameter> image.subImagesPerRow<br><br>The total number of subimages per row. Defaults to 1.
@@ -1154,6 +1157,16 @@ var GameObject =
1154 }
1157 }
1155}
1158}
1156
1159
1160if (!Math.sign) {
1161 Math.sign = function(x) {
1162 x = +x; // convert to a number
1163 if (x === 0 || isNaN(x)) {
1164 return Number(x);
1165 }
1166 return x > 0 ? 1 : -1;
1167 };
1168}
1169
1157// Basic event listeners, modeled after Phaser Signals
1170// Basic event listeners, modeled after Phaser Signals
1158
1171
1159function signal()
1172function signal()
js/lastbuild.txt +2 −0
@@ -21,3 +21,5 @@
21 21 2017-02-03 16:28
22 22 2017-02-03 16:29
23 23 21:33
24 22:35
25 22:39
@@ -21,3 +21,5 @@
212017-02-03 16:28
212017-02-03 16:28
222017-02-03 16:29
222017-02-03 16:29
23 21:33
23 21:33
24 22:35
25 22:39