diff options
Diffstat (limited to 'js/activity.js')
-rw-r--r-- | js/activity.js | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/js/activity.js b/js/activity.js index 6c69bfb..c4e2ed2 100644 --- a/js/activity.js +++ b/js/activity.js @@ -14,7 +14,7 @@ define(function (require) { var graphicalBoard, textZone, piecesBitmapsManager, - minDimisHeight; + minDimIsHeight; // Manipulate the DOM only when it is ready. require(['domReady!'], function (doc) { @@ -42,18 +42,33 @@ define(function (require) { */ var minDim = gameZone_dim[0] < gameZone_dim[1] ? gameZone_dim[0] : gameZone_dim[1]; - minDimisHeight = gameZone_dim[1] <= gameZone_dim[0] ? true : false; + minDimIsHeight = gameZone_dim[1] <= gameZone_dim[0] ? true : false; var boardOffset = 10; var boardDim = (minDim - 2*boardOffset) * 0.6; - var textZoneMinDim = (minDim - 2*boardOffset) * 0.37; - var gap = (minDim - 2*boardOffset) * 0.03; + var gap = 15; var cellDim = boardDim/8; graphicalBoard = new GraphicalBoard([boardOffset, boardOffset], cellDim, stage); - if (minDimisHeight) { - textZone = new TextZone(boardOffset, boardOffset + cellDim * 8 + gap, 8 * cellDim, textZoneMinDim, 20 * cellDim / 50, "#2211CC", "#FFF", stage); + if (minDimIsHeight) { + textZone = new TextZone( + boardOffset, + boardOffset + graphicalBoard.getHeight() + gap, + graphicalBoard.getWidth(), + gameZone_dim[1] - graphicalBoard.getHeight() - gap - 2 * boardOffset, + 20 * cellDim / 50, + "#2211CC", + "#FFF", + stage); } else { - textZone = new TextZone(boardOffset + cellDim * 8 + gap, boardOffset, textZoneMinDim, 8 * cellDim, 20 * cellDim / 50, "#2211CC", "#FFF", stage); + textZone = new TextZone( + boardOffset + graphicalBoard.getWidth() + gap, + boardOffset, + gameZone_dim[0] - graphicalBoard.getWidth() - gap - 2 * boardOffset, + graphicalBoard.getHeight(), + 20 * cellDim / 50, + "#2211CC", + "#FFF", + stage); } function main(){ |