zimjs 17.2.6 → 17.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/zim.js +86 -70
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zimjs",
3
- "version": "17.2.6",
3
+ "version": "17.2.8",
4
4
  "type": "module",
5
5
  "main": "./src/zim.js",
6
6
  "types": "./ts-src/typings/zim",
package/src/zim.js CHANGED
@@ -747,11 +747,12 @@ EXAMPLE
747
747
  const array = ["happy", "sad", "spooked"];
748
748
  const randomFromArray = shuffle(array)[0];
749
749
  // this will be randomized each time it is run
750
+ // or use ZIM pluck()
750
751
  END EXAMPLE
751
752
 
752
753
  EXAMPLE
753
754
  const array = shuffle(["happy", "sad", "spooked"]);
754
- for (let i=0; i<array.length, i++) zog(array[i]);
755
+ loop(array, feeling=>{zog(feeling);});
755
756
  // this will get random and unique elements of the array
756
757
  END EXAMPLE
757
758
 
@@ -1652,7 +1653,7 @@ call - the function to call
1652
1653
  if the obj is an object literal then the first and second parameters are the property name and property value at the current index
1653
1654
  if the obj is an string then the first parameter is the letter
1654
1655
  if the obj is an HTMLCollection then the first parameter is the tag
1655
- if the obj is a Container then the first paramter is the child
1656
+ if the obj is a Container then the first parameter is the child
1656
1657
  reverse - (default false) set to true to run the loop backwards to 0
1657
1658
  interval - (default 0) set to a number of seconds between each loop
1658
1659
  use return NEXT to go immediately to the next interval
@@ -1721,13 +1722,13 @@ RETURNS any value returned from the loop - or true if no value is returned from
1721
1722
  i = start-i;
1722
1723
 
1723
1724
  if (type=="number") {
1724
- r = call(i, total, start, end, obj);
1725
+ r = call(i, total, start, end, obj, io);
1725
1726
  } else if (type=="array" || type=="string") {
1726
- r = call(obj[i], i, total, start, end, obj);
1727
+ r = call(obj[i], i, total, start, end, obj, io);
1727
1728
  } else if (type=="Dictionary") {
1728
- r = call(obj[i], vals[i], i, total, start, end, obj);
1729
+ r = call(obj[i], vals[i], i, total, start, end, obj, io);
1729
1730
  } else { // nodelist
1730
- r = call(obj.item(i), i, total, start, end, obj);
1731
+ r = call(obj.item(i), i, total, start, end, obj, io);
1731
1732
  }
1732
1733
 
1733
1734
  if (r == 'next') io.next();
@@ -1762,7 +1763,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
1762
1763
  } else if (type=="array" || type=="string") {
1763
1764
  r = call(obj[i], i, total, start, end, obj, io);
1764
1765
  } else if (type=="Dictionary") {
1765
- r = call(obj[i], vals[i], i, total, start, end, obj);
1766
+ r = call(obj[i], vals[i], i, total, start, end, obj, io);
1766
1767
  } else { // nodelist or htmlcollection
1767
1768
  r = call(obj.item(i), i, total, start, end, obj, io);
1768
1769
  }
@@ -1799,7 +1800,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
1799
1800
  if (step) i *= step;
1800
1801
  i = start-i;
1801
1802
 
1802
- r = call(props[i], obj[props[i]], i, total, start, end, obj);
1803
+ r = call(props[i], obj[props[i]], i, total, start, end, obj, io);
1803
1804
 
1804
1805
  if (r == 'next') io.next();
1805
1806
  else if (typeof r != 'undefined') {
@@ -1820,7 +1821,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
1820
1821
  if (!immediate) i--;
1821
1822
  if (step != 1) i = -start + i*step;
1822
1823
 
1823
- r = call(props[i], obj[props[i]], i, total, start, end, obj);
1824
+ r = call(props[i], obj[props[i]], i, total, start, end, obj, io);
1824
1825
 
1825
1826
  if (r == 'next') io.next();
1826
1827
  else if (typeof r != 'undefined') {
@@ -2104,7 +2105,7 @@ pauseTimeLeft - if paused, get how much time is left once unpaused
2104
2105
  setTimeout(function() {
2105
2106
  (call)(obj);
2106
2107
  checkTotal();
2107
- }, 10);
2108
+ }, 5);
2108
2109
  }
2109
2110
  function checkTotal() {
2110
2111
  if (total == -1) return;
@@ -5433,7 +5434,7 @@ speed = 0;
5433
5434
  zog(sign(speed)); // 0
5434
5435
 
5435
5436
  speed = -20;
5436
- zog(sSign(speed)); // -1
5437
+ zog(sign(speed)); // -1
5437
5438
  END EXAMPLE
5438
5439
 
5439
5440
  PARAMETERS
@@ -8878,18 +8879,20 @@ Might have set these on CreateJS DisplayObject
8878
8879
  });
8879
8880
 
8880
8881
  var frame;
8881
- var adCheck;
8882
+ var addCheck;
8882
8883
  that.on("mousedown", function (e) {
8883
- if (e.target.stage) {
8884
- frame = e.target.stage.frame;
8885
- if (frame.allowDefault) {
8886
- adCheck = true;
8887
- frame.allowDefault = false;
8884
+ if (e && e.nativeEvent && e.nativeEvent.touches) {
8885
+ if (e.target.stage) {
8886
+ frame = e.target.stage.frame;
8887
+ if (frame.allowDefault) {
8888
+ addCheck = true;
8889
+ frame.allowDefault = false;
8890
+ }
8888
8891
  }
8889
- }
8892
+ }
8890
8893
  });
8891
8894
  that.on("pressup", function () {
8892
- if (frame && adCheck) frame.allowDefault = true;
8895
+ if (frame && addCheck) frame.allowDefault = true;
8893
8896
  });
8894
8897
 
8895
8898
  // EFFECTS
@@ -9755,7 +9758,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
9755
9758
  return that.cjsContainer_getBounds();
9756
9759
  };
9757
9760
 
9758
- this.disposeAllChildren = function() {
9761
+ this.disposeAllChildren = function() {
9759
9762
  for (var i=this.numChildren-1; i>=0; i--) {
9760
9763
  var child = this.getChildAt(i)
9761
9764
  if (child.dispose) child.dispose();
@@ -9780,7 +9783,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
9780
9783
  return (!zot(this[prop]) || Object.prototype.hasOwnProperty.call(this,prop));
9781
9784
  };
9782
9785
  };
9783
- zim.Container.prototype.dispose = function(disposing) {
9786
+ zim.Container.prototype.dispose = function(disposing) {
9784
9787
  recursiveDispose(this, disposing);
9785
9788
  return true;
9786
9789
  };
@@ -27344,7 +27347,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
27344
27347
  return p2;
27345
27348
  };
27346
27349
  };
27347
- zim.extend(zim.Pane, zim.Container, "clone", "zimContainer", false);
27350
+ zim.extend(zim.Pane, zim.Container, ["clone", "dispose"], "zimContainer", false);
27348
27351
  //-58
27349
27352
 
27350
27353
  /*--
@@ -28418,6 +28421,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
28418
28421
  hitArea.y = -content.y;
28419
28422
  }
28420
28423
  content.x = hscrollBar.proportion.convert(hscrollBar.x);
28424
+ if (!damp) desiredX = that.scrollX;
28421
28425
  testContent();
28422
28426
  });
28423
28427
  }
@@ -28450,7 +28454,10 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
28450
28454
  hitArea.y = -content.y;
28451
28455
  }
28452
28456
  if (damp) desiredY = vscrollBar.proportion.convert(vscrollBar.y);
28453
- else content.y = vscrollBar.proportion.convert(vscrollBar.y);
28457
+ else {
28458
+ content.y = vscrollBar.proportion.convert(vscrollBar.y);
28459
+ desiredY = that.scrollY;
28460
+ }
28454
28461
  testContent();
28455
28462
  });
28456
28463
  }
@@ -28969,7 +28976,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
28969
28976
  document.WW.addEventListener("blur", that.blurEvent);
28970
28977
  }
28971
28978
 
28972
- function stageUp() {
28979
+ function stageUp() {
28973
28980
  zim.Ticker.remove(swipeMovescrollBars);
28974
28981
  swipeCheck = false;
28975
28982
  if (hCheck) if (scrollBarFade && scrollBarActive) zim.animate(hscrollBar, {alpha:0}, scrollBar.fadeTime);
@@ -33788,11 +33795,11 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
33788
33795
  return that.cloneProps(new zim.List(width, originalHeight, zim.copy(that.originalList, true), viewNum, vertical, currentSelected, align, valign, labelAlign, labelValign, labelIndent, labelIndentH, labelIndentV, indent, spacing, backgroundColor, rollBackgroundColor, downBackgroundColor, selectedBackgroundColor, selectedRollBackgroundColor, backdropColor, color, rollColor, downColor, selectedColor, selectedRollColor, originalBorderColor, originalBorderWidth, padding, zim.copy(corner), swipe, scrollBarActive, scrollBarDrag, scrollBarColor, scrollBarAlpha, scrollBarFade, scrollBarH, scrollBarV, scrollBarOverlay, slide, slideFactor, slideSnap, slideSnapDamp, shadowColor, shadowBlur, paddingH, paddingV, scrollWheel, damp, titleBar, titleBarColor, titleBarBackgroundColor, titleBarHeight, draggable, boundary, onTop, close, closeColor, collapse, collapseColor, collapsed, excludeCustomTap, organizer, checkBox, pulldown, clone, cancelCurrentDrag, index, noScale, pulldownToggle, optimize, keyEnabled, resizeHandle, resizeBoundary, resizeVisible, continuous, closeOthers, drop, dropTargets, dropSelf, dropCopy, dropColor, dropThickness, dropScrollSpeed, dropReticleAlpha, dropHitTest, dropFull, dropSnap, dropEnd, dropScale, dropWidth, dropHeight, selectedIndex, style, this.group, inherit));
33789
33796
  };
33790
33797
  this.dispose = function(a,b,disposing) {
33791
- if (!disposing) {
33798
+ // if (!disposing) {
33792
33799
  if (that.stageToggleEvent) stage.off("stagemousedown", that.stageToggleEvent);
33793
33800
  if (that.organizer) that.organizer.dispose();
33794
33801
  this.zimWindow_dispose();
33795
- }
33802
+ // }
33796
33803
  // that.tabs = that.selected = selected = that.originalList = list = that.organizer = null;
33797
33804
  return true;
33798
33805
  };
@@ -58957,13 +58964,13 @@ RETURNS any value returned from the loop - or true if no value is returned from
58957
58964
  if (step) i *= step;
58958
58965
  i = start-i;
58959
58966
  if (type=="number") {
58960
- r = call(i, total, start, end, obj);
58967
+ r = call(i, total, start, end, obj, io);
58961
58968
  } else if (type=="array" || type=="string") {
58962
- r = call(obj[i], i, total, start, end, obj);
58969
+ r = call(obj[i], i, total, start, end, obj, io);
58963
58970
  } else if (type=="Dictionary") {
58964
- r = call(obj[i], vals[i], i, total, start, end, obj);
58971
+ r = call(obj[i], vals[i], i, total, start, end, obj, io);
58965
58972
  } else { // nodelist
58966
- r = call(obj.item(i), i, total, start, end, obj);
58973
+ r = call(obj.item(i), i, total, start, end, obj, io);
58967
58974
  }
58968
58975
 
58969
58976
  if (r == 'next') io.next();
@@ -58998,7 +59005,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
58998
59005
  } else if (type=="array" || type=="string") {
58999
59006
  r = call(obj[i], i, total, start, end, obj, io);
59000
59007
  } else if (type=="Dictionary") {
59001
- r = call(obj[i], vals[i], i, total, start, end, obj);
59008
+ r = call(obj[i], vals[i], i, total, start, end, obj, io);
59002
59009
  } else { // nodelist or htmlcollection
59003
59010
  r = call(obj.item(i), i, total, start, end, obj, io);
59004
59011
  }
@@ -59035,7 +59042,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
59035
59042
  if (step) i *= step;
59036
59043
  i = start-i;
59037
59044
 
59038
- r = call(props[i], obj[props[i]], i, total, start, end, obj);
59045
+ r = call(props[i], obj[props[i]], i, total, start, end, obj, io);
59039
59046
 
59040
59047
  if (r == 'next') io.next();
59041
59048
  else if (typeof r != 'undefined') {
@@ -59056,7 +59063,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
59056
59063
  if (!immediate) i--;
59057
59064
  if (step != 1) i = -start + i*step;
59058
59065
 
59059
- r = call(props[i], obj[props[i]], i, total, start, end, obj);
59066
+ r = call(props[i], obj[props[i]], i, total, start, end, obj, io);
59060
59067
 
59061
59068
  if (r == 'next') io.next();
59062
59069
  else if (typeof r != 'undefined') {
@@ -59084,7 +59091,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
59084
59091
  if (step) i *= step;
59085
59092
  i = start-i;
59086
59093
 
59087
- r = call(obj.getChildAt(i), i, total, start, end, obj);
59094
+ r = call(obj.getChildAt(i), i, total, start, end, obj, io);
59088
59095
 
59089
59096
  if (r == 'next') io.next();
59090
59097
  else if (typeof r != 'undefined') {
@@ -59105,7 +59112,7 @@ RETURNS any value returned from the loop - or true if no value is returned from
59105
59112
  if (!immediate) i--;
59106
59113
  if (step != 1) i = -start + i*step;
59107
59114
 
59108
- r = call(obj.getChildAt(i), i, total, start, end, obj);
59115
+ r = call(obj.getChildAt(i), i, total, start, end, obj, io);
59109
59116
 
59110
59117
  if (r == 'next') io.next();
59111
59118
  else if (typeof r != 'undefined') {
@@ -65055,7 +65062,8 @@ note: the item is not the event object target - as that is the tile
65055
65062
  var rowSpacings;
65056
65063
  var widthScaling = 1;
65057
65064
  var heightScaling = 1;
65058
-
65065
+
65066
+
65059
65067
  function resize(width, height) {
65060
65068
 
65061
65069
  if (that.normalized) that.resetOriginalReg();
@@ -69070,6 +69078,7 @@ function apply () {
69070
69078
  window.addEventListener("pointerdown", that.doPointerDown);
69071
69079
  function doDown(e) {
69072
69080
 
69081
+
69073
69082
  if (!that.raycast) return;
69074
69083
 
69075
69084
  if (XR) {
@@ -69082,9 +69091,10 @@ function apply () {
69082
69091
  } else {
69083
69092
  var point;
69084
69093
  if (!zimThree || zimThree.resizeEvent) {
69094
+ var rec = renderer.domElement.getBoundingClientRect();
69085
69095
  point = {
69086
- x: (e.clientX/window.innerWidth*2-1),
69087
- y: (1-e.clientY/window.innerHeight*2)
69096
+ x: ((e.clientX-rec.x)/rec.width*2-1),
69097
+ y: (1-(e.clientY-rec.y)/rec.height*2)
69088
69098
  }
69089
69099
  } else {
69090
69100
  point = {
@@ -69110,6 +69120,7 @@ function apply () {
69110
69120
  break;
69111
69121
  }
69112
69122
  }
69123
+
69113
69124
  if (material
69114
69125
  && material.map
69115
69126
  && material.map.source
@@ -69118,11 +69129,12 @@ function apply () {
69118
69129
  && material.userData.ta_content
69119
69130
  ) {
69120
69131
  currentDown = obj;
69132
+
69121
69133
  var content = material.userData.ta_content;
69122
69134
  that.pointerData.mousedown = true;
69123
- doRaycast(content, intersects[i], material.userData.ta_flipped);
69124
- createjs.handleRemotePointer(that.pointerData.x, that.pointerData.y, "down", e, stage, e.pointerId);
69125
-
69135
+
69136
+ doRaycast(content, intersects[i], material.userData.ta_flipped);
69137
+ createjs.handleRemotePointer(that.pointerData.x, that.pointerData.y, "down", e, stage, e.pointerId);
69126
69138
  if (controls && controls.maxAzimuthAngle && content) {
69127
69139
  if (content.backingOrbit) {
69128
69140
  var p = content.globalToLocal(frame.mouseX, frame.mouseY);
@@ -69135,6 +69147,7 @@ function apply () {
69135
69147
  }
69136
69148
  }
69137
69149
  var e2 = new createjs.Event("raydown");
69150
+
69138
69151
  e2.mesh = that.mesh = obj;
69139
69152
  e2.material = that.material = material;
69140
69153
  e2.textureActive = that.textureActive = content;
@@ -69195,9 +69208,10 @@ function apply () {
69195
69208
  } else {
69196
69209
  var point;
69197
69210
  if (!zimThree || zimThree.resizeEvent) {
69211
+ var rec = renderer.domElement.getBoundingClientRect();
69198
69212
  point = {
69199
- x: (e.clientX/window.innerWidth*2-1),
69200
- y: (1-e.clientY/window.innerHeight*2)
69213
+ x: ((e.clientX-rec.x)/rec.width*2-1),
69214
+ y: (1-(e.clientY-rec.y)/rec.height*2)
69201
69215
  }
69202
69216
  } else {
69203
69217
  point = {
@@ -69464,8 +69478,8 @@ zim.TextureActivesManager = function(stage, toggleKey, damp) {
69464
69478
  var that = this;
69465
69479
  this.type = "TextureActivesManager";
69466
69480
 
69467
- that.color = zim.darker;
69468
- that.outerColor = "black";
69481
+ that.color = darker;
69482
+ that.outerColor = black;
69469
69483
 
69470
69484
  var moveCheck = false;
69471
69485
 
@@ -69478,7 +69492,7 @@ zim.TextureActivesManager = function(stage, toggleKey, damp) {
69478
69492
 
69479
69493
  var sP = new zim.Proportion({baseMin:1000, baseMax:9000, targetMin:-.1, targetMax:-.05, clamp:false});
69480
69494
 
69481
- that.backing = new zim.Rectangle(100,100,zim.faint).addTo(stage,0);
69495
+ that.backing = new zim.Rectangle(100,100,black).addTo(stage,0);
69482
69496
  var updateList = [];
69483
69497
  that.updateTile = function(obj, textureActives, remove) {
69484
69498
  if (!remove) objs.add(obj, textureActives);
@@ -69627,8 +69641,8 @@ zim.TextureActivesManager = function(stage, toggleKey, damp) {
69627
69641
  }
69628
69642
  this.hide = function() {
69629
69643
  if (!that.toggled) return;
69630
- frame.color = lastColor;
69631
- frame.outerColor = lastOuter;
69644
+ frame.color = lastColor==undefined?null:lastColor==null?null:lastColor;
69645
+ frame.outerColor = lastOuter==undefined?null:lastOuter==null?null:lastOuter;
69632
69646
  that.toggled = false;
69633
69647
  zim.Ticker.remove(that.ticker);
69634
69648
  nav.removeFrom();
@@ -76637,10 +76651,9 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
76637
76651
  if (zot(backPress)) backPress = DS.backPress!=null?DS.backPress:true;
76638
76652
  if (zot(reverse)) reverse = DS.reverse!=null?DS.reverse:false;
76639
76653
  if (zot(continuous)) continuous = DS.continuous!=null?DS.continuous:false;
76640
- var startFlipped = flipped;
76641
-
76654
+
76642
76655
  this.flipped = flipped;
76643
- var that = this;
76656
+ var that = this;
76644
76657
 
76645
76658
  front.centerReg(this);
76646
76659
  var obj;
@@ -76664,13 +76677,13 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
76664
76677
 
76665
76678
  this.flip = function(state, time) {
76666
76679
  if (state == that.flipped) return;
76667
- if (!that.flipped) spin(startFlipped?back:front,startFlipped?front:back,1,time);
76668
- else spin(startFlipped?front:back,startFlipped?back:front,-1,time);
76680
+ if (that.flipped) spin(back,front,-1,time);
76681
+ else spin(front,back,1,time);
76669
76682
  };
76670
76683
  function spin(f, b, d, t) { // current front, back, direction
76671
76684
  if (zot(d)) d = 1;
76672
76685
  d *= reverse?-1:1;
76673
- if (continuous) d = reverse?startFlipped?1:-1:startFlipped?-1:1;
76686
+ if (continuous) d = reverse?-1:1;
76674
76687
  if (zot(t)) t = time;
76675
76688
  that.flipped = !that.flipped;
76676
76689
  that.dispatchEvent("flip");
@@ -76710,6 +76723,11 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
76710
76723
  });
76711
76724
  }
76712
76725
 
76726
+ if (flipped) {
76727
+ that.flipped = false;
76728
+ that.flip(true, 0);
76729
+ }
76730
+
76713
76731
  if (style!==false) zim.styleTransforms(this, DS);
76714
76732
  this.clone = function() {
76715
76733
  return that.cloneProps(new zim.Flipper(front.clone(), back.clone(), interactive, time, vertical, flipped, easeRoot, frontPress, backPress, reverse, continuous, style, this.group, inherit));
@@ -87202,7 +87220,7 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
87202
87220
  [127.55,73.3, "#A1E543","AAjLSIAAp6IEiAAIAAJ6gAlELOIAAp2IEiAAIAAJ2gAlEihIAAowIKEAAIAAIwg"],
87203
87221
  [32.55,73.05, "#B545E4","Ak6LQIAA2fIJ1AAIAAWfg"]
87204
87222
  ];
87205
- var icon = new zim.Rectangle(200,200);
87223
+ var icon = new zim.Rectangle(200,200,color);
87206
87224
  zim.loop(data, function (d) {
87207
87225
  var s = new zim.Shape().f(d[2]).p(d[3]);
87208
87226
  s.setTransform(d[0]+20,d[1]+27);
@@ -91617,10 +91635,10 @@ pause(state) - pause or unpause the gif
91617
91635
  see also the startPaused parameter
91618
91636
  stop() - stop the gif (same as dispose())
91619
91637
  keyout(color, tolerance, replacement) - remove color from Bitmap and a tolerance between 0-1
91620
- the default color is "#389b26" which is a medium dark green
91621
- the default tolerance is .1 - the higher the tolerance the less sensitive the keying process - so more colors will be removed similar to the provided color
91622
- color and tolerance can be an array of colors and tolerances (or just one tolerance if all are the same)
91623
- replacement (default clear) a color to replace the keyed out color with or an optional array to match the colors array if an array is used
91638
+ the default color is "#389b26" which is a medium dark green
91639
+ the default tolerance is .1 - the higher the tolerance the less sensitive the keying process - so more colors will be removed similar to the provided color
91640
+ color and tolerance can be an array of colors and tolerances (or just one tolerance if all are the same)
91641
+ replacement (default clear) a color to replace the keyed out color with or an optional array to match the colors array if an array is used
91624
91642
  reset() - restarts the GIF
91625
91643
  dispose() - delete the GIF and remove Ticker
91626
91644
 
@@ -93371,7 +93389,7 @@ click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmove, pre
93371
93389
  // the Three section is for the ZIM Three helper library
93372
93390
 
93373
93391
  /*--
93374
- zim.Three = function(width, height, color, cameraPosition, cameraLook, interactive, resize, frame, ortho, textureActive, colorSpace, colorManagement, legacyLights, throttle, lay, full, xr, VRButton, xrBufferScale)
93392
+ zim.Three = function(width, height, color, cameraPosition, cameraLook, interactive, resize, frame, ortho, textureActive, colorSpace, colorManagement, legacyLights, throttle, lay, full, xr, VRButton, xrBufferScale, tag)
93375
93393
 
93376
93394
  Three
93377
93395
  zim class
@@ -93491,6 +93509,10 @@ xr - (default false) set to true to make the renderer prepared for XR (AR/VR)
93491
93509
  VRButton - (default true if xr is true and will add a VRButton if using zim_three import) adds an ENTER VR button
93492
93510
  or pass in the VRButton class from three.js if not using the zim_three import
93493
93511
  xrBufferScale - (default 2) magnification of scene - 2 makes for better quality in VR
93512
+ tag - (default null) a string to an HTML tag with id or the HTML Element to add the three.js renderer domElement to
93513
+ this is to be used with TextureActive to be able to add a feature to an existing html tag
93514
+ the width and height of the tag will be used and should be set ahead of time with CSS - px or percent is okay
93515
+ See: https://zimjs.com/015/textureactive_simple_tag.html
93494
93516
 
93495
93517
  METHODS
93496
93518
  position(x, y) - position the three.js canvas (registration point in center) to the stage coordinates
@@ -93891,11 +93913,6 @@ zim.Socket = function(server, appName, roomName, maxPeople, fill, initObj)
93891
93913
 
93892
93914
  Socket
93893
93915
  zim class extends a zim EventDispatcher (with the normal event object replaced by a data param)
93894
- ** MUST import socket.io.js with a script tag - SEE link at top of Docs for socket.io.js under ZIM works with...
93895
- ** MUST import zim_socket - see https://zimjs.com/es6.html#MODULES
93896
- ** MUST request a ZIM Socket Server ID or have a NodeJS server running zimserver.js with SocketIO on server (and client as mentioned)
93897
- ** MUST test on a server to avoid CORS errors
93898
- See: https://zimjs.com/es6.html#MODULES
93899
93916
 
93900
93917
  OVERVIEW
93901
93918
  Sockets are how multiuser games, chats, avatars, etc. work.
@@ -93923,16 +93940,14 @@ https://zimjs.com/control.html // works with control.html
93923
93940
  NOTE as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
93924
93941
 
93925
93942
  EXAMPLE
93926
- // up top after loading CreateJS and ZIM add the latest versions of these files
93927
- // https://zimjs.org/cdn/2.3.0/socket.io.js
93928
- // https://zimjs.org/cdn/zimserver_urls.js
93929
- // https://zimjs.org/cdn/zimsocket_1.1.js
93943
+ // must import the socket module at the top of the script
93944
+ import zim from "https://zimjs.org/cdn/017/zim_socket";
93930
93945
 
93931
93946
  // We will make a single Ball that multiple people can drag around
93932
93947
  // In the ZIM Frame here is the preparation and the code:
93933
93948
 
93934
93949
  // For the first parameter:
93935
- // The zimSocketURL comes from zimserver_urls.js and points to the ZIM Socket server.
93950
+ // The zimSocketURL comes from the import of zim_socket and points to the ZIM Socket server.
93936
93951
  // This way, if we change the server, the app will still work.
93937
93952
 
93938
93953
  // For the second parameter:
@@ -94080,6 +94095,7 @@ END EXAMPLE
94080
94095
  PARAMETERS
94081
94096
  ** supports DUO - parameters or single object with properties below
94082
94097
  server - (default https://localhost:3000) the server that is running node and the zimsocket.js : portNumber
94098
+ if using the ZIM socket server then this should be zimSocketURL which is defined in the zim_socket import
94083
94099
  appName - (required) a string id (one word or joined words) and unique for your app
94084
94100
  roomName - (default "default") optional room name otherwise just uses a default room (can represent many rooms if maxPeople is set)
94085
94101
  maxPeople - (default 0) how many people are allowed per room - default is 0 which is virtually unlimited