zimjs 16.2.3 → 16.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/zim.js +44 -40
package/package.json
CHANGED
package/src/zim.js
CHANGED
|
@@ -9237,14 +9237,14 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
9237
9237
|
recursiveDispose(this, disposing);
|
|
9238
9238
|
return true;
|
|
9239
9239
|
};
|
|
9240
|
-
zim.Container.prototype.specialColor = function(command, co, obj) {
|
|
9240
|
+
zim.Container.prototype.specialColor = function(command, co, obj, bounds) {
|
|
9241
9241
|
if (co.type=="GradientColor") {
|
|
9242
9242
|
if (!zot(co.angle)) {
|
|
9243
|
-
if (!obj.width) {
|
|
9243
|
+
if (!obj.width && zot(bounds)) {
|
|
9244
9244
|
command.style = co.colors[0];
|
|
9245
9245
|
return;
|
|
9246
9246
|
} else {
|
|
9247
|
-
var b = obj.getBounds();
|
|
9247
|
+
var b = bounds?bounds:obj.getBounds();
|
|
9248
9248
|
co.angle += 360*100000;
|
|
9249
9249
|
co.angle %= 360;
|
|
9250
9250
|
|
|
@@ -9297,12 +9297,12 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
9297
9297
|
|
|
9298
9298
|
} else if (co.type=="RadialColor") {
|
|
9299
9299
|
|
|
9300
|
-
if (zot(co.x0)) {
|
|
9300
|
+
if (zot(co.x0) && zot(bounds)) {
|
|
9301
9301
|
if (!obj.width) {
|
|
9302
9302
|
command.style = co.colors[0];
|
|
9303
9303
|
return;
|
|
9304
9304
|
} else {
|
|
9305
|
-
var b = obj.getBounds();
|
|
9305
|
+
var b = bounds?bounds:obj.getBounds();
|
|
9306
9306
|
co.r0 = 0;
|
|
9307
9307
|
if (obj.type=="Circle") {
|
|
9308
9308
|
co.x0 = 0;
|
|
@@ -16655,7 +16655,7 @@ Note the points property has been split into points and pointObjects (and there
|
|
|
16655
16655
|
draggable:true,
|
|
16656
16656
|
});
|
|
16657
16657
|
var textArea = that.textArea = new zim.TextArea(Math.min(400, that.stage.width-70), Math.min(400, that.stage.height-70));
|
|
16658
|
-
|
|
16658
|
+
pane.add(textArea);
|
|
16659
16659
|
}
|
|
16660
16660
|
that.textArea.text = JSON.stringify(points);
|
|
16661
16661
|
that.pane.show();
|
|
@@ -17349,7 +17349,6 @@ Note the points property has been split into points and pointObjects (and there
|
|
|
17349
17349
|
};
|
|
17350
17350
|
}
|
|
17351
17351
|
function insertPointData(points, controls, ratios, percent, controlType, skipPoint, dataOnly, even) {
|
|
17352
|
-
|
|
17353
17352
|
var index = points.length-1; // adjust for squiggle
|
|
17354
17353
|
var lastRatio = 0;
|
|
17355
17354
|
var currentRatio = 0;
|
|
@@ -17392,6 +17391,9 @@ Note the points property has been split into points and pointObjects (and there
|
|
|
17392
17391
|
points[(index+1)%points.length][5] = end.y;
|
|
17393
17392
|
}
|
|
17394
17393
|
if (controlType) newPoint[8] = controlType;
|
|
17394
|
+
// else newPoint[8] = "straight";
|
|
17395
|
+
// points[index][8] = "straight"
|
|
17396
|
+
// points[index+1][8] = "straight"
|
|
17395
17397
|
points.splice(index+1, 0, newPoint);
|
|
17396
17398
|
return index+1;
|
|
17397
17399
|
}
|
|
@@ -18836,7 +18838,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
18836
18838
|
draggable:true,
|
|
18837
18839
|
});
|
|
18838
18840
|
var textArea = that.textArea = new zim.TextArea(Math.min(400, that.stage.width-70), Math.min(400, that.stage.height-70));
|
|
18839
|
-
|
|
18841
|
+
pane.add(textArea);
|
|
18840
18842
|
}
|
|
18841
18843
|
pane.show();
|
|
18842
18844
|
textArea.text = JSON.stringify(points);
|
|
@@ -19577,6 +19579,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
19577
19579
|
points[(index+1)%points.length][5] = end.y;
|
|
19578
19580
|
}
|
|
19579
19581
|
if (controlType) newPoint[8] = controlType;
|
|
19582
|
+
|
|
19580
19583
|
points.splice(index+1, 0, newPoint);
|
|
19581
19584
|
return index+1;
|
|
19582
19585
|
}
|
|
@@ -34094,13 +34097,9 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
34094
34097
|
if (style!==false) zim.styleTransforms(this, DS); // global function - would have put on DisplayObject if had access to it
|
|
34095
34098
|
|
|
34096
34099
|
this.clone = function(exact) {
|
|
34097
|
-
|
|
34098
|
-
|
|
34099
|
-
|
|
34100
|
-
exactItems.push(that.tile.items[i].clone(true));
|
|
34101
|
-
}
|
|
34102
|
-
}
|
|
34103
|
-
return that.cloneProps(new zim.Selector(exact?zim.series(exactItems):(tile.clone?tile.clone():tile), borderColor, borderWidth, backgroundColor, corner, dashed, paddingH, paddingV, speed, diagonal, dim, multi, keyArrows, behind, resizeScale, selectedIndex, liveIndex, this.style, this.group));
|
|
34100
|
+
var cl = tile.clone?tile.clone(exact):tile;
|
|
34101
|
+
cl.x = cl.y = 0;
|
|
34102
|
+
return that.cloneProps(new zim.Selector(cl, borderColor, borderWidth, backgroundColor, corner, dashed, paddingH, paddingV, speed, diagonal, dim, multi, keyArrows, behind, resizeScale, selectedIndex, liveIndex, this.style, this.group));
|
|
34104
34103
|
};
|
|
34105
34104
|
this.dispose = function(a,b,disposing) {
|
|
34106
34105
|
if (that.keyEvent && that.stage) that.stage.frame.off("keydown", that.keyEvent);
|
|
@@ -61617,6 +61616,7 @@ note: the item is not the event object target - as that is the tile
|
|
|
61617
61616
|
if (style!==false) zim.styleTransforms(this, DS); // global function - would have put on DisplayObject if had access to it
|
|
61618
61617
|
|
|
61619
61618
|
this.clone = function(exact) {
|
|
61619
|
+
if (unique) exact = true; // added ZIM 016
|
|
61620
61620
|
if (exact) {
|
|
61621
61621
|
var exactItems = [];
|
|
61622
61622
|
if (backgroundColor) var exactBackgroundColors = [];
|
|
@@ -61626,7 +61626,7 @@ note: the item is not the event object target - as that is the tile
|
|
|
61626
61626
|
if (backgroundColor) exactBackgroundColors.push(backgroundColors[i]);
|
|
61627
61627
|
if (backing) exactBackings.push(backings[i].clone(true));
|
|
61628
61628
|
}
|
|
61629
|
-
}
|
|
61629
|
+
}
|
|
61630
61630
|
return that.cloneProps(new zim.Tile(exact&&exactItems?zim.series(exactItems):(obj.clone?obj.clone():obj), that.cols, that.rows, that.spacingH, that.spacingV, exact?false:unique, width, height, that.squeezeH, that.squeezeV, colSize, rowSize, align, valign, that.items.length, that.mirrorH, that.mirrorV, snapToPixel, exact?false:clone, events, exact, scaleToH, scaleToV, scaleToType, exact&&exactBackgroundColors?zim.series(exactBackgroundColors):backgroundColor, backgroundPadding, backgroundPaddingH, backgroundPaddingV, exact&&exactBackings?zim.series(exactBackings):(backing&&backing.clone)?backing.clone():backing, backdropColor, backdropPadding, backdropPaddingH, backdropPaddingV, (mat&&mat.clone)?mat.clone():mat, this.style, this.group));
|
|
61631
61631
|
};
|
|
61632
61632
|
};
|
|
@@ -62537,8 +62537,6 @@ sun.beads.animate({
|
|
|
62537
62537
|
});
|
|
62538
62538
|
END EXAMPLE
|
|
62539
62539
|
|
|
62540
|
-
path, obj, count, angle, startPercent, endPercent, percents, onTop, showControls, visible, interactive, clone, group, style, inherit
|
|
62541
|
-
|
|
62542
62540
|
PARAMETERS
|
|
62543
62541
|
** supports DUO - parameters or single object with properties below
|
|
62544
62542
|
** supports VEE - parameters marked with ZIM VEE mean a zim Pick() object or Pick Literal can be passed
|
|
@@ -62795,6 +62793,8 @@ regions - an array of region DisplayObjects with specific properties for each re
|
|
|
62795
62793
|
align defaults to middle for the regions
|
|
62796
62794
|
valign defaults to top and bottom for the top and bottom region and middle for the others
|
|
62797
62795
|
backgroundColor applies a backing color to the region
|
|
62796
|
+
only vertical GradientColor and centered RadialColor are supported at this time
|
|
62797
|
+
so use new GradientColor([blue,green]) or new GradientColor([orange, yellow])
|
|
62798
62798
|
Example HORIZONTAL region objects
|
|
62799
62799
|
[{obj:col1, marginLeft:10, maxHeight:80, width:20, valign:"bottom"},
|
|
62800
62800
|
{obj:col2, marginLeft:5, maxHeight:90, align:MIDDLE}, // note, middle gets no minWidth
|
|
@@ -62805,6 +62805,8 @@ regions - an array of region DisplayObjects with specific properties for each re
|
|
|
62805
62805
|
lastMargin - (default 0) the margin at the bottom (vertical) or at the right (horizontal)
|
|
62806
62806
|
lastMarginMin - (default 0) the minimum margin at the bottom (vertical) or at the right (horizontal)
|
|
62807
62807
|
backgroundColor - (default null) background color for the whole holder
|
|
62808
|
+
only vertical GradientColor and centered RadialColor are supported at this time
|
|
62809
|
+
so use new GradientColor([blue,green]) or new GradientColor([orange, yellow])
|
|
62808
62810
|
vertical - (default true) set to false for horizontal layout
|
|
62809
62811
|
showRegions - (default null) show boundaries of regions (formerly regionShape)
|
|
62810
62812
|
can toggle on and off with B key if this is set to true
|
|
@@ -63020,7 +63022,7 @@ will fill up the rest of the height until they reach their maximum widths
|
|
|
63020
63022
|
holder.setBounds(0,0,bounds.width,bounds.height);
|
|
63021
63023
|
backing.graphics.clear();
|
|
63022
63024
|
if (backgroundColor!="") {
|
|
63023
|
-
processColor(backing, backgroundColor);
|
|
63025
|
+
processColor(backing, backgroundColor, 0, 0, bounds.width, bounds.height);
|
|
63024
63026
|
backing.graphics.r(0,0,bounds.width,bounds.height);
|
|
63025
63027
|
}
|
|
63026
63028
|
for (i=0; i<regions.length; i++) {
|
|
@@ -63236,7 +63238,7 @@ will fill up the rest of the height until they reach their maximum widths
|
|
|
63236
63238
|
if (pPos == 0 || (pPos+p) == bounds[primary]) if (vertical) {addedH=1;} else {addedW=1;}
|
|
63237
63239
|
if (s == bounds[secondary]) if (vertical) {addedW=1;} else {addedH=1;}
|
|
63238
63240
|
if (r.backgroundColor != "") {
|
|
63239
|
-
processColor(backing, r.backgroundColor);
|
|
63241
|
+
processColor(backing, r.backgroundColor, f.bX, f.bY, f.bWidth+addedW, f.bHeight+addedH);
|
|
63240
63242
|
backing.graphics.r(f.bX, f.bY, f.bWidth+addedW, f.bHeight+addedH);
|
|
63241
63243
|
}
|
|
63242
63244
|
// increase our primary position
|
|
@@ -63246,9 +63248,11 @@ will fill up the rest of the height until they reach their maximum widths
|
|
|
63246
63248
|
|
|
63247
63249
|
}; // end resize
|
|
63248
63250
|
|
|
63249
|
-
function processColor(shape, co) {
|
|
63250
|
-
if (co.type == "GradientColor") shape.graphics.lf(co.colors, co.ratios, co.x0, co.y0, co.x1, co.y1);
|
|
63251
|
-
|
|
63251
|
+
function processColor(shape, co, x, y, w, h) {
|
|
63252
|
+
// if (co.type == "GradientColor") shape.graphics.lf(co.colors, co.ratios, co.x0, co.y0, co.x1, co.y1);
|
|
63253
|
+
if (co.type == "GradientColor") shape.graphics.lf(co.colors, co.ratios, x, y, x, y+h);
|
|
63254
|
+
// else if (co.type == "RadialColor") shape.graphics.rf(co.colors, co.ratios, co.x0, co.y0, co.r0, co.x1, co.y1, co.r1);
|
|
63255
|
+
else if (co.type == "RadialColor") shape.graphics.rf(co.colors, co.ratios, x+w/2, y+h/2, 0, x+w/2, y+h/2, Math.max(w/2,h/2));
|
|
63252
63256
|
else if (co.type == "BitmapColor") shape.graphics.bf(co.image, co.repetition, co.matrix);
|
|
63253
63257
|
else shape.graphics.f(r.backgroundColor);
|
|
63254
63258
|
}
|
|
@@ -79087,10 +79091,10 @@ the result of the play() or tone() method will dispatch a "complete" event when
|
|
|
79087
79091
|
if (wah) that2.removeWah();
|
|
79088
79092
|
}, (releaseTime+1)*1000);
|
|
79089
79093
|
};
|
|
79090
|
-
if (duration) this.stop(startTime+duration-.1);
|
|
79091
|
-
|
|
79092
|
-
|
|
79093
|
-
|
|
79094
|
+
// if (duration) this.stop(startTime+duration-.1);
|
|
79095
|
+
if (duration) setTimeout(function () {
|
|
79096
|
+
that2.stop();
|
|
79097
|
+
}, (duration-.1) * 1000);
|
|
79094
79098
|
|
|
79095
79099
|
var notes = this.notes = [oscillator];
|
|
79096
79100
|
|
|
@@ -79159,7 +79163,7 @@ the result of the play() or tone() method will dispatch a "complete" event when
|
|
|
79159
79163
|
if (zot(val)) val = 0;
|
|
79160
79164
|
if (zot(duration)) duration = that.rampDuration;
|
|
79161
79165
|
|
|
79162
|
-
if (gain) {
|
|
79166
|
+
if (gain) {
|
|
79163
79167
|
obj.cancelScheduledValues(audioContext.currentTime);
|
|
79164
79168
|
obj.linearRampToValueAtTime(
|
|
79165
79169
|
obj.value,
|
|
@@ -79172,8 +79176,8 @@ the result of the play() or tone() method will dispatch a "complete" event when
|
|
|
79172
79176
|
// gain.gain.setValueAtTime(gain.gain.value, audioContext.currentTime);
|
|
79173
79177
|
// gain.gain.linearRampToValueAtTime(volume*that.hush, audioContext.currentTime+that.rampDuration);
|
|
79174
79178
|
|
|
79175
|
-
} else {
|
|
79176
|
-
obj.cancelScheduledValues(audioContext.currentTime);
|
|
79179
|
+
} else {
|
|
79180
|
+
obj.cancelScheduledValues(audioContext.currentTime); // this is deleting duration setting... so took out in 015
|
|
79177
79181
|
obj.setTargetAtTime(val, audioContext.currentTime, duration);
|
|
79178
79182
|
}
|
|
79179
79183
|
|
|
@@ -83554,7 +83558,7 @@ METHODS (of AbstractSoundInstance)
|
|
|
83554
83558
|
stop() - stops the sound and sets the time to 0
|
|
83555
83559
|
play() - plays the sound again - usually, the sound is already playing from the sound.play()
|
|
83556
83560
|
but if it is stopped - this will start it again
|
|
83557
|
-
fade(volume, time, call) - fade in
|
|
83561
|
+
fade(volume, time, call) - fade in or out a playing sound in a time and call the call function when done
|
|
83558
83562
|
panSound(pan, time, call) - pan left (-1) or right (1) or in between a playing sound in a time and call the call function when done
|
|
83559
83563
|
|
|
83560
83564
|
PROPERTIES
|
|
@@ -83661,7 +83665,7 @@ loop - dispatched when the sound loops (but not at end of last loop - that is co
|
|
|
83661
83665
|
props:{volume:val},
|
|
83662
83666
|
time:time,
|
|
83663
83667
|
override:true,
|
|
83664
|
-
animateCall:function() {
|
|
83668
|
+
animateCall:function() {that.soundInstance.volume = ob.volume},
|
|
83665
83669
|
call:call
|
|
83666
83670
|
});
|
|
83667
83671
|
return that.sound;
|
|
@@ -83679,7 +83683,7 @@ loop - dispatched when the sound loops (but not at end of last loop - that is co
|
|
|
83679
83683
|
props:{pan:val},
|
|
83680
83684
|
time:time,
|
|
83681
83685
|
override:true,
|
|
83682
|
-
animateCall:function() {
|
|
83686
|
+
animateCall:function() {that.soundInstance.pan = ob.pan},
|
|
83683
83687
|
call:call
|
|
83684
83688
|
});
|
|
83685
83689
|
return that.sound;
|
|
@@ -84398,7 +84402,7 @@ Thanks Karel Rosseel for the initial research on Speech.
|
|
|
84398
84402
|
SEE: https://zimjs.com/016/speech.html
|
|
84399
84403
|
|
|
84400
84404
|
NOTE: The listen() method is currently not supported by Apple iOS Web - only Native apps (grr)
|
|
84401
|
-
But the talk() method works on iOS Web - however, there seems to be one voice.
|
|
84405
|
+
But the talk() method works on iOS and Android Web - however, there seems to be one voice.
|
|
84402
84406
|
|
|
84403
84407
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
84404
84408
|
|
|
@@ -84473,7 +84477,6 @@ recognition - the SpeechRecognition() object created (used internally) has JS pr
|
|
|
84473
84477
|
|
|
84474
84478
|
EVENTS
|
|
84475
84479
|
dispatches a "voiceschanged" event when voices property will be ready - not needed if just using default voice
|
|
84476
|
-
f preloaded this is dispatched 20 ms after the SVG is made.
|
|
84477
84480
|
dispatches "result" when either as each word is spoken if listen() is used (interim defaults to true)
|
|
84478
84481
|
or at the end of speaking words if listen(false) is used (interim is set to false)
|
|
84479
84482
|
the result event will have an event object (often e is used) that holds a words property with the words spoken
|
|
@@ -87183,14 +87186,15 @@ but usually, just pass the callback as the first parameter
|
|
|
87183
87186
|
backdropColor:backdropColor
|
|
87184
87187
|
});
|
|
87185
87188
|
var icon = new zim.Container();
|
|
87186
|
-
new zim.Shape().s(zim.dark).ss(3,1,0,3).p("AAAj0IAAFJAA8hoIBuAAIAAFdIlTAAIAAldIBuAA")
|
|
87189
|
+
new zim.Shape(50,30).s(zim.dark).ss(3,1,0,3).p("AAAj0IAAFJAA8hoIBuAAIAAFdIlTAAIAAldIBuAA")
|
|
87187
87190
|
.sca(1.7).addTo(icon);
|
|
87188
|
-
new zim.Shape().s(zim.dark).ss(3,1,0,3).p("AhGAlIBGhGIBHBG")
|
|
87191
|
+
new zim.Shape(50,30).s(zim.dark).ss(3,1,0,3).p("AhGAlIBGhGIBHBG")
|
|
87189
87192
|
.sca(1.7).addTo(icon).mov(0,-38);
|
|
87190
|
-
var tile = new zim.Tile([icon, label], 2, 1,
|
|
87193
|
+
var tile = new zim.Tile([icon, label], 2, 1, 20, 0, true)
|
|
87191
87194
|
if (tile.width > zdf.stage.width*.7) tile.width = zdf.stage.width*.7;
|
|
87192
|
-
tile.setBounds(-
|
|
87193
|
-
|
|
87195
|
+
tile.setBounds(-90,-10,480,100);
|
|
87196
|
+
tile.noMouse();
|
|
87197
|
+
icon.mov(-30,0);
|
|
87194
87198
|
tile.center(pane);
|
|
87195
87199
|
}
|
|
87196
87200
|
|