Ver código fonte

update language screen and grid function

lairaalmas 2 anos atrás
pai
commit
cbfb196915
2 arquivos alterados com 9 adições e 8 exclusões
  1. 7 4
      js/globals.js
  2. 2 4
      js/preMenu.js

+ 7 - 4
js/globals.js

@@ -774,10 +774,13 @@ let gameFrame = function () {
   return { x, y, width, height, rect, point };
 };
 
-// for debug
+// For debug
 const debugGrid = function () {
-  for (let i = 0; i < 12; i++) {
-    game.add.geom.rect(i * 160, 0, 80, 1080, colors.white, 0, colors.blue, 0.3);
-    game.add.geom.rect(0, i * 180, 1920, 90, colors.white, 0, colors.blue, 0.3);
+  const grid = 12;
+  const h = 1920 / (grid + 0.5);
+  const v = 1080 / (grid + 0.5);
+  for (let i = 0; i < grid; i++) {
+    game.add.geom.rect(h / 2 + i * h, 0, h / 2, 1080, '', 0, colors.blue, 0.3);
+    game.add.geom.rect(0, v / 2 + i * v, 1920, v / 2, '', 0, colors.blue, 0.3);
   }
 };

+ 2 - 4
js/preMenu.js

@@ -78,8 +78,6 @@ const langState = {
       1
     );
 
-    if (debugMode) debugGrid();
-
     // Parameters for the elements on the screen
     this.listOfFlags = [];
 
@@ -93,8 +91,8 @@ const langState = {
       ], // Language names
       flag: ['flag_BR', 'flag_IT', 'flag_US', 'flag_PE', 'flag_FR'], // Icon names
       lang: ['pt_BR', 'it_IT', 'en_US', 'es_PE', 'fr_FR'], // Parameters sent for language object
-      x: [-280, -280, -280, 140, 140],
-      y: [-220, 0, 220, -120, 120],
+      x: [-360, -360, -360, 160, 160],
+      y: [-220, 0, 220, -110, 110],
     };
 
     // Create elements on screen