UIAnchor.js 983 B

1234567891011121314151617181920
  1. /**
  2. * 创建UIAnchor界面
  3. * @param {Object} obj - 创建界面的父物体
  4. * @param {String} value - 创建界面的类型
  5. */
  6. function createUIAnchor(floorNum) {
  7. let anchorCreateJson = {
  8. type: "UIAnchor",
  9. // element: $(".pictureMarker")[0],
  10. // position: [100, -10, -21],
  11. // parent: app.query('#1F1FS01')[0],
  12. // pivotPixel: [parseFloat($(".textAndPictureMarker").css("width")) / 2, parseFloat($(".textAndPictureMarker").css("height"))],
  13. }
  14. var s = app.query('#' + floorNum)[0];
  15. let n = Math.ceil(Math.random() * 10)
  16. anchorCreateJson.element = $(".textAndPictureMarker")[0];
  17. //anchorCreateJson.position = [5, 2, n];
  18. anchorCreateJson.parent = app.query('#' + floorNum)[0];
  19. anchorCreateJson.pivotPixel = [parseFloat($(".textAndPictureMarker").css("width")) / 2, parseFloat($(".textAndPictureMarker").css("height"))];
  20. let tempTopCard = app.create(anchorCreateJson); // 创建顶牌