appui.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //-----App ui-----
  2. function createApp() {
  3. let self = this
  4. function makeSetter(val) {
  5. let setstr = 'this.' + val + '= value; this.redrawEvent();'
  6. return setstr
  7. }
  8. function getNewPosition() {
  9. //let allChild = vwf.find("","/*")
  10. let cursorVisID = vwf.find("myCursor-avatar-" + vwf.moniker_, "./vis")[0]
  11. let avPos = AFRAME.utils.coordinates.parse(vwf.callMethod(cursorVisID, 'worldPosition'));
  12. let newPos = [avPos.x, avPos.y, avPos.z]
  13. return newPos
  14. }
  15. return {
  16. $cell: true,
  17. $type: "div",
  18. class: "propGrid max-width mdc-layout-grid mdc-layout-grid--align-left",
  19. $components: [
  20. {
  21. $cell: true,
  22. $type: "div",
  23. class: "mdc-layout-grid__inner",
  24. $components: [
  25. {
  26. $cell: true,
  27. $type: "div",
  28. class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
  29. $components: [
  30. {
  31. $cell: true,
  32. $type: "button",
  33. class: "mdc-button mdc-button--raised",
  34. $text: "Wide",
  35. onclick: function (e) {
  36. let avatarID = 'avatar-'+vwf.moniker_;
  37. vwf_view.kernel.callMethod(avatarID, "setBigVideoHead", []);
  38. }
  39. },
  40. {
  41. $cell: true,
  42. $type: "button",
  43. class: "mdc-button mdc-button--raised",
  44. $text: "Small",
  45. onclick: function (e) {
  46. let avatarID = 'avatar-'+vwf.moniker_;
  47. vwf_view.kernel.callMethod(avatarID, "setSmallVideoHead", []);
  48. }
  49. }
  50. ]
  51. }
  52. ]
  53. }
  54. ]
  55. }
  56. }