zimjs 16.4.3 → 16.4.5

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 +49 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zimjs",
3
- "version": "16.4.3",
3
+ "version": "16.4.5",
4
4
  "type": "module",
5
5
  "main": "./src/zim.js",
6
6
  "types": "./ts-src/typings/zim",
package/src/zim.js CHANGED
@@ -908,7 +908,7 @@ END EXAMPLE
908
908
 
909
909
  EXAMPLE
910
910
  // Remember the seed for a user with localStorage (like a cookie)
911
- const seed = rand(100000000);
911
+ let seed = rand(100000000);
912
912
  if (localStorage) {
913
913
  if (localStorage.seed) seed = localStorage.seed;
914
914
  else localStorage.seed = seed;
@@ -925,7 +925,7 @@ new Circle(100, [red, green, blue]).center().mov(0,300);
925
925
 
926
926
  seedRandom(); // clears the seed
927
927
  // below will be a random color each time
928
- new Circle(100, [red, green, blue]).center().mov(0,300);
928
+ new Circle(100, [red, green, blue]).center().mov(200,300);
929
929
  END EXAMPLE
930
930
 
931
931
  PARAMETERS
@@ -10020,12 +10020,14 @@ zim.Bitmap = function(image, width, height, left, top, scale, style, group, inhe
10020
10020
  displayCheck = true;
10021
10021
  var cached = image.cacheCanvas;
10022
10022
  var original = image;
10023
+ var bOriginal = original.getBounds();
10023
10024
  image.cache(left,top,width,height,scale); // do not chain on end as might be createjs image
10024
10025
  this.z_bc = image = image.cacheCanvas; // what we will pass to bitmap
10025
10026
  }
10026
10027
  }
10027
10028
  this.cjsBitmap_constructor(image);
10028
10029
  if (original && !cached) original.uncache();
10030
+ if (bOriginal) original.setBounds(bOriginal.x, bOriginal.y, bOriginal.width, bOriginal.height);
10029
10031
 
10030
10032
  var that = this;
10031
10033
  this.type = "Bitmap";
@@ -29648,7 +29650,7 @@ corner - (default 0) the corner radius if there is a backdropColor provided
29648
29650
  can also be an array of [topLeft, topRight, bottomRight, bottomLeft]
29649
29651
  indicatorType - (default "dot" or "circle") can also be "box" or "square", "heart", "star"
29650
29652
  or pass in a ZIM Emoji and Indicator will fade alpha to backgroundAlpha parameter setting for unselected emojis
29651
- or pass any display object and the this will be used
29653
+ or pass any display object and the this will be used
29652
29654
  fill - (default false) set to true to fill in lights to the left of the selectedIndex
29653
29655
  scale - (default 1) for all the lights including spacing
29654
29656
  lightScale - (default 1) scale for each light - keeping the spacing unchanged
@@ -29656,8 +29658,8 @@ interactive - (default false) set to true to make lights clickable
29656
29658
  clicking on first light when first light is only light on, will toggle light
29657
29659
  shadowColor - (default rgba(0,0,0,.3)) set to -1 for no shadow
29658
29660
  shadowBlur - (default 5) the shadow blur if shadow is set
29659
- selectedIndex - (default 0) - set the selectedIndex at start
29660
- backgroundAlpha - (default 1 or .2 if indicatorType is Emoji) - affects only Emoji indicatorType
29661
+ selectedIndex - (default 0) - set the selectedIndex at start. Use -1 for no indicator at start.
29662
+ backgroundAlpha - (default 1 or .2 if indicatorType is Emoji) - affects only Emoji and custom DisplayObject indicatorType
29661
29663
  style - (default true) set to false to ignore styles set with the STYLE - will receive original parameter defaults
29662
29664
  group - (default null) set to String (or comma delimited String) so STYLE can set default styles to the group(s) (like a CSS class)
29663
29665
  inherit - (default null) used internally but can receive an {} of styles directly
@@ -32593,6 +32595,13 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
32593
32595
  }
32594
32596
  next.y = height/2;
32595
32597
  }
32598
+
32599
+ }
32600
+
32601
+ if (arrows && rightForward===false) {
32602
+ // zim.swapProperties("x", next, prev);
32603
+ // zim.swapProperties("y", next, prev);
32604
+ // zim.swapProperties("rotation", next, prev);
32596
32605
  }
32597
32606
 
32598
32607
  // pressdown and move mouse changes speed and direction of stepper
@@ -32943,16 +32952,30 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
32943
32952
  arrowNext.color = arrowColor;
32944
32953
  next.cur("pointer");
32945
32954
  if (!continuous) {
32946
- if (stepperType == "number") {
32947
- if (index == that.min) {
32948
- if (numDir > 0) {greyPrev();} else {greyNext();}
32949
- }
32950
- if (index == that.max) {
32951
- if (numDir > 0) {greyNext();} else {greyPrev();}
32955
+ if (rightForward!==false) {
32956
+ if (stepperType == "number") {
32957
+ if (index == that.min) {
32958
+ if (numDir > 0) {greyPrev();} else {greyNext();}
32959
+ }
32960
+ if (index == that.max) {
32961
+ if (numDir > 0) {greyNext();} else {greyPrev();}
32962
+ }
32963
+ } else {
32964
+ if (index == 0) vertical?greyNext():greyPrev();
32965
+ if (index == list.length-1) vertical?greyPrev():greyNext();
32952
32966
  }
32953
32967
  } else {
32954
- if (index == 0) vertical?greyNext():greyPrev();
32955
- if (index == list.length-1) vertical?greyPrev():greyNext();
32968
+ if (stepperType == "number") {
32969
+ if (index == that.min) {
32970
+ if (numDir > 0) {greyNext();} else {greyPrev();}
32971
+ }
32972
+ if (index == that.max) {
32973
+ if (numDir > 0) {greyPrev();} else {greyNext();}
32974
+ }
32975
+ } else {
32976
+ if (index == 0) vertical?greyPrev():greyNext();
32977
+ if (index == list.length-1) vertical?greyNext():greyPrev();
32978
+ }
32956
32979
  }
32957
32980
  }
32958
32981
  }
@@ -42298,7 +42321,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
42298
42321
  draggable:true,
42299
42322
  });
42300
42323
  that.textArea = new zim.TextArea(Math.min(400, that.stage.width-70), Math.min(400, that.stage.height-70))
42301
- .centerReg(that.pane);
42324
+ that.pane.add(that.textArea);
42302
42325
  }
42303
42326
  that.pane.show();
42304
42327
  that.textArea.text = JSON.stringify(_steps);
@@ -46725,6 +46748,8 @@ Chainable function that sets the object's cursor to the type provided - same as
46725
46748
 
46726
46749
  NOTE: if using drag(), it will set its own cursor, so use the dragCursor parameter in that case.
46727
46750
 
46751
+ NOTE: there are also custom cursors as the cursors property of Frame.
46752
+
46728
46753
  EXAMPLE
46729
46754
  const circle = new Circle(10, red).center().cur(); // "pointer"
46730
46755
  circle.on("click", ()=>{zog("yes");});
@@ -52021,6 +52046,7 @@ sequence - (default 0) the delay time in seconds to run on children of a contain
52021
52046
  If the loop prop is true then sequenceCall below would activate for each loop
52022
52047
  For an array, you must use the zim function with a target parameter - otherwise you can use the ZIM 4TH method
52023
52048
  Note: a sequence cannot be seriesed and a series cannot be sequenced
52049
+ Note: for a sequence animate() give the animate() an id and pauseAnimate() or stopAnimate() that id.
52024
52050
  sequenceCall - (default null) the function that will be called for each sequence animation
52025
52051
  Note: the value of the sequenceCall parameter will be the object that just ended animation unless there is a sequenceParams value
52026
52052
  sequenceParams - (default null) a parameter sent to the sequenceCall function
@@ -52136,6 +52162,7 @@ PROPERTIES - zim.animate() adds the following properties to any object it animat
52136
52162
  even if other animations are still running.
52137
52163
  Pausing multiple objects should work fine.
52138
52164
  See the tweenState property to test which ids are animating or paused
52165
+ For a sequence animate() give the animate() an id and pauseAnimate() or stopAnimate() that id.
52139
52166
  waiting - read-only - true when animation is waiting in wait, rewindWait, loopWait
52140
52167
  tweenState - an object with tween ids as properties along with an all property (unless no tweens anymore)
52141
52168
  these properties are true if animating and false if paused
@@ -55016,6 +55043,8 @@ To stop a Shape tween, set an id in the animate call and use that id to stop the
55016
55043
  this is because the shape tween animation is not on the shape but on its many control points
55017
55044
  See also pauseAnimate()
55018
55045
 
55046
+ NOTE: for a sequence animate() give the animate() an id and pauseAnimate() or stopAnimate() that id.
55047
+
55019
55048
  NOTE: formerly stopZimAnimate - which still works but is depreciated
55020
55049
 
55021
55050
  NOTE: calling stopAnimate(id) stops tweens with this id on all objects
@@ -55103,6 +55132,8 @@ To pause a Shape tween, set an id in the animate call and use that id to pause t
55103
55132
  this is because the shape tween animation is not on the shape but on its many control points
55104
55133
  See also stopAnimate
55105
55134
 
55135
+ NOTE: for a sequence animate() give the animate() an id and pauseAnimate() or stopAnimate() that id.
55136
+
55106
55137
  NOTE: formerly pauseZimAnimate - which still works but is depreciated
55107
55138
 
55108
55139
  NOTE: calling pauseAnimate(true, id) pauses tweens with this id on all objects
@@ -57291,7 +57322,7 @@ EXAMPLE
57291
57322
  // setting TIMECHECK to true will test for any time over 10 as that may be ms
57292
57323
 
57293
57324
  TIMECHECK = true;
57294
- new Circle().center().wiggle("x", 100,200, 2000, 4000); // will give warning in console about time not being in MS
57325
+ new Circle().center().wiggle("x", 100,200, 2000, 4000); // will give warning in console about time not being in ms
57295
57326
  END EXAMPLE
57296
57327
  --*///+29.45
57297
57328
  zim.TIMECHECK = false;
@@ -58364,6 +58395,7 @@ you can define multiple pages objects add and remove pages objects as needed
58364
58395
 
58365
58396
  var swipeEvent = this.swipe.on("swipe", function(e) {
58366
58397
  if (!that.active) return;
58398
+ if (!that.parent) return;
58367
58399
  var direction = e.currentTarget.direction;
58368
58400
  if (direction == "none") return;
58369
58401
  // swap direction (swipe up means move down)
@@ -90106,8 +90138,8 @@ const ask = new CamAsk().show(yes=>{
90106
90138
  const camMotion = new CamMotion({
90107
90139
  visualizerColor:[green,orange,yellow,red,blue,purple,pink],
90108
90140
  visualizerBaseColor:clear,
90109
- visualizerScale:60,
90110
- visualizerBaseScale:10
90141
+ visualizerScale:6,
90142
+ visualizerBaseScale:1
90111
90143
  }).center();
90112
90144
 
90113
90145
  // Optionally adjust the circles