text: (window.webpackJsonp=window.webpackJsonp||[]).push([[144],{660:function(n,e,t){"use strict";t.r(e),e.default="const {Scene, Sprite, Label, Path} = spritejs;\nconst container = document.getElementById('stage');\nconst scene = new Scene({\n  container,\n  width: 1200,\n  height: 600,\n});\nconst layer = scene.layer();\n\nconst s1 = new Sprite();\ns1.attr({\n  anchor: [0.5, 0.5],\n  pos: [770, 300],\n  size: [300, 300],\n  rotate: 45,\n  bgcolor: '#3c7',\n});\n\nlayer.append(s1);\n\ns1.addEventListener('mouseenter', (evt) => {\n  s1.attr('border', [4, 'blue']);\n});\ns1.addEventListener('mouseleave', (evt) => {\n  s1.attr('border', [0, '']);\n});\n\nconst anchorCross = new Path('M-10,0H10M0,-10V10');\nanchorCross.attr({\n  pos: [770, 300],\n  strokeColor: 'red',\n  rotate: 45,\n  lineWidth: 4,\n  pointerEvents: 'none',\n});\n\nlayer.append(anchorCross);\n\nconst label = new Label('\u9f20\u6807\u4f4d\u7f6e\uff1a');\n\nlabel.attr({\n  pos: [20, 50],\n  font: '24px Arial',\n  lineHeight: 56,\n});\n\nlayer.append(label);\n\ns1.addEventListener('mousemove', (evt) => {\n  const {x, y} = evt;\n  label.text = `\u9f20\u6807\u4f4d\u7f6e\uff1a\\n\u76f8\u5bf9\u4e8e\u951a\u70b9: ${s1.getOffsetPosition(x, y).map(Math.round)}`;\n  evt.stopPropagation();\n});\n\nlayer.addEventListener('mousemove', (evt) => {\n  const {x, y} = evt;\n  label.text = `\u9f20\u6807\u4f4d\u7f6e\uff1a\\n\u76f8\u5bf9\u4e8e Layer: ${[Math.round(x), Math.round(y)]}`;\n});"}}]);