You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @paramSprite The FlxSprite you wish to draw the grid on-top of. This updates its pixels value, not just the current frame (don't use animated sprites!)
70
-
* @paramCellWidth The grid cell width
71
-
* @paramCellHeight The grid cell height
72
-
* @paramWidth The width of the FlxSprite. If -1 it will be the size of the game (FlxG.width)
73
-
* @paramHeight The height of the FlxSprite. If -1 it will be the size of the game (FlxG.height)
71
+
* @paramCellWidth The grid cell width. Must be greater than 0.
72
+
* @paramCellHeight The grid cell height. Must be greater than 0.
73
+
* @paramWidth The width of the FlxSprite. If -1 it will be the size of the game (FlxG.width). This value cannot be smaller than the `CellWidth`
74
+
* @paramHeight The height of the FlxSprite. If -1 it will be the size of the game (FlxG.height). This value cannot be smaller than the `CellHeight`
74
75
* @paramAlternate Should the pattern alternate on each new row? Default true = checkerboard effect. False = vertical stripes
75
76
* @paramColor1 The first fill colour in 0xAARRGGBB format
76
77
* @paramColor2 The second fill colour in 0xAARRGGBB format
@@ -90,9 +91,10 @@ class FlxGridOverlay
90
91
}
91
92
92
93
if (Width<CellWidth||Height<CellHeight)
93
-
{
94
-
returnnull;
95
-
}
94
+
throw"The width and height of a grid cannot be smaller than the cell's width and height!";
95
+
96
+
if (CellWidth<=0||CellHeight<=0)
97
+
throw"Grid cell width/height cannot be less or equal to 0";
0 commit comments