System.register(["cc"], function (_export, _context) {
  "use strict";

  var _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _cc, Util, _crd, cc;

  _export("Util", void 0);

  return {
    setters: [function (_cc2) {
      _cclegacy = _cc2.cclegacy;
      __checkObsolete__ = _cc2.__checkObsolete__;
      __checkObsoleteInNamespace__ = _cc2.__checkObsoleteInNamespace__;
      _cc = _cc2;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "86e5cl4SndIBLq/pUj4yZCL", "Util", undefined);

      __checkObsolete__(['_decorator', 'Component', 'Node', 'Camera', 'RenderTexture', 'sys', 'UITransform', 'gfx', 'director', 'ImageAsset', 'Texture2D', 'SpriteFrame', 'Sprite', 'view', 'tween', 'Vec3', 'isValid']);

      cc = __checkObsoleteInNamespace__(_cc);

      _export("Util", Util = class Util {
        static validateNow() {
          if (cc.sys.isNative) {
            cc.director.root.frameMove(0);
          } else {
            cc.director.tick(0);
          }
        }

        static createRect(bgColor, x, y, width, height, node, alpha) {
          if (!node) node = new cc.Node("modal");
          let shape = node.getComponent(cc.Graphics);
          if (!shape) shape = node.addComponent(cc.Graphics);
          let color = new cc.Color();
          color = color.fromHEX(bgColor);

          if (alpha != undefined) {
            color.a = alpha * 255;
          }

          shape.fillColor = color;
          shape.fillRect(x - width / 2, y - height / 2, width, height);
          let uiT = node.getComponent(cc.UITransform);
          if (!uiT) uiT = node.addComponent(cc.UITransform);
          uiT.width = width;
          uiT.height = height;
          return node;
        }

        static createStroke(lineColor, x, y, width, height, node, alpha) {
          if (!node) node = new cc.Node("modal");
          let shape = node.getComponent(cc.Graphics);
          if (!shape) shape = node.addComponent(cc.Graphics);
          let color = new cc.Color();
          color = color.fromHEX(lineColor);

          if (alpha != undefined) {
            color.a = alpha * 255;
          }

          shape.lineWidth = 3;
          shape.strokeColor = color; // shape.rect(x - width/2, y - height/2, width, height);

          shape.rect(x, y, width, height);
          shape.stroke();
          let uiT = node.getComponent(cc.UITransform);
          if (!uiT) uiT = node.addComponent(cc.UITransform);
          uiT.width = width;
          uiT.height = height;
          return node;
        }

      });

      _cclegacy._RF.pop();

      _crd = false;
    }
  };
});
//# sourceMappingURL=169a598e76b683dbe01827d8ce8ffcd342a2c381.js.map