zimjs 16.1.2 → 16.1.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zimjs",
3
- "version": "16.1.2",
3
+ "version": "16.1.3",
4
4
  "type": "module",
5
5
  "main": "./src/zim.js",
6
6
  "types": "./ts-src/typings/zim",
package/src/zim.js CHANGED
@@ -15509,7 +15509,7 @@ approximateBounds(num, showPoints, margin) - update the bounds based on a Rectan
15509
15509
  addPoint(percent, controlType) - add a point at a percent (100) of the total curve
15510
15510
  this is handy to make path have the same number of points for animate() path tweens
15511
15511
  controlType can be as specified in main points parameter
15512
- returns object for chaining
15512
+ returns index of new point
15513
15513
  addPoints(num, controlType, startPoint, spread, dataOnly, points, even) - add num points between existing points
15514
15514
  controlType can be as specified in main points parameter
15515
15515
  specify a startPoint to add points between the startPoint and the next point (one segment of points)
@@ -17348,6 +17348,7 @@ Note the points property has been split into points and pointObjects (and there
17348
17348
  }
17349
17349
  if (controlType) newPoint[8] = controlType;
17350
17350
  points.splice(index+1, 0, newPoint);
17351
+ return index+1;
17351
17352
  }
17352
17353
 
17353
17354
  this.addPoint = function(percent, controlType) {
@@ -17356,10 +17357,10 @@ Note the points property has been split into points and pointObjects (and there
17356
17357
  var ratios = that.segmentRatios;
17357
17358
  var controls = that.pointControls;
17358
17359
  controlType = controlType ? controlType : originalControlType;
17359
- insertPointData(points, controls, ratios, percent, controlType);
17360
+ var index = insertPointData(points, controls, ratios, percent, controlType);
17360
17361
  that.points = points;
17361
17362
  that.num = points.length;
17362
- return that;
17363
+ return index;
17363
17364
  };
17364
17365
 
17365
17366
  this.removePoint = function(index) {
@@ -17637,7 +17638,7 @@ approximateBounds(num, showPoints) - update the bounds based on a Rectangle
17637
17638
  addPoint(percent, controlType) - add a point at a percent (100) of the total curve
17638
17639
  this is handy to make path have the same number of points for animate() path tweens
17639
17640
  controlType can be as specified in main points parameter
17640
- returns object for chaining
17641
+ returns index of new point
17641
17642
  addPoints(num, controlType, startPoint, spread, dataOnly, points, even) - add num points between existing points
17642
17643
  controlType can be as specified in main points parameter
17643
17644
  specify a startPoint to add points between the startPoint and the next point (one segment of points)
@@ -19532,6 +19533,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
19532
19533
  }
19533
19534
  if (controlType) newPoint[8] = controlType;
19534
19535
  points.splice(index+1, 0, newPoint);
19536
+ return index+1;
19535
19537
  }
19536
19538
 
19537
19539
  this.addPoint = function(percent, controlType) {
@@ -19540,10 +19542,10 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
19540
19542
  var ratios = that.segmentRatios;
19541
19543
  var controls = that.pointControls;
19542
19544
  controlType = controlType ? controlType : originalControlType;
19543
- insertPointData(points, controls, ratios, percent, controlType);
19545
+ var index = insertPointData(points, controls, ratios, percent, controlType);
19544
19546
  that.points = points;
19545
19547
  that.num = points.length;
19546
- return that;
19548
+ return index;
19547
19549
  };
19548
19550
 
19549
19551
  this.removePoint = function(index) {
@@ -44399,10 +44401,11 @@ S.on("stagemousemove", ()=>{
44399
44401
 
44400
44402
  // REMOVE METHOD
44401
44403
  // a remove() method is available on the event object
44402
- const circle = new Circle();
44404
+ const circle = new Circle().center();
44403
44405
  circle.on("mouseover", e=>{
44404
44406
  circle.alpha -= .1;
44405
44407
  if (circle.alpha <= .5) e.remove();
44408
+ S.update();
44406
44409
  });
44407
44410
  END EXAMPLE
44408
44411
 
@@ -89378,7 +89381,7 @@ addChild(), removeChild(), addChildAt(), getChildAt(), contains(), removeAllChil
89378
89381
  PROPERTIES
89379
89382
  type - name of class as a string
89380
89383
  ready - read only if the ready event has happened
89381
- ** these methods are available only once the WebCam "ready" event has happened
89384
+ ** these properties are available only once the WebCam "ready" event has happened
89382
89385
  tag - reference to the HTML video tag (created by ZIM to hold the cam video)
89383
89386
  display - reference to the ZIM Container that holds the bitmap of the video
89384
89387
  this is what is cached and has its cacheCanvas analyzed for motion
@@ -89644,7 +89647,7 @@ rawY - get the reported y undamped position of the motion - relative to the guid
89644
89647
  cam - reference to the ZIM WebCam object
89645
89648
  dampX - the horizontal Damp object
89646
89649
  dampY - the vertical Damp object
89647
- ** these methods are available only once the WebCam "ready" event has happened
89650
+ ** these properties are available only once the WebCam "ready" event has happened
89648
89651
  data - an array of motion data for each point with 0 for no motion and 1 for motion
89649
89652
  points - an array of point objects {x, y} that locate the test points relative to the obj parameter (default stage)
89650
89653
  camPoints - (used internally) an array of point objects {x, y} that locate the test points relative to the cam.bitmap
@@ -90427,62 +90430,62 @@ for (z_i = 0; z_i < globalFunctions.length; z_i++) {
90427
90430
  WW[pair[0]] = zim[pair[0]] = pair[1];
90428
90431
  }
90429
90432
 
90430
- if (zns) {
90431
- // these are global regardless
90432
- var globalsConstants = [
90433
- ["FIT", zim.FIT],
90434
- ["FILL", zim.FILL],
90435
- ["FULL", zim.FULL],
90436
- ["LEFT", zim.LEFT],
90437
- ["RIGHT", zim.RIGHT],
90438
- ["CENTER", zim.CENTER],
90439
- ["MIDDLE", zim.MIDDLE],
90440
- ["START", zim.START],
90441
- ["END", zim.END],
90442
- ["TOP", zim.TOP],
90443
- ["BOTTOM", zim.BOTTOM],
90444
- ["OVER", zim.OVER],
90445
- ["UNDER", zim.UNDER],
90446
- ["HORIZONTAL", zim.HORIZONTAL],
90447
- ["VERTICAL", zim.VERTICAL],
90448
- ["BOTH", zim.BOTH],
90449
- ["RADIAL", zim.RADIAL],
90450
- ["UP", zim.UP],
90451
- ["DOWN", zim.DOWN],
90452
- ["NEXT", zim.NEXT],
90453
- ["PREV", zim.PREV],
90454
- ["AUTO", zim.AUTO],
90455
- ["AVE", zim.AVE],
90456
- ["DEFAULT", zim.DEFAULT],
90457
- ["ALL", zim.ALL],
90458
- ["NONE", zim.NONE],
90459
- ["GET", zim.GET],
90460
- ["POST", zim.POST],
90461
- ["LOCALSTORAGE", zim.LOCALSTORAGE],
90462
- ["SOCKET", zim.SOCKET],
90463
- ["TO", zim.TO],
90464
- ["FROM", zim.FROM],
90465
- ["SINE", zim.SINE],
90466
- ["SQUARE", zim.SQUARE],
90467
- ["TRIANGLE", zim.TRIANGLE],
90468
- ["SAW", zim.SAW],
90469
- ["SAWTOOTH", zim.SAWTOOTH],
90470
- ["ZAP", zim.ZAP],
90471
- ["TAU", zim.TAU],
90472
- ["DEG", zim.DEG],
90473
- ["RAD", zim.RAD],
90474
- ["PHI", zim.PHI],
90475
- ];
90476
-
90477
- for (z_i = 0; z_i < globalsConstants.length; z_i++) {
90478
- var pair = globalsConstants[z_i];
90479
- WW[pair[0]] = pair[1];
90480
- }
90481
-
90482
- for (z_i = 0; z_i < zim.colors.length; z_i++) {
90483
- WW[zim.colors[z_i]] = zim.colorsHex[z_i];
90484
- }
90485
- } else zimplify();
90433
+
90434
+ // these are global regardless
90435
+ var globalsConstants = [
90436
+ ["FIT", zim.FIT],
90437
+ ["FILL", zim.FILL],
90438
+ ["FULL", zim.FULL],
90439
+ ["LEFT", zim.LEFT],
90440
+ ["RIGHT", zim.RIGHT],
90441
+ ["CENTER", zim.CENTER],
90442
+ ["MIDDLE", zim.MIDDLE],
90443
+ ["START", zim.START],
90444
+ ["END", zim.END],
90445
+ ["TOP", zim.TOP],
90446
+ ["BOTTOM", zim.BOTTOM],
90447
+ ["OVER", zim.OVER],
90448
+ ["UNDER", zim.UNDER],
90449
+ ["HORIZONTAL", zim.HORIZONTAL],
90450
+ ["VERTICAL", zim.VERTICAL],
90451
+ ["BOTH", zim.BOTH],
90452
+ ["RADIAL", zim.RADIAL],
90453
+ ["UP", zim.UP],
90454
+ ["DOWN", zim.DOWN],
90455
+ ["NEXT", zim.NEXT],
90456
+ ["PREV", zim.PREV],
90457
+ ["AUTO", zim.AUTO],
90458
+ ["AVE", zim.AVE],
90459
+ ["DEFAULT", zim.DEFAULT],
90460
+ ["ALL", zim.ALL],
90461
+ ["NONE", zim.NONE],
90462
+ ["GET", zim.GET],
90463
+ ["POST", zim.POST],
90464
+ ["LOCALSTORAGE", zim.LOCALSTORAGE],
90465
+ ["SOCKET", zim.SOCKET],
90466
+ ["TO", zim.TO],
90467
+ ["FROM", zim.FROM],
90468
+ ["SINE", zim.SINE],
90469
+ ["SQUARE", zim.SQUARE],
90470
+ ["TRIANGLE", zim.TRIANGLE],
90471
+ ["SAW", zim.SAW],
90472
+ ["SAWTOOTH", zim.SAWTOOTH],
90473
+ ["ZAP", zim.ZAP],
90474
+ ["TAU", zim.TAU],
90475
+ ["DEG", zim.DEG],
90476
+ ["RAD", zim.RAD],
90477
+ ["PHI", zim.PHI],
90478
+ ];
90479
+
90480
+ for (z_i = 0; z_i < globalsConstants.length; z_i++) {
90481
+ var pair = globalsConstants[z_i];
90482
+ WW[pair[0]] = pair[1];
90483
+ }
90484
+
90485
+ for (z_i = 0; z_i < zim.colors.length; z_i++) {
90486
+ WW[zim.colors[z_i]] = zim.colorsHex[z_i];
90487
+ }
90488
+
90486
90489
 
90487
90490
  WW.zim = zim;
90488
90491
  export default zim;
@@ -435,7 +435,7 @@ declare namespace zim {
435
435
  loop(number: number, call: Function): any
436
436
  static choose(choice: any): any
437
437
  static rand(a?: number, b?: number, integer?: boolean, negative?: boolean): number
438
- static series(array_item: any): Function
438
+ static series(...array_item: any): Function
439
439
  static getMinMax(vee: zimVee): {}
440
440
  type: string
441
441
  choices: any
@@ -597,8 +597,7 @@ declare namespace zim {
597
597
  export function makeSyllable(length?: number, firstValue?: boolean): string
598
598
  export function makePrimitive(obj: any): string | number | boolean
599
599
  export function makeMath(): void
600
- export function series(array_item: any): Function
601
- export function makeSeries(array: [any]): Function
600
+ export function series(...array_item: any): Function
602
601
  export function smoothStep(num: number, min: number, max: number): number
603
602
  export function unicodeToUTF(val: string): string
604
603
  export function capitalizeFirst(string: string): string
@@ -2903,6 +2902,7 @@ declare namespace zim {
2903
2902
  static makeBacking(width?: number, height?: number, text?: string, color?: color): Container
2904
2903
  readonly interactive: boolean
2905
2904
  readonly animated: boolean
2905
+ readonly canvas: HTMLCanvasElement
2906
2906
  backingOrbit: boolean
2907
2907
  }
2908
2908
  export class TextureActives extends createjs.EventDispatcher {