Skip to content

Commit

Permalink
fixed mobile/desktop differentiation
Browse files Browse the repository at this point in the history
  • Loading branch information
lengstrom committed Sep 25, 2015
1 parent 9bb4bbc commit 053ca85
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions js_v9/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 053ca85

Please sign in to comment.