test code to check for font load
This commit is contained in:
parent
18cf0704f5
commit
5c9cc8d82b
19
cat.html
19
cat.html
|
@ -1259,6 +1259,19 @@ var game = {
|
||||||
return this.rng.rndrange(min, max);
|
return this.rng.rndrange(min, max);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
isfontloaded : function() {
|
||||||
|
var tempctx = this.stargoalbanner.getContext("2d");
|
||||||
|
var size;
|
||||||
|
tempctx.font = "50 pt " + FONT;
|
||||||
|
size = tempctx.measureText("wwwww").width;
|
||||||
|
console.log(size);
|
||||||
|
|
||||||
|
if (size >= 36) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
addfireworks : function() {
|
addfireworks : function() {
|
||||||
var delay = 0;
|
var delay = 0;
|
||||||
for (i = 0; i < FIREWORKCOUNT; i++) {
|
for (i = 0; i < FIREWORKCOUNT; i++) {
|
||||||
|
@ -1343,6 +1356,7 @@ var game = {
|
||||||
//this.canvas = document.createElement("canvas");
|
//this.canvas = document.createElement("canvas");
|
||||||
this.canvas = document.getElementsByTagName('canvas')[0];
|
this.canvas = document.getElementsByTagName('canvas')[0];
|
||||||
this.stargoalbanner = document.createElement("canvas");
|
this.stargoalbanner = document.createElement("canvas");
|
||||||
|
this.temp = document.createElement("canvas");
|
||||||
|
|
||||||
this.hratio = SCREENH / SCREENW;
|
this.hratio = SCREENH / SCREENW;
|
||||||
this.wratio = SCREENW / SCREENH;
|
this.wratio = SCREENW / SCREENH;
|
||||||
|
@ -7773,7 +7787,10 @@ function mainloop() {
|
||||||
game.drawloader();
|
game.drawloader();
|
||||||
|
|
||||||
if (nimages >= maximages) {
|
if (nimages >= maximages) {
|
||||||
game.setstate("title");
|
// has font loaded?
|
||||||
|
if (game.isfontloaded()) {
|
||||||
|
game.setstate("title");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (game.state == "help") {
|
} else if (game.state == "help") {
|
||||||
game.clear();
|
game.clear();
|
||||||
|
|
5
todo
5
todo
|
@ -34,17 +34,12 @@ arrow/signpost - cat parades bounce off and take out htings in the path
|
||||||
|
|
||||||
|
|
||||||
PLAYTEST:
|
PLAYTEST:
|
||||||
... adjust point goal calculation code now that we have multiplier.
|
|
||||||
... adjust # of turns per level
|
... adjust # of turns per level
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foot/human/cat toy - adjacent cat pushes it, clear the horiz. line.
|
foot/human/cat toy - adjacent cat pushes it, clear the horiz. line.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
show points for each element along path??
|
show points for each element along path??
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue