zimjs 17.2.4 → 17.2.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 +29 -9
package/package.json
CHANGED
package/src/zim.js
CHANGED
|
@@ -46667,10 +46667,12 @@ loader.on("loaded", e=>{
|
|
|
46667
46667
|
S.update();
|
|
46668
46668
|
});
|
|
46669
46669
|
|
|
46670
|
-
//
|
|
46671
|
-
saveButton
|
|
46672
|
-
|
|
46673
|
-
|
|
46670
|
+
// if wanting a save button
|
|
46671
|
+
const saveButton = new Button({label:"SAVE"})
|
|
46672
|
+
.pos(10,10,RIGHT,BOTTOM)
|
|
46673
|
+
.tap(()=>{
|
|
46674
|
+
loader.save(S); // or some other container... can specify crop bounds too
|
|
46675
|
+
}
|
|
46674
46676
|
END EXAMPLE
|
|
46675
46677
|
|
|
46676
46678
|
EXAMPLE
|
|
@@ -46909,7 +46911,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
46909
46911
|
if (accept) uploadTag.setAttribute("accept", accept);
|
|
46910
46912
|
uploadTag.hidden = true;
|
|
46911
46913
|
uploadTag.zimDisplay = uploadTag.style.display || "inline-block";
|
|
46912
|
-
uploadTag.style.cssText = "border:thin solid grey; z-index:2; width:" +
|
|
46914
|
+
uploadTag.style.cssText = "border:thin solid grey; z-index:2; width:" + width + "px; height:" + height + "px; overflow:hidden; outline:none;"
|
|
46913
46915
|
+ "position:absolute; left:0px; top:0px; display:none; cursor:pointer; opacity: 0; filter: alpha(opacity=0);";
|
|
46914
46916
|
|
|
46915
46917
|
this.addEventListener('mousedown', function() { // added for zim.Accessibility
|
|
@@ -50933,6 +50935,8 @@ RETURNS obj for chaining
|
|
|
50933
50935
|
// bring stageX and stageY into the parent's frame of reference
|
|
50934
50936
|
// could use e.localX and e.localY but might be dragging container or contents
|
|
50935
50937
|
dragObject = (currentTarget)?e.currentTarget:e.target;
|
|
50938
|
+
dragObject.dragStartX = dragObject.x;
|
|
50939
|
+
dragObject.dragStartY = dragObject.y;
|
|
50936
50940
|
|
|
50937
50941
|
|
|
50938
50942
|
if (obj.zimBoundary && !dragObject.getBounds()) {zogy("zim.drag() - drag object needs bounds set"); return;}
|
|
@@ -51222,7 +51226,8 @@ RETURNS obj for chaining
|
|
|
51222
51226
|
lastBackT = upT = 0;
|
|
51223
51227
|
}
|
|
51224
51228
|
|
|
51225
|
-
if (Math.abs(dX) < 1 && Math.abs(dY) < 1) {
|
|
51229
|
+
// if (Math.abs(dX) < 1 && Math.abs(dY) < 1) {
|
|
51230
|
+
if (Math.abs(dragObject.x-dragObject.dragStartX) < 1 && Math.abs(dragObject.y-dragObject.dragStartY) < 1) {
|
|
51226
51231
|
hasMoved = false;
|
|
51227
51232
|
dragObject.dispatchEvent("slidestop");
|
|
51228
51233
|
zim.Ticker.remove(obj.zimDragTicker);
|
|
@@ -55263,7 +55268,18 @@ interval(.05, ()=>{
|
|
|
55263
55268
|
|
|
55264
55269
|
// or if you have a THREEJS mesh
|
|
55265
55270
|
// use quotes to animate a dot property:
|
|
55266
|
-
animate(mesh, {"rotation.y":360*RAD},
|
|
55271
|
+
animate(mesh, {"rotation.y":360*RAD}, 10);
|
|
55272
|
+
|
|
55273
|
+
// or to use the ZIM DUO technique with the animate function (not method),
|
|
55274
|
+
// the normal obj parameter is called target so as not to conflict
|
|
55275
|
+
// with the old obj parameter which is now props but is kept for legacy purposes ;-)
|
|
55276
|
+
animate({
|
|
55277
|
+
target:mesh,
|
|
55278
|
+
props:{"rotation.y":360*RAD},
|
|
55279
|
+
time:10,
|
|
55280
|
+
loop:true,
|
|
55281
|
+
rewind:true
|
|
55282
|
+
});
|
|
55267
55283
|
|
|
55268
55284
|
// or CSS properties - see the CSS parameter for setup info
|
|
55269
55285
|
zss("tagID").opacity = 1; // set this even if it is default
|
|
@@ -83800,7 +83816,10 @@ zim.VR = function(content, angle, distance, parallax, parallaxAngle, damp, paral
|
|
|
83800
83816
|
|
|
83801
83817
|
VR
|
|
83802
83818
|
zim class - extends a ZIM Container which extends a CreateJS Container
|
|
83803
|
-
|
|
83819
|
+
|
|
83820
|
+
NOTE: Also see the ZIM Three Helper Module for XR controllers, movement and teleport in three.js
|
|
83821
|
+
with ZIM TextureActive (this VR() class is much simplified and not related to TextureActive)
|
|
83822
|
+
See: https://zimjs.com/three - for proper 3D
|
|
83804
83823
|
|
|
83805
83824
|
DESCRIPTION
|
|
83806
83825
|
Copies the content and displays a left and right channel (side-by-side) to be viewed with a VR helmet.
|
|
@@ -83847,7 +83866,8 @@ So if you have a label variable for the Label in the original content,
|
|
|
83847
83866
|
you can access the label in the right hand channel with label.vrMatch
|
|
83848
83867
|
The right channel objects also have vrMatch properties so label.vrMatch.vrMatch is the label ;-)
|
|
83849
83868
|
|
|
83850
|
-
SEE: https://zimjs.com/vr
|
|
83869
|
+
SEE: https://zimjs.com/vr.html
|
|
83870
|
+
SEE: https://zimjs.com/vr/sample.html
|
|
83851
83871
|
|
|
83852
83872
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
83853
83873
|
|