dynamicLine.js 1.02 KB
Newer Older
赵瑞's avatar
赵瑞 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
function krpanoplugin() {
  var local = this;
  var krpano = null;
  var plugin = null;
  local.registerplugin = function (krpanointerface, pluginpath, pluginobject) {
    krpano = krpanointerface;
    plugin = pluginobject;
    plugin.dosomething = action_dosomething;
    plugin.registercontentsize(200, 200);

    var text = document.createElement('div');
    text.style.cssText =
      'width:100%;height:100%;' +
      'display:flex;color:white;background:red;' +
      'align-items:center;justify-content:center;text-align:center;';
    text.innerHTML = 'HTML5<br>TEST PLUGIN<br>click me';
    plugin.sprite.appendChild(text);
  };
  local.unloadplugin = function () {
    plugin = null;
    krpano = null;
  };
  local.onresize = function (width, height) {
    return false;
  };
  function action_dosomething() {
    plugin.accuracy = 1;
    // krpano.call("tween(width|height, 500|100)", plugin);
    // krpano.call("lookto(0,0,150); wait(1.0); lookto(90,0,90);");
    // krpano.call("tween(width|height, 200|200)", plugin);
  }
}