fixed "press p to continue" text occurring in mobile browsers

This commit is contained in:
meadowstream 2014-07-04 14:09:14 -04:00
parent 7e575216b3
commit 841a001f90
3 changed files with 15 additions and 15 deletions

View file

@ -55,7 +55,7 @@
<br>
</p>
</div>
<div onClick="showHelp()" id="openSideBar"><i class="fa fa-info ></i></div>
<div onClick="showHelp()" id="openSideBar"><i class="fa fa-info-circle fa-lg"></i></div>
<div id="overlay" class="faded"></div>
<div id = 'pauseBtn'><i class="fa fa-pause fa-2x"></i></div>
<div id = 'restartBtn'><i class="fa fa-refresh fa-2x"></i></div>

View file

@ -1,5 +1,4 @@
var textShown = false;
var showingHelp = false;
$(document).ready(function(){
scaleCanvas();
$('#startBtn').on('touchstart mousedown', function(){
@ -77,6 +76,7 @@ var settings;
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
settings = {
platform:"mobile",
startDist:227,
creationDt:40,
baseScale:1.4,
@ -93,6 +93,7 @@ if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigat
};
} else {
settings = {
platform:"nonmobile",
baseScale:1,
startDist:340,
creationDt:9,
@ -400,15 +401,9 @@ window.onblur = function (e) {
}
};
function showHelp(){
if(gameState =1){
if(gameState != 0){
pause();
}
if(document.getElementById("helpScreen").style.display=="none" || document.getElementById("helpScreen").style.display === ""){
document.getElementById("helpScreen").style.display = "block";
}
else if(document.getElementById("helpScreen").style.display=="block" ){
document.getElementById("helpScreen").style.display = "none";
}
showingHelp = !showingHelp;
$('#helpScreen').fadeToggle(150, "linear");
}

View file

@ -138,6 +138,11 @@ function showText(text){
var pt = document.getElementById("overlay");
pt.className = 'unfaded';
if (text == 'paused' && settings.platform == mobile) {
return;
}
pt.innerHTML = messages[text];
}