zimjs 18.0.8 → 18.1.0
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 +1 -1
- package/src/zim.js +249 -82
package/package.json
CHANGED
package/src/zim.js
CHANGED
|
@@ -2239,7 +2239,7 @@ function myFunction(data){
|
|
|
2239
2239
|
// in the php file we would use the following to return JSON:
|
|
2240
2240
|
<?php
|
|
2241
2241
|
header('Content-type: text/javascript');
|
|
2242
|
-
$data = [test=>"wow", score=>[1,2,3]];
|
|
2242
|
+
$data = ["test"=>"wow", "score"=>[1,2,3]];
|
|
2243
2243
|
echo "async.myFunction(".JSON_encode($data).")";
|
|
2244
2244
|
?>
|
|
2245
2245
|
|
|
@@ -11354,7 +11354,7 @@ it will still scale when using the corners. This can be turned off by setting s
|
|
|
11354
11354
|
|
|
11355
11355
|
Properties for the slice lines are available and can be set and animated as can the scalesWidth and scalesHeight.
|
|
11356
11356
|
|
|
11357
|
-
SEE: https://zimjs.com/
|
|
11357
|
+
SEE: https://zimjs.com/slicer for the ZIM Slices tool and example of SlicedBitmap
|
|
11358
11358
|
|
|
11359
11359
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
11360
11360
|
|
|
@@ -11804,6 +11804,8 @@ but we found the framerate could not be kept
|
|
|
11804
11804
|
with other animations or Ticker events running.
|
|
11805
11805
|
So we recommend using the ZIM Sprite run() method.
|
|
11806
11806
|
|
|
11807
|
+
NOTE: when applying an effect to a Sprite, put the sprite in a Container and apply the effect on the container
|
|
11808
|
+
|
|
11807
11809
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
11808
11810
|
|
|
11809
11811
|
EXAMPLE
|
|
@@ -22641,13 +22643,12 @@ zim class - extends a zim.Container which extends a createjs.Container
|
|
|
22641
22643
|
|
|
22642
22644
|
DESCRIPTION
|
|
22643
22645
|
Makes a label - wraps the createjs Text object.
|
|
22644
|
-
Can use with Button, CheckBox, RadioButtons
|
|
22645
|
-
|
|
22646
|
-
|
|
22647
|
-
|
|
22646
|
+
Can also use with Button, CheckBox, RadioButtons, Pane, etc.
|
|
22647
|
+
System fonts, Google fonts and custom fonts can be used.
|
|
22648
|
+
|
|
22649
|
+
NOTE: can wrap text at given width using labelWidth (or lineWidth) parameter.
|
|
22648
22650
|
|
|
22649
|
-
NOTE: can
|
|
22650
|
-
To dynamically change the width without changing the font size use the labelWidth property.
|
|
22651
|
+
NOTE: can make text fit to dimensions by setting both labelWidth and labelHeight parameters.
|
|
22651
22652
|
|
|
22652
22653
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
22653
22654
|
|
|
@@ -22665,6 +22666,16 @@ new Label({
|
|
|
22665
22666
|
}).loc(100,100).tap(()=>{zog("tapping");});
|
|
22666
22667
|
END EXAMPLE
|
|
22667
22668
|
|
|
22669
|
+
EXAMPLE
|
|
22670
|
+
// using the Google Font gf_ short cut for "Joti+One"
|
|
22671
|
+
// and also a custom font (Reuben) that would be in the assets folder
|
|
22672
|
+
new Frame(FIT, 1024, 768, ready ["gf_Joti+One", "Reuben.otf"], "assets/");
|
|
22673
|
+
function ready() {
|
|
22674
|
+
new Label("Hello", 100, "Joti One").loc(100,100);
|
|
22675
|
+
new Label("Greets", 50, "Reuben").center();
|
|
22676
|
+
}
|
|
22677
|
+
END EXAMPLE
|
|
22678
|
+
|
|
22668
22679
|
EXAMPLE
|
|
22669
22680
|
// with text that wraps at labelWidth
|
|
22670
22681
|
// can also set this as a property later to dynamically change width of text
|
|
@@ -22675,6 +22686,17 @@ new Label({
|
|
|
22675
22686
|
}).center();
|
|
22676
22687
|
END EXAMPLE
|
|
22677
22688
|
|
|
22689
|
+
EXAMPLE
|
|
22690
|
+
// with text that fits into labelWidth and labelHeight
|
|
22691
|
+
// will change font size.
|
|
22692
|
+
new Label({
|
|
22693
|
+
text:"Fit this text into the width and height",
|
|
22694
|
+
labelWidth:300,
|
|
22695
|
+
labelHeight:150,
|
|
22696
|
+
align:CENTER
|
|
22697
|
+
}).center().outline();
|
|
22698
|
+
END EXAMPLE
|
|
22699
|
+
|
|
22678
22700
|
EXAMPLE
|
|
22679
22701
|
STYLE = {font:"courier"};
|
|
22680
22702
|
new Label("Hi Courier").center(); // will be courier not arial
|
|
@@ -27546,6 +27568,7 @@ Adds a window for alerts, etc.
|
|
|
27546
27568
|
You need to call the pane.show() to show the pane and pane.hide() to hide it.
|
|
27547
27569
|
You do not need to add it to the stage - it adds itself centered.
|
|
27548
27570
|
You can change the x and y (the origin and registration point are in the middle).
|
|
27571
|
+
Content is added to the pane with the content parameter or the add() method.
|
|
27549
27572
|
|
|
27550
27573
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
27551
27574
|
|
|
@@ -28157,7 +28180,8 @@ zim class - extends a zim.Container which extends a createjs.Container
|
|
|
28157
28180
|
|
|
28158
28181
|
DESCRIPTION
|
|
28159
28182
|
A simple panel with titleBar and optional arrow for more panels.
|
|
28160
|
-
Panel can be set draggable and can have a collapse button and a close button
|
|
28183
|
+
Panel can be set draggable and can have a collapse button and a close button.
|
|
28184
|
+
Content is added to the panel with the content parameter or the add() method.
|
|
28161
28185
|
See: https://zimjs.com/explore/panel.html
|
|
28162
28186
|
|
|
28163
28187
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
@@ -28694,6 +28718,8 @@ zim class - extends a zim.Container which extends a createjs.Container
|
|
|
28694
28718
|
|
|
28695
28719
|
DESCRIPTION
|
|
28696
28720
|
Adds a window for content that can be swiped and scrolled.
|
|
28721
|
+
Content is added to the Window with the content parameter or the add() method.
|
|
28722
|
+
|
|
28697
28723
|
NOTE: if zim namespace zns = true then this overwrites a JS Window - so the JS Window is stored as document.Window
|
|
28698
28724
|
|
|
28699
28725
|
NOTE: set the enable property to false if animating the position of the whole Window
|
|
@@ -48724,7 +48750,6 @@ shadowColor - (default null) the shadow color (css color) of a drop shadow
|
|
|
48724
48750
|
shadowBlur - (default null) pixels of how blurred the shadow is if the shadow is set - eg. 10
|
|
48725
48751
|
dashed - (default true) set to false to turn off the dashed for the border
|
|
48726
48752
|
id - (default null) a string id for the HTML textarea tag for CSS styling, etc.
|
|
48727
|
-
placeholder - (default null) a string that is used for the HTML textarea tag placeholder parameter
|
|
48728
48753
|
readOnly - (default false) set to true to make TextArea read only (still selectable)
|
|
48729
48754
|
spellCheck - (default true) set to false to turn Browser spell check off
|
|
48730
48755
|
password - (default false) set to true to turn the field into a password field - single line only (uses input field type=password and not TextArea)
|
|
@@ -55506,6 +55531,8 @@ Keep the quality at 1 for animating filters at a decent framerate.
|
|
|
55506
55531
|
Consider pre-processing images if effects do not have to be dynamic.
|
|
55507
55532
|
|
|
55508
55533
|
NOTE: when applying effects to rtl fonts make sure the DIR = "rtl" is set.
|
|
55534
|
+
|
|
55535
|
+
NOTE: when applying an effect to a Sprite, put the sprite in a Container and apply the effect on the container
|
|
55509
55536
|
|
|
55510
55537
|
EXAMPLE
|
|
55511
55538
|
// create a Label with a GlowEffect that shows through to the image below
|
|
@@ -56591,7 +56618,7 @@ RETURNS an index Number (or undefined) | col | row | an Array of [index, col, ro
|
|
|
56591
56618
|
// SUBSECTION ANIMATE, WIGGLE, LOOP
|
|
56592
56619
|
|
|
56593
56620
|
/*--
|
|
56594
|
-
obj.animate = function(props, time, ease, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startCall, startParams, animateCall, animateParams, sequence, sequenceCall, sequenceParams, sequenceReverse, sequenceRatio, ticker, cjsProps, css, protect, override, from, set, id, events, sequenceTarget, dynamic, drag, clamp, startPaused, clean, obj, seriesWait, sequenceWait, rate, pauseOnBlur, easeAmount, easeFrequency, timeUnit, timeCheck, noAnimateCall, pathDamp)
|
|
56621
|
+
obj.animate = function(props, time, ease, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startCall, startParams, animateCall, animateParams, sequence, sequenceCall, sequenceParams, sequenceReverse, sequenceRatio, ticker, cjsProps, css, protect, override, from, set, id, events, sequenceTarget, dynamic, drag, clamp, startPaused, clean, obj, seriesWait, sequenceWait, rate, pauseOnBlur, easeAmount, easeFrequency, timeUnit, timeCheck, noAnimateCall, pathDamp, rewindPick)
|
|
56595
56622
|
|
|
56596
56623
|
animate
|
|
56597
56624
|
zim DisplayObject method
|
|
@@ -56807,6 +56834,18 @@ const line = new Squiggle().center();
|
|
|
56807
56834
|
new Circle(10, red).addTo().animate({path:line}, 1);
|
|
56808
56835
|
END EXAMPLE
|
|
56809
56836
|
|
|
56837
|
+
EXAMPLE
|
|
56838
|
+
// animate across colors
|
|
56839
|
+
const colors = series("#f0f","#0f0","#00f","#f00","#ff0").mix();
|
|
56840
|
+
new Rectangle(W,H,colors)
|
|
56841
|
+
.addTo()
|
|
56842
|
+
.animate({
|
|
56843
|
+
props:{color:colors},
|
|
56844
|
+
loopPick:true,
|
|
56845
|
+
rewindPick:true
|
|
56846
|
+
});
|
|
56847
|
+
END EXAMPLE
|
|
56848
|
+
|
|
56810
56849
|
PARAMETERS
|
|
56811
56850
|
** supports DUO - parameters or single object with properties below
|
|
56812
56851
|
** supports VEE - parameters marked with ZIM VEE mean a zim Pick() object or Pick Literal can be passed
|
|
@@ -56954,6 +56993,7 @@ call - (default null) the function to call when the animation is done
|
|
|
56954
56993
|
params - (default target) a single parameter for the call function (eg. use object literal or array)
|
|
56955
56994
|
wait - |ZIM VEE| (default 0) seconds to wait before doing animation
|
|
56956
56995
|
can be negative for series to start animation before previous animation ends
|
|
56996
|
+
also see the waiting property
|
|
56957
56997
|
waitedCall - (default null) calls function after wait is done if there is a wait
|
|
56958
56998
|
waitedParams - (default target) parameters to send waitedCall function
|
|
56959
56999
|
loop - (default false) set to true to loop animation
|
|
@@ -56976,7 +57016,6 @@ rewindEase - (default null) overwrite the ease for the rewind direction
|
|
|
56976
57016
|
so setting rewindEase:"bounceOut" will bounce back at the start of the animation
|
|
56977
57017
|
note - setting ease:"bounceOut" will bounce at the end of the animation
|
|
56978
57018
|
this allows for a normal start with a bounce and then a normal start at rewind and a bounce
|
|
56979
|
-
|
|
56980
57019
|
startCall - (default null) calls function at the start of actual animation and after any wait (and waitedCall)
|
|
56981
57020
|
this is basically the same as the waitedCall but will also be called at the start of animation when there is no waitedCall
|
|
56982
57021
|
startParams - (default target) parameters to send startCall function
|
|
@@ -57098,6 +57137,12 @@ timeUnit - (default TIME) override the TIME setting to "seconds" / "s" or "milli
|
|
|
57098
57137
|
timeCheck - (default true) set to false to not have animate() warn of potentially wrong time units - see also TIMECHECK
|
|
57099
57138
|
noAnimateCall - (default true) set to false to not call the callback function if ANIMATE is set to false
|
|
57100
57139
|
pathDamp - (default .15) damping for drag along path
|
|
57140
|
+
rewindPick - (default false) set to true to pick from props as it rewinds
|
|
57141
|
+
this will be moved to the other rewind parameters in ZIM 019
|
|
57142
|
+
also see loopPick - using both loopPick and rewindPick will act like a series
|
|
57143
|
+
where if the property has a series it will animate one after the other
|
|
57144
|
+
do not use if the property is just a regular value as it will appear to stop the animation.
|
|
57145
|
+
Can use a series, results of a function, min max or array for random picks
|
|
57101
57146
|
|
|
57102
57147
|
PROPERTIES - zim.animate() adds the following properties to any object it animates:
|
|
57103
57148
|
animating - read-only - true when animating (including when waiting)
|
|
@@ -57168,8 +57213,8 @@ EVENTS - zim animate() will add an "animation" event to the target IF the events
|
|
|
57168
57213
|
|
|
57169
57214
|
RETURNS the target for chaining (or null if no target is provided and run on zim with series)
|
|
57170
57215
|
--*///+45
|
|
57171
|
-
zim.animate = function(target, props, time, ease, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startCall, startParams, animateCall, animateParams, sequence, sequenceCall, sequenceParams, sequenceReverse, sequenceRatio, ticker, cjsProps, css, protect, override, from, set, id, events, sequenceTarget, dynamic, drag, clamp, startPaused, clean, obj, seriesWait, sequenceWait, rate, pauseOnBlur, easeAmount, easeFrequency, timeUnit, timeCheck, noAnimateCall, pathDamp) {
|
|
57172
|
-
var sig = "target, props, time, ease, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startCall, startParams, animateCall, animateParams, sequence, sequenceCall, sequenceParams, sequenceReverse, sequenceRatio, ticker, cjsProps, css, protect, override, from, set, id, events, sequenceTarget, dynamic, drag, clamp, startPaused, clean, obj, seriesWait, sequenceWait, rate, pauseOnBlur, easeAmount, easeFrequency, timeUnit, timeCheck, noAnimateCall, pathDamp";
|
|
57216
|
+
zim.animate = function(target, props, time, ease, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startCall, startParams, animateCall, animateParams, sequence, sequenceCall, sequenceParams, sequenceReverse, sequenceRatio, ticker, cjsProps, css, protect, override, from, set, id, events, sequenceTarget, dynamic, drag, clamp, startPaused, clean, obj, seriesWait, sequenceWait, rate, pauseOnBlur, easeAmount, easeFrequency, timeUnit, timeCheck, noAnimateCall, pathDamp, rewindPick) {
|
|
57217
|
+
var sig = "target, props, time, ease, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startCall, startParams, animateCall, animateParams, sequence, sequenceCall, sequenceParams, sequenceReverse, sequenceRatio, ticker, cjsProps, css, protect, override, from, set, id, events, sequenceTarget, dynamic, drag, clamp, startPaused, clean, obj, seriesWait, sequenceWait, rate, pauseOnBlur, easeAmount, easeFrequency, timeUnit, timeCheck, noAnimateCall, pathDamp, rewindPick";
|
|
57173
57218
|
|
|
57174
57219
|
if (target && (target.props || target.obj)) {
|
|
57175
57220
|
var duo; if (duo = zob(zim.animate, arguments, sig)) return duo;
|
|
@@ -57190,8 +57235,8 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
57190
57235
|
// last param is noWarning - sent internal as false by wiggle for instance
|
|
57191
57236
|
var timeType = getTIME(null, timeUnit, null, null, zot(timeCheck)?false:!timeCheck);
|
|
57192
57237
|
|
|
57193
|
-
if (
|
|
57194
|
-
if (
|
|
57238
|
+
if (loopCall || loopWait || loopPick || loopCount) loop = true;
|
|
57239
|
+
if (rewindCall || rewindWait || rewindPick || rewindTime || rewindEase) rewind = true;
|
|
57195
57240
|
|
|
57196
57241
|
var i, prop, currentCount;
|
|
57197
57242
|
var startArguments = arguments;
|
|
@@ -57341,7 +57386,6 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
57341
57386
|
sequenceTarget.animating = true;
|
|
57342
57387
|
}
|
|
57343
57388
|
function sequenceDone() {
|
|
57344
|
-
sequenceTarget.animating = false;
|
|
57345
57389
|
if (call) call(params||sequenceTarget);
|
|
57346
57390
|
}
|
|
57347
57391
|
|
|
@@ -57389,7 +57433,7 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
57389
57433
|
if (i==0 && sequence!=0) seqTime = timeType=="s"?.02:20; // patched in 10.7.0 and 10.7.1
|
|
57390
57434
|
|
|
57391
57435
|
// zim.animate(tar, tar.zimObj, time, ease, (i==target.length-1?call:null), (i==target.length-1?params:null)
|
|
57392
|
-
zim.animate(tar, tar.zimObj, time, ease, (i==target.length-1?sequenceDone:null), null, wait, waitedCall, waitedParams, null, null, null, null, null, null, null, loopPick, null, null, null, null, null, null, rewindTime, rewindEase, startCall, startParams, animateCall, animateParams, null, sequenceCall, sequenceParams, null, null, ticker, zim.copy(cjsProps), css, protect, override, null, set, id, events, sequenceTarget, dynamic, drag, clamp, startPaused, clean, obj, seriesWait, seqTime, rrr, pauseOnBlur, easeAmount, easeFrequency, timeUnit, timeCheck, noAnimateCall, pathDamp); // do not send from!
|
|
57436
|
+
zim.animate(tar, tar.zimObj, time, ease, (i==target.length-1?sequenceDone:null), null, wait, waitedCall, waitedParams, null, null, null, null, null, null, null, loopPick, null, null, null, null, null, null, rewindTime, rewindEase, startCall, startParams, animateCall, animateParams, null, sequenceCall, sequenceParams, null, null, ticker, zim.copy(cjsProps), css, protect, override, null, set, id, events, sequenceTarget, dynamic, drag, clamp, startPaused, clean, obj, seriesWait, seqTime, rrr, pauseOnBlur, easeAmount, easeFrequency, timeUnit, timeCheck, noAnimateCall, pathDamp, rewindPick); // do not send from!
|
|
57393
57437
|
|
|
57394
57438
|
}
|
|
57395
57439
|
return sequenceTarget;
|
|
@@ -57737,7 +57781,7 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
57737
57781
|
}
|
|
57738
57782
|
}
|
|
57739
57783
|
|
|
57740
|
-
props, time, ease, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startCall, startParams, animateCall, animateParams, sequence, sequenceCall, sequenceParams, sequenceReverse, sequenceRatio, ticker, cjsProps, css, protect, override, from, set, id, events, sequenceTarget, dynamic, drag, clamp, startPaused, clean, obj, seriesWait, sequenceWait, rate, pauseOnBlur, easeAmount, easeFrequency, timeUnit, timeCheck, noAnimateCall, pathDamp
|
|
57784
|
+
// props, time, ease, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startCall, startParams, animateCall, animateParams, sequence, sequenceCall, sequenceParams, sequenceReverse, sequenceRatio, ticker, cjsProps, css, protect, override, from, set, id, events, sequenceTarget, dynamic, drag, clamp, startPaused, clean, obj, seriesWait, sequenceWait, rate, pauseOnBlur, easeAmount, easeFrequency, timeUnit, timeCheck, noAnimateCall, pathDamp, rewindPick
|
|
57741
57785
|
|
|
57742
57786
|
|
|
57743
57787
|
// -----------------------------
|
|
@@ -57747,7 +57791,6 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
57747
57791
|
if (!target.tweenStates) target.tweenStates = {all:true};
|
|
57748
57792
|
|
|
57749
57793
|
var fromCheck = false;
|
|
57750
|
-
|
|
57751
57794
|
|
|
57752
57795
|
// Handle notes
|
|
57753
57796
|
if (obj.note) {
|
|
@@ -58691,7 +58734,7 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
58691
58734
|
sequenceWait:sequenceWait
|
|
58692
58735
|
}
|
|
58693
58736
|
|
|
58694
|
-
function doLoopCall() {
|
|
58737
|
+
function doLoopCall() {
|
|
58695
58738
|
if (wait3>0) target.waiting = false;
|
|
58696
58739
|
if (!cjsProps.loop) return; // added Cat 03 - was being called even if not looping
|
|
58697
58740
|
if (sequenceCall && typeof sequenceCall == 'function') {
|
|
@@ -58718,12 +58761,24 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
58718
58761
|
adjustedScale = zim.Pick.choose(savedPicks.scale, null, target);
|
|
58719
58762
|
}
|
|
58720
58763
|
|
|
58764
|
+
|
|
58765
|
+
|
|
58721
58766
|
if (!from) {
|
|
58767
|
+
|
|
58722
58768
|
if (tween.step && tween.step.prev && tween.step.prev.props) {
|
|
58723
58769
|
for (var i in tween.step.prev.props) {
|
|
58724
58770
|
if (extraTypes.indexOf(i) >= 0) continue; // skip for extras
|
|
58725
58771
|
var p = zim.Pick.choose(savedPicks[i], null, target);
|
|
58726
58772
|
|
|
58773
|
+
// handle color at loop - ZIM 018
|
|
58774
|
+
if (i=="colorRange") i = "color"
|
|
58775
|
+
var p = zim.Pick.choose(savedPicks[i], null, target);
|
|
58776
|
+
if (i=="color") i = "colorRange";
|
|
58777
|
+
if (target.setColorRange && i=="colorRange") {
|
|
58778
|
+
target.setColorRange(target.color, p);
|
|
58779
|
+
continue;
|
|
58780
|
+
}
|
|
58781
|
+
|
|
58727
58782
|
// also handle relative
|
|
58728
58783
|
if (typeof p == "string" && i != "transform") {
|
|
58729
58784
|
if (p.substr(0,1) != "+" && p.substr(0,1) != "-") {
|
|
@@ -58738,7 +58793,7 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
58738
58793
|
|
|
58739
58794
|
// ZIM ZIM 02 patch to make non-rewind work with loopPick
|
|
58740
58795
|
// the difference seems to be using tween.step.prev for rewind and tween.step for non-rewind
|
|
58741
|
-
// we had tween.step.prev for both since the
|
|
58796
|
+
// we had tween.step.prev for both since the begining - we must not have tested on a non-rewind
|
|
58742
58797
|
if (rewind) {
|
|
58743
58798
|
if (!zot(savedPicks[i])) tween.step.prev.props[i] = p;
|
|
58744
58799
|
if (i=="scaleX" && !zot(adjustedScale)) tween.step.prev.props.scaleX = adjustedScale;
|
|
@@ -58793,7 +58848,7 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
58793
58848
|
params6 = cjsProps.startParams;
|
|
58794
58849
|
delete cjsProps.startParams;
|
|
58795
58850
|
}
|
|
58796
|
-
function doStartCall(tween) {
|
|
58851
|
+
function doStartCall(tween) {
|
|
58797
58852
|
if (tween.startCalled) return;
|
|
58798
58853
|
tween.startCalled = true;
|
|
58799
58854
|
if (call6 && typeof call6 == 'function') {(call6)(params6||target);}
|
|
@@ -58935,11 +58990,65 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
58935
58990
|
|
|
58936
58991
|
// REWIND TWEENS
|
|
58937
58992
|
|
|
58938
|
-
function doRewindCall() {
|
|
58993
|
+
function doRewindCall() {
|
|
58994
|
+
// ADDED in ZIM 018
|
|
58995
|
+
|
|
58996
|
+
if (!from && rewindPick) {
|
|
58997
|
+
|
|
58998
|
+
var adjustedScale;
|
|
58999
|
+
if (!zot(savedPicks.scale)) {
|
|
59000
|
+
adjustedScale = zim.Pick.choose(savedPicks.scale, null, target);
|
|
59001
|
+
}
|
|
59002
|
+
|
|
59003
|
+
if (tween.step && tween.step.props) {
|
|
59004
|
+
for (var i in tween.step.props) {
|
|
59005
|
+
if (extraTypes.indexOf(i) >= 0) continue; // skip for extras
|
|
59006
|
+
|
|
59007
|
+
// handle color at rewind - ZIM 018
|
|
59008
|
+
if (i=="colorRange") i = "color"
|
|
59009
|
+
var p = zim.Pick.choose(savedPicks[i], null, target);
|
|
59010
|
+
if (i=="color") i = "colorRange";
|
|
59011
|
+
if (target.setColorRange && i=="colorRange") {
|
|
59012
|
+
target.setColorRange(p, target.color);
|
|
59013
|
+
continue;
|
|
59014
|
+
}
|
|
59015
|
+
|
|
59016
|
+
// also handle relative
|
|
59017
|
+
if (typeof p == "string" && i != "transform") {
|
|
59018
|
+
if (p.substr(0,1) != "+" && p.substr(0,1) != "-") {
|
|
59019
|
+
var newStart;
|
|
59020
|
+
if (target.zimLastObj && !zot(target.zimLastObj[i])) newStart = target.zimLastObj[i];
|
|
59021
|
+
else newStart = target[i];
|
|
59022
|
+
p = newStart + Number(p.replace(/\s/g,""));
|
|
59023
|
+
}
|
|
59024
|
+
}
|
|
59025
|
+
// end handle relative
|
|
59026
|
+
|
|
59027
|
+
// target.zimLastObj[i] = rewind?target.zimTweenOriginals[i]:p;
|
|
59028
|
+
target.zimLastObj[i] = p;
|
|
59029
|
+
|
|
59030
|
+
if (!zot(savedPicks[i])) {
|
|
59031
|
+
tween.step.props[i] = p; // sets the rewind property
|
|
59032
|
+
tween._stepHead.props[i] = p; // sets the start of a loop to end of rewind
|
|
59033
|
+
}
|
|
59034
|
+
if (i=="scaleX" && !zot(adjustedScale)) {
|
|
59035
|
+
tween.step.props.scaleX = adjustedScale;
|
|
59036
|
+
tween._stepHead.props.scaleX = adjustedScale;
|
|
59037
|
+
}
|
|
59038
|
+
if (i=="scaleY" && !zot(adjustedScale)) {
|
|
59039
|
+
tween.step.props.scaleY = adjustedScale;
|
|
59040
|
+
tween._stepHead.props.scaleY = adjustedScale;
|
|
59041
|
+
}
|
|
59042
|
+
|
|
59043
|
+
}
|
|
59044
|
+
}
|
|
59045
|
+
}
|
|
59046
|
+
// END ADDED in ZIM 018
|
|
59047
|
+
|
|
58939
59048
|
if (wait2>0) target.waiting = false;
|
|
58940
59049
|
if (call2 && typeof call2 == 'function') {(call2)(params2);}
|
|
58941
59050
|
}
|
|
58942
|
-
function doRewindWaitCall() {
|
|
59051
|
+
function doRewindWaitCall() {
|
|
58943
59052
|
if (wait2>0) target.waiting = true;
|
|
58944
59053
|
if (call5 && typeof call5 == 'function') {(call5)(params5);}
|
|
58945
59054
|
}
|
|
@@ -58963,23 +59072,28 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
58963
59072
|
}
|
|
58964
59073
|
|
|
58965
59074
|
var startTest = false;
|
|
58966
|
-
var obj2;
|
|
59075
|
+
var obj2;
|
|
59076
|
+
|
|
58967
59077
|
function tween1(lastTween) {
|
|
58968
59078
|
if (!startTest) {
|
|
58969
|
-
obj2 = getStart();
|
|
58970
|
-
startTest = true;
|
|
58971
|
-
}
|
|
58972
|
-
|
|
59079
|
+
obj2 = getStart();
|
|
59080
|
+
startTest = true;
|
|
59081
|
+
}
|
|
59082
|
+
|
|
59083
|
+
if (target.set && !from) target.set(set);
|
|
58973
59084
|
tween = target.zimTweens[id] = target.zimTween = createjs.Tween.get(target, cjsProps)
|
|
58974
|
-
.call(doStartCall)
|
|
59085
|
+
.call(doStartCall)
|
|
58975
59086
|
.to(obj, t, finalEase)
|
|
58976
59087
|
.call(doRewindWaitCall)
|
|
58977
59088
|
.wait(wait2, true)
|
|
58978
59089
|
.call(doRewindCall)
|
|
58979
|
-
|
|
59090
|
+
// this is hard coded... need to inject a different obj2 into createjs tween
|
|
59091
|
+
// and activate the code in doStartCall that makes loop start at end of new rewind
|
|
59092
|
+
.to(obj2, t2, finalEase2)
|
|
58980
59093
|
.call(doneAnimating)
|
|
58981
59094
|
.wait(wait3, true)
|
|
58982
59095
|
.call(doLoopCall);
|
|
59096
|
+
|
|
58983
59097
|
tween.timeScale = target.futureRate;
|
|
58984
59098
|
if (lastTween) transferIds(lastTween, tween);
|
|
58985
59099
|
setZimTweenProps();
|
|
@@ -59416,20 +59530,20 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
59416
59530
|
return;
|
|
59417
59531
|
}
|
|
59418
59532
|
if (cjsProps.loop) {
|
|
59419
|
-
if (count > 0) {
|
|
59533
|
+
if (count > 0) {
|
|
59420
59534
|
if (currentCount < count) {
|
|
59421
59535
|
if (wait3>0) target.waiting = true;
|
|
59422
59536
|
doLoopWaitCall();
|
|
59423
59537
|
currentCount++;
|
|
59424
59538
|
return;
|
|
59425
59539
|
} else {
|
|
59426
|
-
if (rewind) {
|
|
59540
|
+
if (rewind) {
|
|
59427
59541
|
if (target.set) target.set(startObj);
|
|
59428
59542
|
} else {
|
|
59429
59543
|
if (target.set) target.set(obj);
|
|
59430
59544
|
}
|
|
59431
59545
|
}
|
|
59432
|
-
} else {
|
|
59546
|
+
} else {
|
|
59433
59547
|
if (wait3>0) target.waiting = true;
|
|
59434
59548
|
doLoopWaitCall();
|
|
59435
59549
|
return;
|
|
@@ -62390,7 +62504,7 @@ zim global variable
|
|
|
62390
62504
|
|
|
62391
62505
|
DESCRIPTION
|
|
62392
62506
|
|
|
62393
|
-
WARNING - currently, this does not work - see seedRandom() in CODE module.
|
|
62507
|
+
WARNING - currently, this does not work - instead, see seedRandom() in CODE module.
|
|
62394
62508
|
|
|
62395
62509
|
If set, the ZIM rand() function will be seeded with its value.
|
|
62396
62510
|
This means that rand() will repeat in order its random results.
|
|
@@ -62438,7 +62552,7 @@ zim global variable
|
|
|
62438
62552
|
|
|
62439
62553
|
DESCRIPTION
|
|
62440
62554
|
|
|
62441
|
-
WARNING - currently, this does not work - see seedRandom() in CODE module.
|
|
62555
|
+
WARNING - currently, this does not work - instead, see seedRandom() in CODE module.
|
|
62442
62556
|
but there is no equivilant to SEEDRANDOMCOUNT yet - we are working on it.
|
|
62443
62557
|
|
|
62444
62558
|
The current order number used for rand() if SEEDRAND is set or the rand() seedRand parameter is set
|
|
@@ -70157,11 +70271,11 @@ color2 - (default null) a second color which would form a zim.GradientColor() as
|
|
|
70157
70271
|
angle - (default 90) the angle for the gradient if there is a gradient
|
|
70158
70272
|
borderColor - (default null) the stroke color
|
|
70159
70273
|
borderWidth - (default 1 if stroke is set) the size of the stroke in pixels
|
|
70160
|
-
corner - (default
|
|
70161
|
-
|
|
70162
|
-
|
|
70163
|
-
|
|
70164
|
-
|
|
70274
|
+
corner - (default 10) the round of corner
|
|
70275
|
+
can also be an array of [topLeft, topRight, bottomRight, bottomLeft]
|
|
70276
|
+
inside this array can be arrays of [horizontal, vertical] which skews each corner
|
|
70277
|
+
can also be a combination array of values and skew arrays
|
|
70278
|
+
[topLeft, [horizontal, vertical], bottomRight, [horizontal, vertical]]
|
|
70165
70279
|
interactive - (default true) set to false to not be interactive
|
|
70166
70280
|
interactive will use raycasting in the TextureActives object
|
|
70167
70281
|
to provide x and y to CreateJS which is then used by ZIM
|
|
@@ -70175,8 +70289,8 @@ pattern - (default null) a DisplayObject that will be added to the TextureActive
|
|
|
70175
70289
|
scalePattern - (default "fill") scale the pattern so it fills the window (formerly "bigger" or "outside")
|
|
70176
70290
|
set to false for no scaling or:
|
|
70177
70291
|
FIT or "fit" fits inside the TextureActive keeping proportion (formerly "smallest")
|
|
70178
|
-
|
|
70179
|
-
|
|
70292
|
+
FILL or "fill" fills the TextureActive keeping proportion (formerly "biggest" or "outside")
|
|
70293
|
+
FULL or "full" keeps both x and y scales - may stretch object (formerly "both")
|
|
70180
70294
|
style - (default true) set to false to ignore styles set with the STYLE - will receive original parameter defaults
|
|
70181
70295
|
group - (default null) set to String (or comma delimited String) so STYLE can set default styles to the group(s) (like a CSS class)
|
|
70182
70296
|
inherit - (default null) used internally but can receive an {} of styles directly
|
|
@@ -75276,29 +75390,31 @@ SEE: https://zimjs.com/portal/
|
|
|
75276
75390
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
75277
75391
|
|
|
75278
75392
|
EXAMPLE
|
|
75279
|
-
F.loadAssets(["
|
|
75393
|
+
F.loadAssets(["ai_future03.jpg", "ai_alienplanet01.jpg"], "https://zimjs.org/assets/");
|
|
75280
75394
|
F.on("complete", ()=>{
|
|
75395
|
+
|
|
75281
75396
|
const lands = new Container(W, H).addTo();
|
|
75282
|
-
const
|
|
75397
|
+
const planet = new Pic("ai_alienplanet01.jpg")
|
|
75283
75398
|
.scaleTo(lands)
|
|
75284
75399
|
.center(lands);
|
|
75285
|
-
const
|
|
75400
|
+
const future = new Pic("ai_future03.jpg")
|
|
75286
75401
|
.scaleTo(lands)
|
|
75287
75402
|
.center(lands);
|
|
75403
|
+
|
|
75288
75404
|
const portalObject = new Circle(118, faint, pink, 16, true)
|
|
75289
|
-
.
|
|
75290
|
-
.
|
|
75405
|
+
.center()
|
|
75406
|
+
.mov(0,90)
|
|
75291
75407
|
.animate({obj:{rotation:"360"}, time:70, ease:"linear", loop:true});
|
|
75408
|
+
|
|
75292
75409
|
const portal = new Portal(portalObject, lands);
|
|
75293
|
-
portal.on("enter",
|
|
75410
|
+
portal.on("enter", ()=>{
|
|
75294
75411
|
// play a sound here!
|
|
75295
75412
|
});
|
|
75296
75413
|
|
|
75297
75414
|
// use enabled to turn on and off portal
|
|
75298
|
-
timeout(1, ()=>{portal.enabled = false; portalObject.pauseAnimate(true);});
|
|
75299
|
-
timeout(5, ()=>{portal.enabled = true; portalObject.pauseAnimate(false);});
|
|
75415
|
+
// timeout(1, ()=>{portal.enabled = false; portalObject.pauseAnimate(true);});
|
|
75416
|
+
// timeout(5, ()=>{portal.enabled = true; portalObject.pauseAnimate(false);});
|
|
75300
75417
|
|
|
75301
|
-
S.update();
|
|
75302
75418
|
}); // assets loaded
|
|
75303
75419
|
END EXAMPLE
|
|
75304
75420
|
|
|
@@ -76488,6 +76604,8 @@ to make accessing filters easy - but apps will slow down if they are over-used.
|
|
|
76488
76604
|
Keep the quality at 1 for animating filters at a decent framerate.
|
|
76489
76605
|
Consider pre-processing images if effects do not have to be dynamic.
|
|
76490
76606
|
|
|
76607
|
+
NOTE: when applying an effect to a Sprite, put the sprite in a Container and apply the effect on the container
|
|
76608
|
+
|
|
76491
76609
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
76492
76610
|
|
|
76493
76611
|
EXAMPLE
|
|
@@ -76611,6 +76729,8 @@ to make accessing filters easy - but apps will slow down if they are over-used.
|
|
|
76611
76729
|
Keep the quality at 1 for animating filters at a decent framerate.
|
|
76612
76730
|
Consider pre-processing images if effects do not have to be dynamic.
|
|
76613
76731
|
|
|
76732
|
+
NOTE: when applying an effect to a Sprite, put the sprite in a Container and apply the effect on the container
|
|
76733
|
+
|
|
76614
76734
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
76615
76735
|
|
|
76616
76736
|
EXAMPLE
|
|
@@ -76857,6 +76977,8 @@ to make accessing filters easy - but apps will slow down if they are over-used.
|
|
|
76857
76977
|
Keep the quality at 1 for animating filters at a decent framerate.
|
|
76858
76978
|
Consider pre-processing images if effects do not have to be dynamic.
|
|
76859
76979
|
|
|
76980
|
+
NOTE: when applying an effect to a Sprite, put the sprite in a Container and apply the effect on the container
|
|
76981
|
+
|
|
76860
76982
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
76861
76983
|
|
|
76862
76984
|
EXAMPLE
|
|
@@ -77161,6 +77283,8 @@ to make accessing filters easy - but apps will slow down if they are over-used.
|
|
|
77161
77283
|
Keep the quality at 1 for animating filters at a decent framerate.
|
|
77162
77284
|
Consider pre-processing images if effects do not have to be dynamic.
|
|
77163
77285
|
|
|
77286
|
+
NOTE: when applying an effect to a Sprite, put the sprite in a Container and apply the effect on the container
|
|
77287
|
+
|
|
77164
77288
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
77165
77289
|
|
|
77166
77290
|
EXAMPLE
|
|
@@ -77351,6 +77475,8 @@ to make accessing filters easy - but apps will slow down if they are over-used.
|
|
|
77351
77475
|
Keep the quality at 1 for animating filters at a decent framerate.
|
|
77352
77476
|
Consider pre-processing images if effects do not have to be dynamic.
|
|
77353
77477
|
|
|
77478
|
+
NOTE: when applying an effect to a Sprite, put the sprite in a Container and apply the effect on the container
|
|
77479
|
+
|
|
77354
77480
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
77355
77481
|
|
|
77356
77482
|
EXAMPLE
|
|
@@ -77483,6 +77609,8 @@ to make accessing filters easy - but apps will slow down if they are over-used.
|
|
|
77483
77609
|
Keep the quality at 1 for animating filters at a decent framerate.
|
|
77484
77610
|
Consider pre-processing images if effects do not have to be dynamic.
|
|
77485
77611
|
|
|
77612
|
+
NOTE: when applying an effect to a Sprite, put the sprite in a Container and apply the effect on the container
|
|
77613
|
+
|
|
77486
77614
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
77487
77615
|
|
|
77488
77616
|
EXAMPLE
|
|
@@ -77665,6 +77793,8 @@ to make accessing filters easy - but apps will slow down if they are over-used.
|
|
|
77665
77793
|
Keep the quality at 1 for animating filters at a decent framerate.
|
|
77666
77794
|
Consider pre-processing images if effects do not have to be dynamic.
|
|
77667
77795
|
|
|
77796
|
+
NOTE: when applying an effect to a Sprite, put the sprite in a Container and apply the effect on the container
|
|
77797
|
+
|
|
77668
77798
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
77669
77799
|
|
|
77670
77800
|
EXAMPLE
|
|
@@ -80746,7 +80876,7 @@ layers - (default TOP) where to place the current particle being emitted - value
|
|
|
80746
80876
|
animation - |ZIM VEE| (default null) a zim animate config object to apply to the particle
|
|
80747
80877
|
This is the whole zim DUO object to pass to animate - including a props parameter that holds the animation object
|
|
80748
80878
|
To pass in two or more animations on the same particle then use {noPick:[{animation1}, {animation2}, {etc.}]}
|
|
80749
|
-
random - (default null) an object holding properties to
|
|
80879
|
+
random - (default null) an object holding properties to set, each property holding a ZIM VEE Value object for Pick.choose() to pick from per particle
|
|
80750
80880
|
eg: {color:[red, white, green], scale:{min:1, max:2}} // scale is a convienence property for both scaleX and scaleY
|
|
80751
80881
|
horizontal - (default false) start the particles across the emitter's width at the top of the emitter (unless vertical is set to true)
|
|
80752
80882
|
vertical - (default false) start the particles across the emitter's height at the left of the emitter (unless horizontal is set to true)
|
|
@@ -89929,36 +90059,36 @@ END EXAMPLE
|
|
|
89929
90059
|
EXAMPLE
|
|
89930
90060
|
// getting a preview
|
|
89931
90061
|
const video = new Vid("video.mp4")
|
|
89932
|
-
|
|
89933
|
-
|
|
89934
|
-
|
|
90062
|
+
.scaleTo()
|
|
90063
|
+
.center()
|
|
90064
|
+
.vis(false);
|
|
89935
90065
|
|
|
89936
90066
|
new Pane("WELCOME").show(init);
|
|
89937
90067
|
|
|
89938
90068
|
function init() {
|
|
89939
|
-
|
|
90069
|
+
video.play().pause().vis(true);
|
|
89940
90070
|
// note, to play after this use video.pause(false); // not video.play()
|
|
89941
|
-
|
|
90071
|
+
Ticker.always();
|
|
89942
90072
|
}
|
|
89943
90073
|
END EXAMPLE
|
|
89944
90074
|
|
|
89945
90075
|
EXAMPLE
|
|
89946
90076
|
// getting a keyed out preview
|
|
89947
90077
|
const video = new Vid("video.mp4")
|
|
89948
|
-
|
|
89949
|
-
|
|
89950
|
-
|
|
90078
|
+
.scaleTo()
|
|
90079
|
+
.center()
|
|
90080
|
+
.vis(false);
|
|
89951
90081
|
|
|
89952
90082
|
new Pane("WELCOME").show(init);
|
|
89953
90083
|
|
|
89954
90084
|
function init() {
|
|
89955
|
-
|
|
89956
|
-
|
|
89957
|
-
|
|
89958
|
-
|
|
89959
|
-
|
|
89960
|
-
|
|
89961
|
-
|
|
90085
|
+
video
|
|
90086
|
+
.keyOut("#01b03f", .25) // key out the green
|
|
90087
|
+
.play();
|
|
90088
|
+
timeout(.05, ()=>{
|
|
90089
|
+
video.pause().vis(true);
|
|
90090
|
+
});
|
|
90091
|
+
Ticker.always();
|
|
89962
90092
|
}
|
|
89963
90093
|
END EXAMPLE
|
|
89964
90094
|
|
|
@@ -90141,9 +90271,9 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
90141
90271
|
var replacement = that.keyObj.replacement;
|
|
90142
90272
|
that.ticker = zim.Ticker.add(function(){
|
|
90143
90273
|
bitmap.keyOut(color, tolerance, replacement);
|
|
90144
|
-
});
|
|
90274
|
+
}, that.stage);
|
|
90145
90275
|
} else {
|
|
90146
|
-
that.ticker = zim.Ticker.add(function(){});
|
|
90276
|
+
that.ticker = zim.Ticker.add(function(){}, that.stage);
|
|
90147
90277
|
}
|
|
90148
90278
|
}
|
|
90149
90279
|
return that;
|
|
@@ -91079,7 +91209,7 @@ function init(yes) {
|
|
|
91079
91209
|
END EXAMPLE
|
|
91080
91210
|
|
|
91081
91211
|
EXAMPLE
|
|
91082
|
-
// for shaking motion - ALSO see the PermissionAsk example above
|
|
91212
|
+
// for shaking motion - ALSO see the PermissionAsk example above
|
|
91083
91213
|
// and replace "deviceorientation" with "devicemotion"
|
|
91084
91214
|
// and replace e.rotation.x, etc. with e.acceleration.x etc.
|
|
91085
91215
|
// also set Frame sensors parameter to true
|
|
@@ -92349,7 +92479,7 @@ function zimify(obj, a, b, c, d, list) {
|
|
|
92349
92479
|
hitTestGrid:function(width, height, cols, rows, x, y, offsetX, offsetY, spacingX, spacingY, local, type) {
|
|
92350
92480
|
return zim.hitTestGrid(this, width, height, cols, rows, x, y, offsetX, offsetY, spacingX, spacingY, local, type);
|
|
92351
92481
|
},
|
|
92352
|
-
animate:function(props, time, ease, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startCall, startParams, animateCall, animateParams, sequence, sequenceCall, sequenceParams, sequenceReverse, sequenceRatio, ticker, cjsProps, css, protect, override, from, set, id, events, sequenceTarget, dynamic, drag, clamp, startPaused, clean, obj, seriesWait, sequenceWait, rate, pauseOnBlur, easeAmount, easeFrequency, timeUnit, timeCheck, noAnimateCall, pathDamp) {
|
|
92482
|
+
animate:function(props, time, ease, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startCall, startParams, animateCall, animateParams, sequence, sequenceCall, sequenceParams, sequenceReverse, sequenceRatio, ticker, cjsProps, css, protect, override, from, set, id, events, sequenceTarget, dynamic, drag, clamp, startPaused, clean, obj, seriesWait, sequenceWait, rate, pauseOnBlur, easeAmount, easeFrequency, timeUnit, timeCheck, noAnimateCall, pathDamp, rewindPick) {
|
|
92353
92483
|
if (props && (props.props || props.obj) && isDUO(arguments)) {
|
|
92354
92484
|
// run this if duo but only if props object has a props or obj object
|
|
92355
92485
|
// can you believe that sentence makes sense
|
|
@@ -92358,7 +92488,7 @@ function zimify(obj, a, b, c, d, list) {
|
|
|
92358
92488
|
// it can only be a configuration object if there is a props or obj property
|
|
92359
92489
|
arguments[0].target = this; return zim.animate(arguments[0]);
|
|
92360
92490
|
}
|
|
92361
|
-
else {return zim.animate(this, props, time, ease, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startCall, startParams, animateCall, animateParams, sequence, sequenceCall, sequenceParams, sequenceReverse, sequenceRatio, ticker, cjsProps, css, protect, override, from, set, id, events, sequenceTarget, dynamic, drag, clamp, startPaused, clean, obj, seriesWait, sequenceWait, rate, pauseOnBlur, easeAmount, easeFrequency, timeUnit, timeCheck, noAnimateCall, pathDamp);}
|
|
92491
|
+
else {return zim.animate(this, props, time, ease, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startCall, startParams, animateCall, animateParams, sequence, sequenceCall, sequenceParams, sequenceReverse, sequenceRatio, ticker, cjsProps, css, protect, override, from, set, id, events, sequenceTarget, dynamic, drag, clamp, startPaused, clean, obj, seriesWait, sequenceWait, rate, pauseOnBlur, easeAmount, easeFrequency, timeUnit, timeCheck, noAnimateCall, pathDamp, rewindPick);}
|
|
92362
92492
|
},
|
|
92363
92493
|
pauseAnimate:function(){return this;},
|
|
92364
92494
|
stopAnimate:function(){return this;},
|
|
@@ -92742,39 +92872,63 @@ EXAMPLE
|
|
|
92742
92872
|
const data = {size:10, season:"summer"};
|
|
92743
92873
|
// addWires returns the object data - which will now have the wired method
|
|
92744
92874
|
// now, when the slider or tabs change the data object will be updated
|
|
92745
|
-
// note: we want the slider to be set to the object's start value so set the setSource to
|
|
92875
|
+
// note: we want the slider to be set to the object's start value so set the setSource to true
|
|
92746
92876
|
// note: we want the text of the tabs not the default index so need to provide input property
|
|
92747
|
-
addWires(data).wired(slider, "size", null,
|
|
92877
|
+
addWires(data).wired(slider, "size", null, true).wired({source:tabs, prop:"season", input:"text"});
|
|
92878
|
+
S.on("stagemouseup", ()=>{zog(data);});
|
|
92748
92879
|
END EXAMPLE
|
|
92749
92880
|
|
|
92750
92881
|
PARAMETERS
|
|
92751
92882
|
obj - the object to receive the wire and wired methods
|
|
92752
92883
|
|
|
92753
|
-
RETURNS - obj for
|
|
92884
|
+
RETURNS - obj for chaining
|
|
92754
92885
|
--*///+83.365
|
|
92755
92886
|
zim.addWires = function(obj) {
|
|
92756
|
-
if (isDUO(arguments)) {arguments[0].obj = this; return zim.addWires(arguments[0]);}
|
|
92887
|
+
// if (isDUO(arguments)) {arguments[0].obj = this; return zim.addWires(arguments[0]);}
|
|
92757
92888
|
z_d("83.365");
|
|
92758
92889
|
obj.wire = function() {
|
|
92890
|
+
if (isDUO(arguments)) {arguments[0].obj = this; return zim.wire(arguments[0]);}
|
|
92759
92891
|
Array.prototype.unshift.call(arguments, obj);
|
|
92760
92892
|
zim.wire.apply(null, arguments);
|
|
92761
92893
|
return obj;
|
|
92762
92894
|
};
|
|
92763
92895
|
obj.noWire = function() {
|
|
92896
|
+
if (isDUO(arguments)) {arguments[0].obj = this; return zim.noWire(arguments[0]);}
|
|
92764
92897
|
Array.prototype.unshift.call(arguments, obj);
|
|
92765
92898
|
zim.noWire.apply(null, arguments);
|
|
92766
92899
|
return obj;
|
|
92767
92900
|
};
|
|
92768
92901
|
obj.wired = function() {
|
|
92902
|
+
if (isDUO(arguments)) {arguments[0].obj = this; return zim.wired(arguments[0]);}
|
|
92769
92903
|
Array.prototype.unshift.call(arguments, obj);
|
|
92770
92904
|
zim.wired.apply(null, arguments);
|
|
92771
92905
|
return obj;
|
|
92772
92906
|
};
|
|
92773
92907
|
obj.noWired = function() {
|
|
92908
|
+
if (isDUO(arguments)) {arguments[0].obj = this; return zim.noWired(arguments[0]);}
|
|
92774
92909
|
Array.prototype.unshift.call(arguments, obj);
|
|
92775
92910
|
zim.noWired.apply(null, arguments);
|
|
92776
92911
|
return obj;
|
|
92777
92912
|
};
|
|
92913
|
+
|
|
92914
|
+
|
|
92915
|
+
// wire:function(target, prop, twoWay, setSource, filter, call, input) {
|
|
92916
|
+
// if (isDUO(arguments)) {arguments[0].obj = this; return zim.wire(arguments[0]);}
|
|
92917
|
+
// else {return zim.wire(this, target, prop, twoWay, setSource, filter, call, input);}
|
|
92918
|
+
// },
|
|
92919
|
+
// noWire:function(target, prop, input) {
|
|
92920
|
+
// if (isDUO(arguments)) {arguments[0].obj = this; return zim.noWire(arguments[0]);}
|
|
92921
|
+
// else {return zim.noWire(this, target, prop, input);}
|
|
92922
|
+
// },
|
|
92923
|
+
// wired:function(source, prop, twoWay, setSource, filter, call, input) {
|
|
92924
|
+
// if (isDUO(arguments)) {arguments[0].obj = this; return zim.wired(arguments[0]);}
|
|
92925
|
+
// else {return zim.wired(this, source, prop, twoWay, setSource, filter, call, input);}
|
|
92926
|
+
// },
|
|
92927
|
+
// noWired:function(source, prop, input) {
|
|
92928
|
+
// if (isDUO(arguments)) {arguments[0].obj = this; return zim.noWired(arguments[0]);}
|
|
92929
|
+
// else {return zim.noWired(this, source, prop, input);}
|
|
92930
|
+
// },
|
|
92931
|
+
|
|
92778
92932
|
return obj;
|
|
92779
92933
|
};//-83.365
|
|
92780
92934
|
|
|
@@ -96488,7 +96642,7 @@ const ask = new CamAsk().show(yes => {
|
|
|
96488
96642
|
END EXAMPLE
|
|
96489
96643
|
|
|
96490
96644
|
EXAMPLE
|
|
96491
|
-
// use ML5 at https://unpkg.com/ml5@1/dist/ml5.min.js for hand tracking
|
|
96645
|
+
// use ML5 at https://unpkg.com/ml5@1.2.1/dist/ml5.min.js for hand tracking
|
|
96492
96646
|
// on a Mac, the canvas must be interacted with first
|
|
96493
96647
|
// so would recommend always using CamAsk first:
|
|
96494
96648
|
const ask = new CamAsk().show(yes=>{
|
|
@@ -97168,6 +97322,17 @@ NOTE: make the CamAlpha in the ready event of the Cam() or CamMotion()
|
|
|
97168
97322
|
|
|
97169
97323
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
97170
97324
|
|
|
97325
|
+
EXAMPLE
|
|
97326
|
+
// on a Mac, the canvas must be interacted with first
|
|
97327
|
+
// so would recommend always using CamAsk first:
|
|
97328
|
+
const ask = new CamAsk().show(yes=>{
|
|
97329
|
+
if (yes) {
|
|
97330
|
+
const cam = new Cam(W,H).alp(.3).center();
|
|
97331
|
+
new CamAlpha(cam).pos(50,50,LEFT,BOTTOM);
|
|
97332
|
+
}
|
|
97333
|
+
}); // end CamAsk show() - see CamAsk() docs for error checking example
|
|
97334
|
+
END EXAMPLE
|
|
97335
|
+
|
|
97171
97336
|
EXAMPLE
|
|
97172
97337
|
// on a Mac, the canvas must be interacted with first
|
|
97173
97338
|
// so would recommend always using CamAsk first:
|
|
@@ -97507,6 +97672,8 @@ resize
|
|
|
97507
97672
|
rotate2
|
|
97508
97673
|
save
|
|
97509
97674
|
mark
|
|
97675
|
+
pic
|
|
97676
|
+
chart
|
|
97510
97677
|
|
|
97511
97678
|
Pizzazz Icons example:
|
|
97512
97679
|
https://zimjs.com/bits/view/icons.html
|
|
@@ -97522,8 +97689,8 @@ const icon = makeIcon("home", white, 2).pos(40,40,RIGHT);
|
|
|
97522
97689
|
var info = new Button({
|
|
97523
97690
|
width:50,
|
|
97524
97691
|
height:50,
|
|
97525
|
-
|
|
97526
|
-
|
|
97692
|
+
backgroundColor:blue, // or "red", "#666" etc.
|
|
97693
|
+
rollBackgroundColor:pink,
|
|
97527
97694
|
corner:0,
|
|
97528
97695
|
label:"",
|
|
97529
97696
|
icon:makeIcon("info", "white")
|
|
@@ -97654,7 +97821,7 @@ where various Blob and Squiggle shapes can be selected from a menu
|
|
|
97654
97821
|
or custom Blob And Squiggle shapes can be made.
|
|
97655
97822
|
The code for the shapes can be copied into your app
|
|
97656
97823
|
as the Blob or Squiggle points parameter.
|
|
97657
|
-
Please contact us at https
|
|
97824
|
+
Please contact us at https://forum.zimjs.com
|
|
97658
97825
|
and we can perhaps add your Blob or Squiggle in the menu!
|
|
97659
97826
|
|
|
97660
97827
|
Note that PIZZAZZ 04 was created during ZIM NIO (version 9)
|