zimjs 16.3.4 → 16.3.6
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 +95 -78
package/package.json
CHANGED
package/src/zim.js
CHANGED
|
@@ -46,6 +46,7 @@ var zon = WW.zon==null?true:WW.zon; // sets from outside whether zog() will outp
|
|
|
46
46
|
var zimBlob; // stores zim.Blob (and zim.Window below) to not obscure JS Blob and Window on export
|
|
47
47
|
var zimWindow; // where we use export {zimBlob as Blob} and {zimWindow as Window}
|
|
48
48
|
var z_i; // iterator i in global namespace
|
|
49
|
+
|
|
49
50
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
50
51
|
// ZIM CODE
|
|
51
52
|
|
|
@@ -6379,7 +6380,7 @@ contract(number|x, y, width, height) - number of pixels to make the Boundary sma
|
|
|
6379
6380
|
--*///+13.46
|
|
6380
6381
|
zim.Boundary = function(x, y, width, height) {
|
|
6381
6382
|
z_d("13.46");
|
|
6382
|
-
if (x.x) { // a rectangle or getBounds() is provided
|
|
6383
|
+
if (!zot(x.x)) { // a rectangle or getBounds() is provided
|
|
6383
6384
|
height = x.height;
|
|
6384
6385
|
width = x.width;
|
|
6385
6386
|
y = x.y;
|
|
@@ -6390,6 +6391,7 @@ contract(number|x, y, width, height) - number of pixels to make the Boundary sma
|
|
|
6390
6391
|
this.y = y;
|
|
6391
6392
|
this.width = width;
|
|
6392
6393
|
this.height = height;
|
|
6394
|
+
|
|
6393
6395
|
this.contract = function(a,b,c,d) {
|
|
6394
6396
|
if (zot(a)) return this;
|
|
6395
6397
|
if (zot(b)) b = a;
|
|
@@ -9096,7 +9098,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
9096
9098
|
a = 0;
|
|
9097
9099
|
b = 0;
|
|
9098
9100
|
}
|
|
9099
|
-
}
|
|
9101
|
+
}
|
|
9100
9102
|
if (that.type == "Triangle") {
|
|
9101
9103
|
a-=that.borderWidth?that.borderWidth:0;
|
|
9102
9104
|
c+=that.borderWidth?that.borderWidth*2:0;
|
|
@@ -9104,9 +9106,10 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
9104
9106
|
d+=that.borderWidth?that.borderWidth*2:0;
|
|
9105
9107
|
}
|
|
9106
9108
|
if (zot(margin)) margin = 0;
|
|
9107
|
-
that.cjsContainer_cache(a-margin,b-margin,c+margin*2,d+margin*2,scale,options,rtl,willReadFrequently);
|
|
9108
|
-
|
|
9109
|
-
|
|
9109
|
+
that.cjsContainer_cache(a-margin,b-margin,c+margin*2,d+margin*2,scale,options,rtl,willReadFrequently);
|
|
9110
|
+
|
|
9111
|
+
if (bounds && ((that.width == 0 && c > 0) || (options && options.adjustBounds))) {
|
|
9112
|
+
that.setBounds(a, b, c, d);
|
|
9110
9113
|
if (a!=bounds.x || b!=bounds.y || c!=bounds.width || d!=bounds.height) that.reg(a,b);
|
|
9111
9114
|
that.hitArea = new zim.Shape().f(black).dr(a-margin,b-margin,c+margin*2,d+margin*2);
|
|
9112
9115
|
}
|
|
@@ -10338,8 +10341,8 @@ EXAMPLE
|
|
|
10338
10341
|
// if there is an offset or spacing, etc. and enter those as parameters
|
|
10339
10342
|
// In this case, we do not need to do any of this - just enter the cols and rows
|
|
10340
10343
|
|
|
10341
|
-
new Frame(FIT, 1024, 768, black, darker, "boom.png", "https://zimjs.org/assets/");
|
|
10342
|
-
|
|
10344
|
+
new Frame(FIT, 1024, 768, black, darker, ready, "boom.png", "https://zimjs.org/assets/");
|
|
10345
|
+
function ready() {
|
|
10343
10346
|
|
|
10344
10347
|
const animation = new Sprite({
|
|
10345
10348
|
image:"boom.png",
|
|
@@ -10373,12 +10376,12 @@ F.on("complete", ()=>{
|
|
|
10373
10376
|
|
|
10374
10377
|
// OR can loop the animation
|
|
10375
10378
|
animation.run({time:2, loop:true}); // see run() parameters for more
|
|
10376
|
-
}
|
|
10379
|
+
}
|
|
10377
10380
|
END EXAMPLE
|
|
10378
10381
|
|
|
10379
10382
|
EXAMPLE
|
|
10380
10383
|
// using Sprite as a texture atlas - or spritesheet of different images
|
|
10381
|
-
// see: https://zimjs.com/
|
|
10384
|
+
// see: https://zimjs.com/zapp/Z_FDJXA
|
|
10382
10385
|
// load in assets and path
|
|
10383
10386
|
new Frame({ready, assets:["fruit.png", "fruit.json"], path:"assets/"});
|
|
10384
10387
|
function ready() {
|
|
@@ -10856,8 +10859,8 @@ animationend, change, added, click, dblclick, mousedown, mouseout, mouseover, pr
|
|
|
10856
10859
|
extraTime = 0;
|
|
10857
10860
|
if (endFrame-startFrame > 0) extraTime = time / Math.abs(endFrame-startFrame) / 2; // slight cludge - seems to look better?
|
|
10858
10861
|
if (_normalizedFrames && _normalizedFrames.length>0) extraTime = time / _normalizedFrames.length / 2; // slight cludge - seems to look better?
|
|
10859
|
-
if (
|
|
10860
|
-
if (
|
|
10862
|
+
if (loop && zot(loopWait)) {loopWait = extraTime*tweek;}
|
|
10863
|
+
if (rewind && zot(rewindWait)) {rewindWait = extraTime*tweek;}
|
|
10861
10864
|
}
|
|
10862
10865
|
|
|
10863
10866
|
// locally override call to add running status after animation done
|
|
@@ -25715,6 +25718,8 @@ END EXAMPLE
|
|
|
25715
25718
|
EXAMPLE
|
|
25716
25719
|
// if app is in an iFrame, this will get keyboardAccess using a hidden F.keyboardMessage()
|
|
25717
25720
|
// good for games that need keyboard if the game is in an iFrame like the Editor or CodePen
|
|
25721
|
+
// NOTE: do not use the on("close", f) method as it will not receive an event
|
|
25722
|
+
// with keyboardAccess the events on the canvas are turned off and captured in an any iFrame
|
|
25718
25723
|
new Pane({content:"START", keyboardAccess:true}).show();
|
|
25719
25724
|
END EXAMPLE
|
|
25720
25725
|
|
|
@@ -25831,6 +25836,7 @@ autoPaddingV - (default autoPadding) the padding used by AUTO height
|
|
|
25831
25836
|
keyboardAccess - (default false) set to true to adds a click through iframe to gain keyboard control
|
|
25832
25837
|
this sets an invisible Frame keyboardMessage() that will close the pane and give key access to iFrames
|
|
25833
25838
|
do not use if expecting interactive content in the Pane - it is for a start message only
|
|
25839
|
+
do not use on("close", f) as it will not be captured with keyboardAccess true
|
|
25834
25840
|
style - (default true) set to false to ignore styles set with the STYLE - will receive original parameter defaults
|
|
25835
25841
|
group - (default null) set to String (or comma delimited String) so STYLE can set default styles to the group(s) (like a CSS class)
|
|
25836
25842
|
inherit - (default null) used internally but can receive an {} of styles directly
|
|
@@ -38246,6 +38252,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
38246
38252
|
that.dropperUp = frame.stage.on("stagemouseup", function() {
|
|
38247
38253
|
placeDropper();
|
|
38248
38254
|
if (swatch && spectrum && spectrumHit && swatch.color != dropper.borderColor) setColorDrop();
|
|
38255
|
+
else if (!swatch && spectrum && spectrumHit) setColorDrop()
|
|
38249
38256
|
});
|
|
38250
38257
|
}
|
|
38251
38258
|
function removeSpectrumEvents() {
|
|
@@ -39470,7 +39477,7 @@ rtl - (default false) (Experimental) set to true to use right-to-left text
|
|
|
39470
39477
|
hardKeyboard - (default true) set to false to not include keypresses from physical keyboard
|
|
39471
39478
|
layout - (default "qwerty") set to change the layout (also see data parameter for custom layout)
|
|
39472
39479
|
additionally supported layouts are "azerty", "hebrew", "turkish", "arabic" - thanks to those who submitted layouts!
|
|
39473
|
-
please let us know at https://zimjs.com
|
|
39480
|
+
please let us know at https://forum.zimjs.com if you are using a layout that others would use!
|
|
39474
39481
|
numPadScale - (default .8) the scale of the NumPad when pressed from the numPad key at bottom right
|
|
39475
39482
|
numPadDraggable - (default true) set to false to not be able to drag the NumPad
|
|
39476
39483
|
numPadOnly - (default false) set to true to open the NumPad only but can then use with labels
|
|
@@ -42019,7 +42026,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
42019
42026
|
if (snapH) node.x = Math.round(node.x / snapH)*snapH;
|
|
42020
42027
|
if (snapV) node.y = Math.round(node.y / snapV)*snapV;
|
|
42021
42028
|
}
|
|
42022
|
-
if ((min && zim.dist(node.x, node.y, node.startX, node.startY) < min) || (max && zim.dist(node.x, node.y, node.startX, node.startY) > max)) {
|
|
42029
|
+
if ((min && zim.dist(node.x, node.y, node.startX, node.startY) < min) || (max && zim.dist(node.x, node.y, node.startX, node.startY) > max)) {
|
|
42023
42030
|
if (node.adding) {
|
|
42024
42031
|
removeNode(node, true);
|
|
42025
42032
|
} else {
|
|
@@ -42104,26 +42111,27 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
42104
42111
|
noConnect(node);
|
|
42105
42112
|
return;
|
|
42106
42113
|
}
|
|
42107
|
-
} else if (dropType == "on" || dropType == "single") { // can't be off a node
|
|
42114
|
+
} else if (dropType == "on" || dropType == "single") { // can't be off a node
|
|
42108
42115
|
var hitCount = 0;
|
|
42109
42116
|
var hitObj;
|
|
42110
42117
|
var bad = nodes.loop(function (obj) {
|
|
42111
42118
|
if (node == obj) return;
|
|
42112
42119
|
if (node.hitTestCircles(obj)) {
|
|
42113
|
-
hitObj = obj;
|
|
42114
|
-
|
|
42120
|
+
hitObj = obj;
|
|
42121
|
+
hitCount++;
|
|
42122
|
+
hitCount+=obj.creations.length;
|
|
42123
|
+
if (that.bases && (obj.endNode===false || (obj.endNode!==true && obj.base && obj.base.endNode===false) || node.orientation != obj.orientation || (node.creator && node.creator.base && node.creator.base == obj.base))) return "no";
|
|
42115
42124
|
if (node.dropArray) if (node.dropArray.indexOf(obj.dropIndex) == -1) return;
|
|
42116
42125
|
if (!duplicateLine && node.lineArray && node.lineArray.indexOf(obj.dropIndex) != -1) return;
|
|
42117
42126
|
if (dropType == "on") return false; // bad will be true
|
|
42118
|
-
hitCount++;
|
|
42119
|
-
hitCount+=obj.creations.length;
|
|
42127
|
+
// hitCount++;
|
|
42128
|
+
// hitCount+=obj.creations.length;
|
|
42120
42129
|
}
|
|
42121
|
-
});
|
|
42122
|
-
|
|
42123
|
-
if (bad && !(dropType=="single" && hitCount==1)) {
|
|
42130
|
+
});
|
|
42131
|
+
if (bad=="no" || (bad && !(dropType=="single" && hitCount==1))) {
|
|
42124
42132
|
noConnect(node);
|
|
42125
42133
|
return;
|
|
42126
|
-
} else {
|
|
42134
|
+
} else {
|
|
42127
42135
|
node.loc(hitObj);
|
|
42128
42136
|
if ((node.creator && node.orientation==zim.VERTICAL && Math.round(node.y) == Math.round(node.creator.startY)) || (node.creator && node.orientation==zim.HORIZONTAL && Math.round(node.x) == Math.round(node.creator.startX))) return;
|
|
42129
42137
|
that.targetNode = hitObj;
|
|
@@ -42138,7 +42146,6 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
42138
42146
|
node.creator.lineArray.push(node.dropIndex);
|
|
42139
42147
|
}
|
|
42140
42148
|
// TODO: add more lineType options like a side connector (down/across/up) and an elbow connector (down/up)
|
|
42141
|
-
// do not let nodes be next to one another sideways
|
|
42142
42149
|
if (hitObj.base && hitObj.base.connectors) addBaseConnector(hitObj.base, node);
|
|
42143
42150
|
connected = true; // ZIM ZIM 02 - changed this from complete to connected - think it was an original typo
|
|
42144
42151
|
}
|
|
@@ -43096,6 +43103,8 @@ x, y, rotation, scaleX, scaleY, regX, regY, skewX, skewY,
|
|
|
43096
43103
|
alpha, cursor, shadow, name, mouseChildren, mouseEnabled, parent, numChildren, etc.
|
|
43097
43104
|
|
|
43098
43105
|
EVENTS
|
|
43106
|
+
dispatches a "page" event when starting an animation
|
|
43107
|
+
dispatches a "goleft" and a "goright" event when going left or right - just after the page event
|
|
43099
43108
|
dispatches a "transitioned" event when item finishes changing
|
|
43100
43109
|
dispatches a "bounced" event on each bounce
|
|
43101
43110
|
dispatches a "bouncedone" event if the cycle bounceNum is set and the bounce is done
|
|
@@ -43272,6 +43281,8 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
43272
43281
|
if (that.tile.x < tileStartX) {
|
|
43273
43282
|
that.disableArrows();
|
|
43274
43283
|
selectedIndex--;
|
|
43284
|
+
that.dispatchEvent("page");
|
|
43285
|
+
that.dispatchEvent("goleft");
|
|
43275
43286
|
that.tile.animate({
|
|
43276
43287
|
props: {x:that.tile.x+itemWidth+spacing},
|
|
43277
43288
|
time: t,
|
|
@@ -43292,6 +43303,8 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
43292
43303
|
if (that.tile.x + that.tile.width > cw-arrowRight.oW-paddingH-arrowGap) {
|
|
43293
43304
|
that.disableArrows();
|
|
43294
43305
|
selectedIndex++;
|
|
43306
|
+
that.dispatchEvent("page");
|
|
43307
|
+
that.dispatchEvent("goright");
|
|
43295
43308
|
that.tile.animate({
|
|
43296
43309
|
props: {x:that.tile.x-itemWidth-spacing},
|
|
43297
43310
|
time: t,
|
|
@@ -43497,7 +43510,6 @@ NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set
|
|
|
43497
43510
|
|
|
43498
43511
|
EXAMPLE
|
|
43499
43512
|
const loader = new Loader({
|
|
43500
|
-
frame:frame,
|
|
43501
43513
|
label:"UPLOAD PIC OR DROP PICS HERE",
|
|
43502
43514
|
width:700,
|
|
43503
43515
|
height:400,
|
|
@@ -43520,7 +43532,6 @@ END EXAMPLE
|
|
|
43520
43532
|
EXAMPLE
|
|
43521
43533
|
// loading a JSON file:
|
|
43522
43534
|
const loader = new Loader({
|
|
43523
|
-
frame:frame,
|
|
43524
43535
|
type:"JSON",
|
|
43525
43536
|
label:"UPLOAD JSON",
|
|
43526
43537
|
width:700,
|
|
@@ -46811,7 +46822,7 @@ So it is possible that the previous object can still be accessed with parent.get
|
|
|
46811
46822
|
parent.getChildByName() will find the first child with that name in the container
|
|
46812
46823
|
object() will find the last named object with that name anywhere
|
|
46813
46824
|
We could remove previous name properties with the same name but we decided not to
|
|
46814
|
-
Let us know your thoughts at zimjs.com
|
|
46825
|
+
Let us know your thoughts at https://forum.zimjs.com
|
|
46815
46826
|
|
|
46816
46827
|
EXAMPLE
|
|
46817
46828
|
new Circle().nam("ball").center();
|
|
@@ -46965,7 +46976,7 @@ new Circle(50, red).tap(e=>{
|
|
|
46965
46976
|
END EXAMPLE
|
|
46966
46977
|
|
|
46967
46978
|
EXAMPLE
|
|
46968
|
-
new Button().tap(
|
|
46979
|
+
new Button().tap(()=>{
|
|
46969
46980
|
zgo("https://zimjs.com", "_blank"); // open ZIM site in new tab
|
|
46970
46981
|
});
|
|
46971
46982
|
END EXAMPLE
|
|
@@ -47113,11 +47124,13 @@ DESCRIPTION
|
|
|
47113
47124
|
removes the mousedown and mouseup events added with tap()
|
|
47114
47125
|
|
|
47115
47126
|
EXAMPLE
|
|
47116
|
-
|
|
47117
|
-
|
|
47127
|
+
let num = 0;
|
|
47128
|
+
const circle = new Circle(50, red).center().tap(e=>{
|
|
47129
|
+
num++;
|
|
47130
|
+
e.target.alpha -= .2;
|
|
47131
|
+
if (num == 2) circle.noTap();
|
|
47118
47132
|
S.update();
|
|
47119
47133
|
});
|
|
47120
|
-
if (score > 10) circle.noTap();
|
|
47121
47134
|
END EXAMPLE
|
|
47122
47135
|
|
|
47123
47136
|
RETURNS obj for chaining
|
|
@@ -48453,12 +48466,12 @@ input (default DEFAULTWIRE or "currentValue" or "selectedIndex" or prop) - an op
|
|
|
48453
48466
|
|
|
48454
48467
|
RETURNS obj for chaining
|
|
48455
48468
|
--*///+33.2
|
|
48456
|
-
zim.wire = function(
|
|
48457
|
-
var sig = "
|
|
48469
|
+
zim.wire = function(obj, target, prop, twoWay, setSource, filter, call, input) {
|
|
48470
|
+
var sig = "obj, target, prop, twoWay, setSource, filter, call, input";
|
|
48458
48471
|
var duo; if (duo = zob(zim.wire, arguments, sig)) return duo;
|
|
48459
48472
|
z_d("33.2");
|
|
48460
|
-
if (zot(zim.Ticker)) if (zon) {zogy("wire() - requires ZIM Frame"); return
|
|
48461
|
-
if (zot(target)) if (zon) {zogy("wire() - requires a target"); return
|
|
48473
|
+
if (zot(zim.Ticker)) if (zon) {zogy("wire() - requires ZIM Frame"); return obj;}
|
|
48474
|
+
if (zot(target)) if (zon) {zogy("wire() - requires a target"); return obj;}
|
|
48462
48475
|
|
|
48463
48476
|
var DW = zim.DEFAULTWIRE;
|
|
48464
48477
|
if (WW.DEFAULTWIRE != null) DW = WW.DEFAULTWIRE;
|
|
@@ -48468,18 +48481,18 @@ RETURNS obj for chaining
|
|
|
48468
48481
|
} else if (DW && DW != "currentValue" && DW != "selectedIndex") {
|
|
48469
48482
|
input = DW;
|
|
48470
48483
|
} else {
|
|
48471
|
-
if (DW && Object.prototype.hasOwnProperty.call(
|
|
48484
|
+
if (DW && Object.prototype.hasOwnProperty.call(obj,DW)) input = DW;
|
|
48472
48485
|
else {
|
|
48473
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
48474
|
-
else if (Object.prototype.hasOwnProperty.call(
|
|
48486
|
+
if (Object.prototype.hasOwnProperty.call(obj,"currentValue")) input = "currentValue";
|
|
48487
|
+
else if (Object.prototype.hasOwnProperty.call(obj,"selectedIndex")) input = "selectedIndex";
|
|
48475
48488
|
else input = prop;
|
|
48476
48489
|
}
|
|
48477
48490
|
}
|
|
48478
48491
|
if (zot(prop)) prop = input;
|
|
48479
|
-
if (
|
|
48492
|
+
if (obj.addChild) obj.zimWire = true;
|
|
48480
48493
|
if (target.addChild) target.zimWired = true;
|
|
48481
|
-
zim.Ticker.addWire(
|
|
48482
|
-
return
|
|
48494
|
+
zim.Ticker.addWire(obj, [target, prop, twoWay, setSource, filter, call, input]);
|
|
48495
|
+
return obj;
|
|
48483
48496
|
};//-33.2
|
|
48484
48497
|
|
|
48485
48498
|
/*--
|
|
@@ -48512,7 +48525,7 @@ RETURNS obj for chaining
|
|
|
48512
48525
|
var sig = "obj, target, prop, input";
|
|
48513
48526
|
var duo; if (duo = zob(zim.noWire, arguments, sig)) return duo;
|
|
48514
48527
|
z_d("33.25");
|
|
48515
|
-
if (zot(zim.Ticker)) if (zon) {zogy("noWire() - requires ZIM Frame"); return
|
|
48528
|
+
if (zot(zim.Ticker)) if (zon) {zogy("noWire() - requires ZIM Frame"); return obj;}
|
|
48516
48529
|
zim.Ticker.removeWire(obj, target, prop, input);
|
|
48517
48530
|
return obj;
|
|
48518
48531
|
};//-33.25
|
|
@@ -48553,7 +48566,7 @@ RETURNS obj for chaining
|
|
|
48553
48566
|
var sig = "obj, source, prop, twoWay, setSource, filter, call, input";
|
|
48554
48567
|
var duo; if (duo = zob(zim.wired, arguments, sig)) return duo;
|
|
48555
48568
|
z_d("33.3");
|
|
48556
|
-
if (zot(zim.Ticker)) if (zon) {zogy("wired() - requires ZIM Frame"); return
|
|
48569
|
+
if (zot(zim.Ticker)) if (zon) {zogy("wired() - requires ZIM Frame"); return obj;}
|
|
48557
48570
|
zim.wire(source, obj, prop, twoWay, setSource, filter, call, input);
|
|
48558
48571
|
return obj;
|
|
48559
48572
|
};//-33.3
|
|
@@ -48575,12 +48588,12 @@ END EXAMPLE
|
|
|
48575
48588
|
|
|
48576
48589
|
RETURNS obj for chaining
|
|
48577
48590
|
--*///+33.35
|
|
48578
|
-
zim.noWired = function(
|
|
48579
|
-
var sig = "
|
|
48591
|
+
zim.noWired = function(obj, source, prop, input) {
|
|
48592
|
+
var sig = "obj, source, prop, input";
|
|
48580
48593
|
var duo; if (duo = zob(zim.noWire, arguments, sig)) return duo;
|
|
48581
48594
|
z_d("33.35");
|
|
48582
|
-
if (zot(zim.Ticker)) if (zon) {zogy("noWired() - requires ZIM Frame"); return
|
|
48583
|
-
zim.Ticker.removeWire(source,
|
|
48595
|
+
if (zot(zim.Ticker)) if (zon) {zogy("noWired() - requires ZIM Frame"); return obj;}
|
|
48596
|
+
zim.Ticker.removeWire(source, obj, prop, input);
|
|
48584
48597
|
return target;
|
|
48585
48598
|
};//-33.35
|
|
48586
48599
|
|
|
@@ -53871,22 +53884,22 @@ RETURNS the target for chaining (or null if no target is provided and run on zim
|
|
|
53871
53884
|
}
|
|
53872
53885
|
}
|
|
53873
53886
|
|
|
53874
|
-
|
|
53875
|
-
|
|
53876
|
-
|
|
53877
|
-
|
|
53887
|
+
// ZIM 016 - HANDLE RE-ANIMATE - animating the same as already animating
|
|
53888
|
+
// might override the tween so the previous does not finish
|
|
53889
|
+
// and would not endTween() which removes tweens at id and turns off Ticker.
|
|
53890
|
+
// endTween(id);
|
|
53878
53891
|
|
|
53879
|
-
|
|
53880
|
-
|
|
53881
|
-
|
|
53882
|
-
|
|
53883
|
-
|
|
53884
|
-
|
|
53885
|
-
|
|
53886
|
-
|
|
53887
|
-
|
|
53888
|
-
|
|
53889
|
-
|
|
53892
|
+
var oAr = [];
|
|
53893
|
+
for (var o in obj) {oAr.push(o);}
|
|
53894
|
+
oAr = oAr.sort().toString();
|
|
53895
|
+
if (!target.z_twpr) target.z_twpr = {};
|
|
53896
|
+
else if (!seriesWait > 0 && !wait > 0) { // adjusted in ZIM 016 patch to allow series to work
|
|
53897
|
+
var matchID = target.z_twpr[oAr];
|
|
53898
|
+
if (matchID) {
|
|
53899
|
+
endTween(matchID, true); // true prevents stopping all tweens in endTween
|
|
53900
|
+
}
|
|
53901
|
+
}
|
|
53902
|
+
target.z_twpr[oAr] = id;
|
|
53890
53903
|
|
|
53891
53904
|
// REWIND TWEENS
|
|
53892
53905
|
|
|
@@ -56708,7 +56721,7 @@ INHERIT
|
|
|
56708
56721
|
Objects can inherit styles from their parent
|
|
56709
56722
|
Eg. setting a color font property on List will pass that to Tabs which pass it to Button which passes it to Label
|
|
56710
56723
|
This was initially set up manually but a new inherit parameter was created for a better system
|
|
56711
|
-
If any styles are not being applied as expected or as desired, let us know at https://zimjs.com
|
|
56724
|
+
If any styles are not being applied as expected or as desired, let us know at https://forum.zimjs.com and we can adjust!
|
|
56712
56725
|
The inherit property on the Components can be used to pass an object literal of styles to the component directly as well
|
|
56713
56726
|
|
|
56714
56727
|
STYLES FOR CUSTOM CLASSES
|
|
@@ -61990,7 +62003,7 @@ note: the item is not the event object target - as that is the tile
|
|
|
61990
62003
|
//-66.5
|
|
61991
62004
|
|
|
61992
62005
|
/*--
|
|
61993
|
-
zim.Pack = function(width, height, items, spacingH, spacingV, flatten, direction, lock, backgroundColor, align, valign, lastAlign, paddingH, paddingV, dragOrder, dragColor, dragThickness, dragDashed, reverse, funnel, showPacking, order, style, group, inherit)
|
|
62006
|
+
zim.Pack = function(width, height, items, spacingH, spacingV, flatten, direction, lock, backgroundColor, align, valign, lastAlign, paddingH, paddingV, dragOrder, dragColor, dragThickness, dragDashed, reverse, funnel, showPacking, order, container, style, group, inherit)
|
|
61994
62007
|
|
|
61995
62008
|
Pack
|
|
61996
62009
|
zim class - extends a zim.Container which extends a createjs.Container
|
|
@@ -62081,6 +62094,7 @@ showPacking - (default false) set to true to show packing steps at an interval o
|
|
|
62081
62094
|
order - (default null) set to an array of order data - see getOrder() get the array after dragging and setOrder() to dynamically set an order
|
|
62082
62095
|
the format is [index, index, index, etc.] for each item where index is the new desired index for each original item
|
|
62083
62096
|
also see TransformManager(pack, "id") to automatically save the current order and remake the pack in the last order on refresh
|
|
62097
|
+
container - (default stage) a container that holds the Pack - just used to place the beacon in the container
|
|
62084
62098
|
style - (default true) set to false to ignore styles set with the STYLE - will receive original parameter defaults
|
|
62085
62099
|
group - (default null) set to String (or comma delimited String) so STYLE can set default styles to the group(s) (like a CSS class)
|
|
62086
62100
|
inherit - (default null) used internally but can receive an {} of styles directly
|
|
@@ -62131,8 +62145,8 @@ EVENTS
|
|
|
62131
62145
|
dispatches a change event if items are re-ordered
|
|
62132
62146
|
|
|
62133
62147
|
--*///+66.55
|
|
62134
|
-
zim.Pack = function(width, height, items, spacingH, spacingV, flatten, direction, lock, backgroundColor, align, valign, lastAlign, paddingH, paddingV, dragOrder, dragColor, dragThickness, dragDashed, reverse, funnel, showPacking, order, style, group, inherit) {
|
|
62135
|
-
var sig = "width, height, items, spacingH, spacingV, flatten, direction, lock, backgroundColor, align, valign, lastAlign, paddingH, paddingV, dragOrder, dragColor, dragThickness, dragDashed, reverse, funnel, showPacking, order, style, group, inherit";
|
|
62148
|
+
zim.Pack = function(width, height, items, spacingH, spacingV, flatten, direction, lock, backgroundColor, align, valign, lastAlign, paddingH, paddingV, dragOrder, dragColor, dragThickness, dragDashed, reverse, funnel, showPacking, order, container, style, group, inherit) {
|
|
62149
|
+
var sig = "width, height, items, spacingH, spacingV, flatten, direction, lock, backgroundColor, align, valign, lastAlign, paddingH, paddingV, dragOrder, dragColor, dragThickness, dragDashed, reverse, funnel, showPacking, order, container, style, group, inherit";
|
|
62136
62150
|
var duo; if (duo = zob(zim.Pack, arguments, sig, this)) return duo;
|
|
62137
62151
|
z_d("66.52");
|
|
62138
62152
|
|
|
@@ -62411,7 +62425,7 @@ zim.Pack = function(width, height, items, spacingH, spacingV, flatten, direction
|
|
|
62411
62425
|
if (items.indexOf(downItem) < 0) return; // spacing or background selected
|
|
62412
62426
|
pb = that.localToGlobal(that.getBounds().x, that.getBounds().y);
|
|
62413
62427
|
var b = downItem.boundsToGlobal();
|
|
62414
|
-
that.ghost.siz(b.width, b.height).reg(CENTER).loc(b.x+ghost.width/2, b.y+ghost.height/2, that.stage);
|
|
62428
|
+
that.ghost.siz(b.width, b.height).reg(CENTER).loc(b.x+ghost.width/2, b.y+ghost.height/2, container||that.stage);
|
|
62415
62429
|
ghost.diffX = that.stage.frame.mouseX-ghost.x;
|
|
62416
62430
|
ghost.diffY = that.stage.frame.mouseY-ghost.y;
|
|
62417
62431
|
downIndex = pack.getChildIndex(downItem);
|
|
@@ -62421,7 +62435,7 @@ zim.Pack = function(width, height, items, spacingH, spacingV, flatten, direction
|
|
|
62421
62435
|
that.pmEvent = that.on("pressmove", function() {
|
|
62422
62436
|
if (!ghost.parent) return;
|
|
62423
62437
|
var f = that.stage.frame;
|
|
62424
|
-
ghost.loc(f.mouseX-ghost.diffX, f.mouseY-ghost.diffY);
|
|
62438
|
+
ghost.loc(f.mouseX-ghost.diffX, f.mouseY-ghost.diffY, container||that.stage);
|
|
62425
62439
|
var target = that.getObjectUnderPoint((ghost.x-pb.x)/that.scaleX, (ghost.y-pb.y)/that.scaleY, 1);
|
|
62426
62440
|
if (items.indexOf(target) >= 0) {
|
|
62427
62441
|
var b = target.boundsToGlobal();
|
|
@@ -62429,19 +62443,19 @@ zim.Pack = function(width, height, items, spacingH, spacingV, flatten, direction
|
|
|
62429
62443
|
if (direction==HORIZONTAL) {
|
|
62430
62444
|
// horizontal spacing may be off as estimated width is set to actual width when calculating
|
|
62431
62445
|
if (ghost.x >= b.x+b.width/2) {
|
|
62432
|
-
beacon.loc(b.x+b.width+spacingH/2*that.scaleX*pack.scaleX, b.y+b.height/2, that.stage);
|
|
62446
|
+
beacon.loc(b.x+b.width+spacingH/2*that.scaleX*pack.scaleX, b.y+b.height/2, container||that.stage);
|
|
62433
62447
|
targetIndex = pack.getChildIndex(target)+(reverse?0:1);
|
|
62434
62448
|
} else {
|
|
62435
|
-
beacon.loc(b.x-spacingH/2*that.scaleX*pack.scaleX, b.y+b.height/2, that.stage);
|
|
62449
|
+
beacon.loc(b.x-spacingH/2*that.scaleX*pack.scaleX, b.y+b.height/2, container||that.stage);
|
|
62436
62450
|
targetIndex = pack.getChildIndex(target)+(reverse?1:0);
|
|
62437
62451
|
}
|
|
62438
62452
|
} else {
|
|
62439
62453
|
// vertical spacing is not affected and then it gets rotated to horizontal so no adjustment
|
|
62440
62454
|
if (ghost.y >= b.y+b.height/2) {
|
|
62441
|
-
beacon.loc(b.x+b.width/2, b.y+b.height+spacingV/2, that.stage);
|
|
62455
|
+
beacon.loc(b.x+b.width/2, b.y+b.height+spacingV/2, container||that.stage);
|
|
62442
62456
|
targetIndex = pack.getChildIndex(target)+(reverse?0:1);
|
|
62443
62457
|
} else {
|
|
62444
|
-
beacon.loc(b.x+b.width/2, b.y-spacingV/2, that.stage);
|
|
62458
|
+
beacon.loc(b.x+b.width/2, b.y-spacingV/2, container||that.stage);
|
|
62445
62459
|
targetIndex = pack.getChildIndex(target)+(reverse?1:0);
|
|
62446
62460
|
}
|
|
62447
62461
|
}
|
|
@@ -62833,7 +62847,7 @@ zim.Pack = function(width, height, items, spacingH, spacingV, flatten, direction
|
|
|
62833
62847
|
}
|
|
62834
62848
|
|
|
62835
62849
|
this.clone = function() {
|
|
62836
|
-
return that.cloneProps(new zim.Pack(width, height, zim.copy(items, true), spacingH, spacingV, flatten, direction, lock, backgroundColor, align, valign, lastAlign, paddingH, paddingV, dragOrder, dragColor, dragThickness, dragDashed, reverse, funnel, showPacking, zim.copy(that.order), this.style, this.group));
|
|
62850
|
+
return that.cloneProps(new zim.Pack(width, height, zim.copy(items, true), spacingH, spacingV, flatten, direction, lock, backgroundColor, align, valign, lastAlign, paddingH, paddingV, dragOrder, dragColor, dragThickness, dragDashed, reverse, funnel, showPacking, zim.copy(that.order), container, this.style, this.group));
|
|
62837
62851
|
};
|
|
62838
62852
|
|
|
62839
62853
|
}
|
|
@@ -72296,7 +72310,7 @@ PARAMETERS
|
|
|
72296
72310
|
Pick Literal formats: [1,3,2] - random; {min:10, max:20} - range; series(1,2,3) - order, function(){return result;} - function
|
|
72297
72311
|
** supports OCT - parameter defaults can be set with STYLE control (like CSS)
|
|
72298
72312
|
obj - |ZIM VEE| (default Tile of Circles) the object to pixilate - the original will still exist.
|
|
72299
|
-
in theory, this can be any DisplayObject such as a Circle(), Button(), Container(),
|
|
72313
|
+
in theory, this can be any DisplayObject such as a Circle(), Button(), Container(), Pic(), etc.
|
|
72300
72314
|
amount - |ZIM VEE| (default .5) the amount to pixelate from 0-1.
|
|
72301
72315
|
the granularity depends on the amountFactor which is also from 0-1.
|
|
72302
72316
|
at a lower amountFactor, the 0-1 amount will focus on smaller pixilations.
|
|
@@ -72416,7 +72430,7 @@ alpha, cursor, shadow, name, mouseChildren, mouseEnabled, parent, numChildren, e
|
|
|
72416
72430
|
|
|
72417
72431
|
var lastBL = bL;
|
|
72418
72432
|
this.update = function() {
|
|
72419
|
-
|
|
72433
|
+
|
|
72420
72434
|
if (!obj.cacheCanvas || bL!=lastBL) {
|
|
72421
72435
|
obj.cache(boundary.x,boundary.y,boundary.width,boundary.height,bL);
|
|
72422
72436
|
lastBL = bL;
|
|
@@ -80933,7 +80947,7 @@ ticker - (default null) - an optional callback function to be added to the ZIM T
|
|
|
80933
80947
|
count starts at 1 and the stage is updated after this function is called
|
|
80934
80948
|
also see the pauseTicker() method
|
|
80935
80949
|
progress - (default null) - set to a Waiter() or ProgressBar() object to show while loading
|
|
80936
|
-
rollover - (default true) activates rollovers
|
|
80950
|
+
rollover - (default true or false on mobile) activates rollovers
|
|
80937
80951
|
touch - (default true) activates touch on mobile - this will be multitouch by default
|
|
80938
80952
|
set to false for no touch on mobile - also see singleTouch parameter to set singleTouch
|
|
80939
80953
|
scrollTop - (default false) activates scrolling on older apple devices to hide the url bar
|
|
@@ -83469,7 +83483,10 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
|
|
|
83469
83483
|
}, true);
|
|
83470
83484
|
var container = new zim.Container();
|
|
83471
83485
|
catIcon.sca(height/246).addTo(container).mov(0,-.4);
|
|
83472
|
-
if (mobile)
|
|
83486
|
+
if (mobile) {
|
|
83487
|
+
container.cache();
|
|
83488
|
+
container.setBounds(0,0,157.5*catIcon.scale,246*catIcon.scale);
|
|
83489
|
+
}
|
|
83473
83490
|
container.mouseChildren = false;
|
|
83474
83491
|
return container;
|
|
83475
83492
|
};
|
|
@@ -89072,7 +89089,7 @@ new Rectangle(500,500,dark).center();
|
|
|
89072
89089
|
// Create the Three object and scene (just store that in an easy variable)
|
|
89073
89090
|
// We set threejs interactive so we can use three.js orbit controls (needs a separate file imported)
|
|
89074
89091
|
// In the above examples at the URLs, we use a ZIM Swiper instead
|
|
89075
|
-
const three = new Three({frame:
|
|
89092
|
+
const three = new Three({frame:F, width:500, height:500, interactive:true});
|
|
89076
89093
|
const scene = three.scene;
|
|
89077
89094
|
|
|
89078
89095
|
// Here we make a three.js Cube - note the THREE namespace
|
|
@@ -90894,7 +90911,7 @@ where various Blob and Squiggle shapes can be selected from a menu
|
|
|
90894
90911
|
or custom Blob And Squiggle shapes can be made.
|
|
90895
90912
|
The code for the shapes can be copied into your app
|
|
90896
90913
|
as the Blob or Squiggle points parameter.
|
|
90897
|
-
Please contact us at https
|
|
90914
|
+
Please contact us at https:forum.zimjs.com
|
|
90898
90915
|
and we can perhaps add your Blob or Squiggle in the menu!
|
|
90899
90916
|
|
|
90900
90917
|
Note that PIZZAZZ 04 was created during ZIM NIO (version 9)
|