zimjs 18.0.9 → 18.1.1
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 +127 -63
package/package.json
CHANGED
package/src/zim.js
CHANGED
|
@@ -2094,7 +2094,7 @@ pauseTimeLeft - if paused, get how much time is left once unpaused
|
|
|
2094
2094
|
if (zot(immediate)) immediate = false;
|
|
2095
2095
|
if (!zot(total) && (isNaN(total) || total<=0)) return;
|
|
2096
2096
|
if (zot(total)) total = -1;
|
|
2097
|
-
var obj = {count:0, total:total, paused:false, time:time, active:true, timeUnit:timeUnit};
|
|
2097
|
+
var obj = {count:(immediate && time <= (timeType=="s"?5/1000:5)) ? -1:0, total:total, paused:false, time:time, active:true, timeUnit:timeUnit};
|
|
2098
2098
|
|
|
2099
2099
|
if (pauseOnBlur) {
|
|
2100
2100
|
if (zot(zim.blurCheck)) zim.setBlurDetect();
|
|
@@ -2113,7 +2113,7 @@ pauseTimeLeft - if paused, get how much time is left once unpaused
|
|
|
2113
2113
|
checkTotal();
|
|
2114
2114
|
}, obj.interval*(timeType=="s"?1000:1));
|
|
2115
2115
|
}
|
|
2116
|
-
if (immediate) {
|
|
2116
|
+
if (immediate && time > (timeType=="s"?5/1000:5)) {
|
|
2117
2117
|
setTimeout(function() {
|
|
2118
2118
|
(call)(obj);
|
|
2119
2119
|
checkTotal();
|
|
@@ -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
|
|
@@ -24136,7 +24158,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
24136
24158
|
if (zot(rtl)) rtl = DS.rtl != null ? DS.rtl : false;
|
|
24137
24159
|
if (zot(lineAlign)) lineAlign = DS.lineAlign != null ? DS.lineAlign : rtl?"right":"left";
|
|
24138
24160
|
if (zot(lineValign)) lineValign = DS.lineValign != null ? DS.lineValign : "bottom";
|
|
24139
|
-
if (zot(lineWidth)) lineWidth = DS.lineWidth != null ? DS.lineWidth :
|
|
24161
|
+
if (zot(lineWidth)) lineWidth = DS.lineWidth != null ? DS.lineWidth : null;
|
|
24140
24162
|
if (zot(lineAlignLast)) lineAlignLast = DS.lineAlignLast != null ? DS.lineAlignLast : rtl?"right":"left";
|
|
24141
24163
|
if (zot(cache)) cache = DS.cache != null ? DS.cache : false;
|
|
24142
24164
|
|
|
@@ -25011,16 +25033,22 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
25011
25033
|
|
|
25012
25034
|
var originalLabel = !zot(label) && label.type == "Label";
|
|
25013
25035
|
if (zot(label)) label = DS.label != null ? DS.label : new zim.Label("Will this wind be so mighty as to lay low the mountains of the Earth?");
|
|
25014
|
-
|
|
25036
|
+
if (zot(size)) size = DS.size != null ? DS.size : originalLabel? label.size : 36;
|
|
25037
|
+
if (zot(spacingH)) spacingH = DS.spacingH != null ? DS.spacingH : size/2;
|
|
25038
|
+
if (zot(spacingV)) spacingV = DS.spacingV != null ? DS.spacingV : size/2;
|
|
25039
|
+
if (originalLabel) {
|
|
25040
|
+
var numWords = label.text.split(" ").length;
|
|
25041
|
+
var paddingT = label.background?label.paddingH*numWords*2:0;
|
|
25042
|
+
}
|
|
25043
|
+
if (zot(width)) width = DS.width != null ? DS.width : originalLabel ? label.width*(paddingT?1.05:1.07)+paddingT : 500;
|
|
25015
25044
|
if (zot(itemRegX)) itemRegX = DS.itemRegX != null ? DS.itemRegX : "center";
|
|
25016
25045
|
if (zot(itemRegY)) itemRegY = DS.itemRegY != null ? DS.itemRegY : "center";
|
|
25017
|
-
|
|
25046
|
+
|
|
25018
25047
|
if (zot(font)) font = DS.font != null ? DS.font : originalLabel? label.font : "arial";
|
|
25019
25048
|
if (zot(color)) color = DS.color != null ? DS.color : originalLabel? label.color : "black";
|
|
25020
25049
|
if (zot(backgroundColor)) backgroundColor = DS.backgroundColor != null ? DS.backgroundColor : originalLabel? label.backgroundColor : null;
|
|
25021
25050
|
if (zot(itemCache)) itemCache = DS.itemCache != null ? DS.itemCache : false;
|
|
25022
|
-
|
|
25023
|
-
if (zot(spacingV)) spacingV = DS.spacingV != null ? DS.spacingV : size/2;
|
|
25051
|
+
|
|
25024
25052
|
|
|
25025
25053
|
var that = this;
|
|
25026
25054
|
|
|
@@ -27546,6 +27574,7 @@ Adds a window for alerts, etc.
|
|
|
27546
27574
|
You need to call the pane.show() to show the pane and pane.hide() to hide it.
|
|
27547
27575
|
You do not need to add it to the stage - it adds itself centered.
|
|
27548
27576
|
You can change the x and y (the origin and registration point are in the middle).
|
|
27577
|
+
Content is added to the pane with the content parameter or the add() method.
|
|
27549
27578
|
|
|
27550
27579
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
27551
27580
|
|
|
@@ -28157,7 +28186,8 @@ zim class - extends a zim.Container which extends a createjs.Container
|
|
|
28157
28186
|
|
|
28158
28187
|
DESCRIPTION
|
|
28159
28188
|
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
|
|
28189
|
+
Panel can be set draggable and can have a collapse button and a close button.
|
|
28190
|
+
Content is added to the panel with the content parameter or the add() method.
|
|
28161
28191
|
See: https://zimjs.com/explore/panel.html
|
|
28162
28192
|
|
|
28163
28193
|
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 +28724,8 @@ zim class - extends a zim.Container which extends a createjs.Container
|
|
|
28694
28724
|
|
|
28695
28725
|
DESCRIPTION
|
|
28696
28726
|
Adds a window for content that can be swiped and scrolled.
|
|
28727
|
+
Content is added to the Window with the content parameter or the add() method.
|
|
28728
|
+
|
|
28697
28729
|
NOTE: if zim namespace zns = true then this overwrites a JS Window - so the JS Window is stored as document.Window
|
|
28698
28730
|
|
|
28699
28731
|
NOTE: set the enable property to false if animating the position of the whole Window
|
|
@@ -48724,7 +48756,6 @@ shadowColor - (default null) the shadow color (css color) of a drop shadow
|
|
|
48724
48756
|
shadowBlur - (default null) pixels of how blurred the shadow is if the shadow is set - eg. 10
|
|
48725
48757
|
dashed - (default true) set to false to turn off the dashed for the border
|
|
48726
48758
|
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
48759
|
readOnly - (default false) set to true to make TextArea read only (still selectable)
|
|
48729
48760
|
spellCheck - (default true) set to false to turn Browser spell check off
|
|
48730
48761
|
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 +55537,8 @@ Keep the quality at 1 for animating filters at a decent framerate.
|
|
|
55506
55537
|
Consider pre-processing images if effects do not have to be dynamic.
|
|
55507
55538
|
|
|
55508
55539
|
NOTE: when applying effects to rtl fonts make sure the DIR = "rtl" is set.
|
|
55540
|
+
|
|
55541
|
+
NOTE: when applying an effect to a Sprite, put the sprite in a Container and apply the effect on the container
|
|
55509
55542
|
|
|
55510
55543
|
EXAMPLE
|
|
55511
55544
|
// create a Label with a GlowEffect that shows through to the image below
|
|
@@ -70244,11 +70277,11 @@ color2 - (default null) a second color which would form a zim.GradientColor() as
|
|
|
70244
70277
|
angle - (default 90) the angle for the gradient if there is a gradient
|
|
70245
70278
|
borderColor - (default null) the stroke color
|
|
70246
70279
|
borderWidth - (default 1 if stroke is set) the size of the stroke in pixels
|
|
70247
|
-
corner - (default
|
|
70248
|
-
|
|
70249
|
-
|
|
70250
|
-
|
|
70251
|
-
|
|
70280
|
+
corner - (default 10) the round of corner
|
|
70281
|
+
can also be an array of [topLeft, topRight, bottomRight, bottomLeft]
|
|
70282
|
+
inside this array can be arrays of [horizontal, vertical] which skews each corner
|
|
70283
|
+
can also be a combination array of values and skew arrays
|
|
70284
|
+
[topLeft, [horizontal, vertical], bottomRight, [horizontal, vertical]]
|
|
70252
70285
|
interactive - (default true) set to false to not be interactive
|
|
70253
70286
|
interactive will use raycasting in the TextureActives object
|
|
70254
70287
|
to provide x and y to CreateJS which is then used by ZIM
|
|
@@ -70262,8 +70295,8 @@ pattern - (default null) a DisplayObject that will be added to the TextureActive
|
|
|
70262
70295
|
scalePattern - (default "fill") scale the pattern so it fills the window (formerly "bigger" or "outside")
|
|
70263
70296
|
set to false for no scaling or:
|
|
70264
70297
|
FIT or "fit" fits inside the TextureActive keeping proportion (formerly "smallest")
|
|
70265
|
-
|
|
70266
|
-
|
|
70298
|
+
FILL or "fill" fills the TextureActive keeping proportion (formerly "biggest" or "outside")
|
|
70299
|
+
FULL or "full" keeps both x and y scales - may stretch object (formerly "both")
|
|
70267
70300
|
style - (default true) set to false to ignore styles set with the STYLE - will receive original parameter defaults
|
|
70268
70301
|
group - (default null) set to String (or comma delimited String) so STYLE can set default styles to the group(s) (like a CSS class)
|
|
70269
70302
|
inherit - (default null) used internally but can receive an {} of styles directly
|
|
@@ -75363,29 +75396,31 @@ SEE: https://zimjs.com/portal/
|
|
|
75363
75396
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
75364
75397
|
|
|
75365
75398
|
EXAMPLE
|
|
75366
|
-
F.loadAssets(["
|
|
75399
|
+
F.loadAssets(["ai_future03.jpg", "ai_alienplanet01.jpg"], "https://zimjs.org/assets/");
|
|
75367
75400
|
F.on("complete", ()=>{
|
|
75401
|
+
|
|
75368
75402
|
const lands = new Container(W, H).addTo();
|
|
75369
|
-
const
|
|
75403
|
+
const planet = new Pic("ai_alienplanet01.jpg")
|
|
75370
75404
|
.scaleTo(lands)
|
|
75371
75405
|
.center(lands);
|
|
75372
|
-
const
|
|
75406
|
+
const future = new Pic("ai_future03.jpg")
|
|
75373
75407
|
.scaleTo(lands)
|
|
75374
75408
|
.center(lands);
|
|
75409
|
+
|
|
75375
75410
|
const portalObject = new Circle(118, faint, pink, 16, true)
|
|
75376
|
-
.
|
|
75377
|
-
.
|
|
75411
|
+
.center()
|
|
75412
|
+
.mov(0,90)
|
|
75378
75413
|
.animate({obj:{rotation:"360"}, time:70, ease:"linear", loop:true});
|
|
75414
|
+
|
|
75379
75415
|
const portal = new Portal(portalObject, lands);
|
|
75380
|
-
portal.on("enter",
|
|
75416
|
+
portal.on("enter", ()=>{
|
|
75381
75417
|
// play a sound here!
|
|
75382
75418
|
});
|
|
75383
75419
|
|
|
75384
75420
|
// use enabled to turn on and off portal
|
|
75385
|
-
timeout(1, ()=>{portal.enabled = false; portalObject.pauseAnimate(true);});
|
|
75386
|
-
timeout(5, ()=>{portal.enabled = true; portalObject.pauseAnimate(false);});
|
|
75421
|
+
// timeout(1, ()=>{portal.enabled = false; portalObject.pauseAnimate(true);});
|
|
75422
|
+
// timeout(5, ()=>{portal.enabled = true; portalObject.pauseAnimate(false);});
|
|
75387
75423
|
|
|
75388
|
-
S.update();
|
|
75389
75424
|
}); // assets loaded
|
|
75390
75425
|
END EXAMPLE
|
|
75391
75426
|
|
|
@@ -76575,6 +76610,8 @@ to make accessing filters easy - but apps will slow down if they are over-used.
|
|
|
76575
76610
|
Keep the quality at 1 for animating filters at a decent framerate.
|
|
76576
76611
|
Consider pre-processing images if effects do not have to be dynamic.
|
|
76577
76612
|
|
|
76613
|
+
NOTE: when applying an effect to a Sprite, put the sprite in a Container and apply the effect on the container
|
|
76614
|
+
|
|
76578
76615
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
76579
76616
|
|
|
76580
76617
|
EXAMPLE
|
|
@@ -76698,6 +76735,8 @@ to make accessing filters easy - but apps will slow down if they are over-used.
|
|
|
76698
76735
|
Keep the quality at 1 for animating filters at a decent framerate.
|
|
76699
76736
|
Consider pre-processing images if effects do not have to be dynamic.
|
|
76700
76737
|
|
|
76738
|
+
NOTE: when applying an effect to a Sprite, put the sprite in a Container and apply the effect on the container
|
|
76739
|
+
|
|
76701
76740
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
76702
76741
|
|
|
76703
76742
|
EXAMPLE
|
|
@@ -76944,6 +76983,8 @@ to make accessing filters easy - but apps will slow down if they are over-used.
|
|
|
76944
76983
|
Keep the quality at 1 for animating filters at a decent framerate.
|
|
76945
76984
|
Consider pre-processing images if effects do not have to be dynamic.
|
|
76946
76985
|
|
|
76986
|
+
NOTE: when applying an effect to a Sprite, put the sprite in a Container and apply the effect on the container
|
|
76987
|
+
|
|
76947
76988
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
76948
76989
|
|
|
76949
76990
|
EXAMPLE
|
|
@@ -77248,6 +77289,8 @@ to make accessing filters easy - but apps will slow down if they are over-used.
|
|
|
77248
77289
|
Keep the quality at 1 for animating filters at a decent framerate.
|
|
77249
77290
|
Consider pre-processing images if effects do not have to be dynamic.
|
|
77250
77291
|
|
|
77292
|
+
NOTE: when applying an effect to a Sprite, put the sprite in a Container and apply the effect on the container
|
|
77293
|
+
|
|
77251
77294
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
77252
77295
|
|
|
77253
77296
|
EXAMPLE
|
|
@@ -77438,6 +77481,8 @@ to make accessing filters easy - but apps will slow down if they are over-used.
|
|
|
77438
77481
|
Keep the quality at 1 for animating filters at a decent framerate.
|
|
77439
77482
|
Consider pre-processing images if effects do not have to be dynamic.
|
|
77440
77483
|
|
|
77484
|
+
NOTE: when applying an effect to a Sprite, put the sprite in a Container and apply the effect on the container
|
|
77485
|
+
|
|
77441
77486
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
77442
77487
|
|
|
77443
77488
|
EXAMPLE
|
|
@@ -77570,6 +77615,8 @@ to make accessing filters easy - but apps will slow down if they are over-used.
|
|
|
77570
77615
|
Keep the quality at 1 for animating filters at a decent framerate.
|
|
77571
77616
|
Consider pre-processing images if effects do not have to be dynamic.
|
|
77572
77617
|
|
|
77618
|
+
NOTE: when applying an effect to a Sprite, put the sprite in a Container and apply the effect on the container
|
|
77619
|
+
|
|
77573
77620
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
77574
77621
|
|
|
77575
77622
|
EXAMPLE
|
|
@@ -77752,6 +77799,8 @@ to make accessing filters easy - but apps will slow down if they are over-used.
|
|
|
77752
77799
|
Keep the quality at 1 for animating filters at a decent framerate.
|
|
77753
77800
|
Consider pre-processing images if effects do not have to be dynamic.
|
|
77754
77801
|
|
|
77802
|
+
NOTE: when applying an effect to a Sprite, put the sprite in a Container and apply the effect on the container
|
|
77803
|
+
|
|
77755
77804
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
77756
77805
|
|
|
77757
77806
|
EXAMPLE
|
|
@@ -79901,6 +79950,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
79901
79950
|
tile.drag({boundary:tile, singleTouch:true});
|
|
79902
79951
|
}, timeType=="s"?(wait+time)*1000:wait+time);
|
|
79903
79952
|
}
|
|
79953
|
+
return that;
|
|
79904
79954
|
};
|
|
79905
79955
|
|
|
79906
79956
|
this._enabled = true;
|
|
@@ -87831,7 +87881,7 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
|
|
|
87831
87881
|
var duo; if (duo = zob(that.loadAssets, arguments, sig)) return duo;
|
|
87832
87882
|
}
|
|
87833
87883
|
|
|
87834
|
-
if (!zot(path)) {
|
|
87884
|
+
if (!zot(path)) {s
|
|
87835
87885
|
path = path.replace(/\/$/,"");
|
|
87836
87886
|
path = path + "/";
|
|
87837
87887
|
WW.PATH = path;
|
|
@@ -88331,9 +88381,9 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
|
|
|
88331
88381
|
|
|
88332
88382
|
if (WW.PATH!=null) zim.PATH = WW.PATH;
|
|
88333
88383
|
if (zim.PATH!=null) {
|
|
88334
|
-
zim.PATH.replace(/\/$/,"");
|
|
88384
|
+
zim.PATH = zim.PATH.replace(/\/$/,"");
|
|
88335
88385
|
zim.PATH = zim.PATH + "/";
|
|
88336
|
-
}
|
|
88386
|
+
}
|
|
88337
88387
|
if (second) {
|
|
88338
88388
|
var empty;
|
|
88339
88389
|
if (that.loadFailObj == "circles") empty = that.makeCircles(14);
|
|
@@ -90016,36 +90066,36 @@ END EXAMPLE
|
|
|
90016
90066
|
EXAMPLE
|
|
90017
90067
|
// getting a preview
|
|
90018
90068
|
const video = new Vid("video.mp4")
|
|
90019
|
-
|
|
90020
|
-
|
|
90021
|
-
|
|
90069
|
+
.scaleTo()
|
|
90070
|
+
.center()
|
|
90071
|
+
.vis(false);
|
|
90022
90072
|
|
|
90023
90073
|
new Pane("WELCOME").show(init);
|
|
90024
90074
|
|
|
90025
90075
|
function init() {
|
|
90026
|
-
|
|
90076
|
+
video.play().pause().vis(true);
|
|
90027
90077
|
// note, to play after this use video.pause(false); // not video.play()
|
|
90028
|
-
|
|
90078
|
+
Ticker.always();
|
|
90029
90079
|
}
|
|
90030
90080
|
END EXAMPLE
|
|
90031
90081
|
|
|
90032
90082
|
EXAMPLE
|
|
90033
90083
|
// getting a keyed out preview
|
|
90034
90084
|
const video = new Vid("video.mp4")
|
|
90035
|
-
|
|
90036
|
-
|
|
90037
|
-
|
|
90085
|
+
.scaleTo()
|
|
90086
|
+
.center()
|
|
90087
|
+
.vis(false);
|
|
90038
90088
|
|
|
90039
90089
|
new Pane("WELCOME").show(init);
|
|
90040
90090
|
|
|
90041
90091
|
function init() {
|
|
90042
|
-
|
|
90043
|
-
|
|
90044
|
-
|
|
90045
|
-
|
|
90046
|
-
|
|
90047
|
-
|
|
90048
|
-
|
|
90092
|
+
video
|
|
90093
|
+
.keyOut("#01b03f", .25) // key out the green
|
|
90094
|
+
.play();
|
|
90095
|
+
timeout(.05, ()=>{
|
|
90096
|
+
video.pause().vis(true);
|
|
90097
|
+
});
|
|
90098
|
+
Ticker.always();
|
|
90049
90099
|
}
|
|
90050
90100
|
END EXAMPLE
|
|
90051
90101
|
|
|
@@ -90162,7 +90212,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
90162
90212
|
|
|
90163
90213
|
if (WW.PATH!=null) zim.PATH = WW.PATH;
|
|
90164
90214
|
if (zim.PATH!=null) {
|
|
90165
|
-
zim.PATH.replace(/\/$/,"");
|
|
90215
|
+
zim.PATH = zim.PATH.replace(/\/$/,"");
|
|
90166
90216
|
zim.PATH = zim.PATH + "/";
|
|
90167
90217
|
}
|
|
90168
90218
|
|
|
@@ -90228,9 +90278,9 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
90228
90278
|
var replacement = that.keyObj.replacement;
|
|
90229
90279
|
that.ticker = zim.Ticker.add(function(){
|
|
90230
90280
|
bitmap.keyOut(color, tolerance, replacement);
|
|
90231
|
-
});
|
|
90281
|
+
}, that.stage);
|
|
90232
90282
|
} else {
|
|
90233
|
-
that.ticker = zim.Ticker.add(function(){});
|
|
90283
|
+
that.ticker = zim.Ticker.add(function(){}, that.stage);
|
|
90234
90284
|
}
|
|
90235
90285
|
}
|
|
90236
90286
|
return that;
|
|
@@ -90402,8 +90452,8 @@ zim.Dat = function(file) {
|
|
|
90402
90452
|
} else {
|
|
90403
90453
|
if (WW.PATH!=null) zim.PATH = WW.PATH;
|
|
90404
90454
|
if (zim.PATH!=null) {
|
|
90405
|
-
zim.
|
|
90406
|
-
zim.
|
|
90455
|
+
zim.PATH = zim.PATH.replace(/\/$/,"");
|
|
90456
|
+
zim.PATH = zim.PATH + "/";
|
|
90407
90457
|
}
|
|
90408
90458
|
var loader = zdf.loadAssets(file, zim.PATH);
|
|
90409
90459
|
loader.on("complete", function() {
|
|
@@ -91166,7 +91216,7 @@ function init(yes) {
|
|
|
91166
91216
|
END EXAMPLE
|
|
91167
91217
|
|
|
91168
91218
|
EXAMPLE
|
|
91169
|
-
// for shaking motion - ALSO see the PermissionAsk example above
|
|
91219
|
+
// for shaking motion - ALSO see the PermissionAsk example above
|
|
91170
91220
|
// and replace "deviceorientation" with "devicemotion"
|
|
91171
91221
|
// and replace e.rotation.x, etc. with e.acceleration.x etc.
|
|
91172
91222
|
// also set Frame sensors parameter to true
|
|
@@ -93975,8 +94025,8 @@ animator - the Gifler animator
|
|
|
93975
94025
|
var f;
|
|
93976
94026
|
if (WW.PATH!=null) zim.PATH = WW.PATH;
|
|
93977
94027
|
if (zim.PATH!=null) {
|
|
93978
|
-
zim.
|
|
93979
|
-
zim.
|
|
94028
|
+
zim.PATH = zim.PATH.replace(/\/$/,"");
|
|
94029
|
+
zim.PATH = zim.PATH + "/";
|
|
93980
94030
|
}
|
|
93981
94031
|
if (file.match(/http/) || file.match(/^\//)) f = file;
|
|
93982
94032
|
else f = (zim.PATH?zim.PATH:"")+file;
|
|
@@ -96599,7 +96649,7 @@ const ask = new CamAsk().show(yes => {
|
|
|
96599
96649
|
END EXAMPLE
|
|
96600
96650
|
|
|
96601
96651
|
EXAMPLE
|
|
96602
|
-
// use ML5 at https://unpkg.com/ml5@1/dist/ml5.min.js for hand tracking
|
|
96652
|
+
// use ML5 at https://unpkg.com/ml5@1.2.1/dist/ml5.min.js for hand tracking
|
|
96603
96653
|
// on a Mac, the canvas must be interacted with first
|
|
96604
96654
|
// so would recommend always using CamAsk first:
|
|
96605
96655
|
const ask = new CamAsk().show(yes=>{
|
|
@@ -97279,6 +97329,17 @@ NOTE: make the CamAlpha in the ready event of the Cam() or CamMotion()
|
|
|
97279
97329
|
|
|
97280
97330
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
97281
97331
|
|
|
97332
|
+
EXAMPLE
|
|
97333
|
+
// on a Mac, the canvas must be interacted with first
|
|
97334
|
+
// so would recommend always using CamAsk first:
|
|
97335
|
+
const ask = new CamAsk().show(yes=>{
|
|
97336
|
+
if (yes) {
|
|
97337
|
+
const cam = new Cam(W,H).alp(.3).center();
|
|
97338
|
+
new CamAlpha(cam).pos(50,50,LEFT,BOTTOM);
|
|
97339
|
+
}
|
|
97340
|
+
}); // end CamAsk show() - see CamAsk() docs for error checking example
|
|
97341
|
+
END EXAMPLE
|
|
97342
|
+
|
|
97282
97343
|
EXAMPLE
|
|
97283
97344
|
// on a Mac, the canvas must be interacted with first
|
|
97284
97345
|
// so would recommend always using CamAsk first:
|
|
@@ -97618,6 +97679,8 @@ resize
|
|
|
97618
97679
|
rotate2
|
|
97619
97680
|
save
|
|
97620
97681
|
mark
|
|
97682
|
+
pic
|
|
97683
|
+
chart
|
|
97621
97684
|
|
|
97622
97685
|
Pizzazz Icons example:
|
|
97623
97686
|
https://zimjs.com/bits/view/icons.html
|
|
@@ -97633,8 +97696,8 @@ const icon = makeIcon("home", white, 2).pos(40,40,RIGHT);
|
|
|
97633
97696
|
var info = new Button({
|
|
97634
97697
|
width:50,
|
|
97635
97698
|
height:50,
|
|
97636
|
-
|
|
97637
|
-
|
|
97699
|
+
backgroundColor:blue, // or "red", "#666" etc.
|
|
97700
|
+
rollBackgroundColor:pink,
|
|
97638
97701
|
corner:0,
|
|
97639
97702
|
label:"",
|
|
97640
97703
|
icon:makeIcon("info", "white")
|
|
@@ -97765,7 +97828,7 @@ where various Blob and Squiggle shapes can be selected from a menu
|
|
|
97765
97828
|
or custom Blob And Squiggle shapes can be made.
|
|
97766
97829
|
The code for the shapes can be copied into your app
|
|
97767
97830
|
as the Blob or Squiggle points parameter.
|
|
97768
|
-
Please contact us at https
|
|
97831
|
+
Please contact us at https://forum.zimjs.com
|
|
97769
97832
|
and we can perhaps add your Blob or Squiggle in the menu!
|
|
97770
97833
|
|
|
97771
97834
|
Note that PIZZAZZ 04 was created during ZIM NIO (version 9)
|
|
@@ -98256,3 +98319,4 @@ export let Style = zim.Style;
|
|
|
98256
98319
|
export let assets = zim.assets;
|
|
98257
98320
|
export let assetIDs = zim.assetIDs;
|
|
98258
98321
|
export let ZIMON = zim.ZIMON;
|
|
98322
|
+
|