fixed mobile/desktop differentiation

This commit is contained in:
lengstrom 2015-09-25 19:13:44 -04:00
parent 9bb4bbc2e2
commit 053ca85431

View file

@ -70,23 +70,25 @@ function renderBeginningText() {
var lowerheight = (trueCanvas.height/2) + ((settings.rows * settings.blockHeight) * (2/Math.sqrt(3))) * (11/16);
var text = '';
var mob, fontSize;
if(/|mobile|Mobile|iOS|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
console.log(navigator.userAgent);
debugger;
if(/mobile|Mobile|iOS|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
mob = true;
input_text = 'Tap the screen\'s left and ride'
action_text = 'sides to rotate the hexagon'
score_text = 'Match 3+ blocks to score'
fontSize = 35
} else {
mob = false
input_text = 'Use the right and left arrow keys'
action_text = 'to rotate the hexagon'
score_text = 'Match 3+ blocks to score!'
fontSize = 20
mob = false
fontSize = 27
}
renderText((trueCanvas.width)/2 + 2 * settings.scale,upperheight-5, fontSize, '#2c3e50', input_text);
renderText((trueCanvas.width)/2 + 2 * settings.scale,upperheight+18, fontSize, '#2c3e50', action_text);
renderText((trueCanvas.width)/2 + 2 * settings.scale,upperheight-0*settings.scale, fontSize, '#2c3e50', input_text);
renderText((trueCanvas.width)/2 + 2 * settings.scale,upperheight+33*settings.scale, fontSize, '#2c3e50', action_text);
if (!mob) {
drawKey("",(trueCanvas.width)/2 + 2 * settings.scale-2.5,upperheight+20);
drawKey("",(trueCanvas.width)/2 + 2 * settings.scale-2.5,upperheight+38*settings.scale);
}
renderText((trueCanvas.width)/2 + 2 * settings.scale,lowerheight,fontSize, '#2c3e50', score_text);