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

  var _cclegacy, _decorator, math, Component, resources, Texture2D, Sprite, SpriteFrame, UITransform, _dec, _class, _crd, ccclass, property, mainScene;

  return {
    setters: [function (_cc) {
      _cclegacy = _cc.cclegacy;
      _decorator = _cc._decorator;
      math = _cc.math;
      Component = _cc.Component;
      resources = _cc.resources;
      Texture2D = _cc.Texture2D;
      Sprite = _cc.Sprite;
      SpriteFrame = _cc.SpriteFrame;
      UITransform = _cc.UITransform;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "c39c2mqvaRDXa4Sl/8iVUFR", "mainScene", undefined);

      ({
        ccclass,
        property
      } = _decorator);

      _export("mainScene", mainScene = (_dec = ccclass('mainScene'), _dec(_class = class mainScene extends Component {
        start() {
          let thisSelf = this;
          let resList = "map/test1/texture";
          resources.load(resList, Texture2D, function (error, asset) {
            if (!error) {
              thisSelf.updateSceneData(asset);
            } else console.log(error.message);
          });
          /*
          let resList: string = "map/test1/spriteFrame";
          resources.load(resList, SpriteFrame, function(error, asset: SpriteFrame): void {
              if(!error){
                  thisSelf.updateScene(asset);
              }
              else console.log(error.message);
          });*/
        }

        updateScene(background) {
          let width = background.texture.width;
          let height = background.texture.height;
          this.getComponent(UITransform).setContentSize(new math.Size(width, height));
          let sprite = this.node.getComponent(Sprite);
          sprite.spriteFrame = background;
        }

        updateSceneData(background) {
          let width = background.width;
          let height = background.height;
          this.getComponent(UITransform).setContentSize(new math.Size(width, height));
          let sprite = this.node.getComponent(Sprite);
          sprite.spriteFrame = new SpriteFrame();
          sprite.spriteFrame.texture = background;
        }

      }) || _class));

      _cclegacy._RF.pop();

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