blaze-2d
Version:
A fast and simple WebGL 2 2D game engine written in TypeScript
16 lines • 506 B
JavaScript
/**
* Validates a z index.
*
* Does not check to see if the z index exceeds `zLevels` defined in {@link Blaze}.
*
* @param zIndex The z index to validate
* @returns true when valid or a string containing the reason for being invalid
*/
export default function validateZIndex(zIndex) {
if (zIndex < 0)
return "zIndex cannot be less than 0.";
else if (Math.floor(zIndex) !== zIndex)
return "zIndex must be an integer.";
return true;
}
//# sourceMappingURL=validators.js.map