zimjs 17.2.8 → 17.3.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 +118 -57
- package/ts-src/typings/zim/index.d.ts +2 -2
package/package.json
CHANGED
package/src/zim.js
CHANGED
|
@@ -11226,9 +11226,19 @@ with various features like playing a labelled animation,
|
|
|
11226
11226
|
playing animation series, wait, loop, rewind and call functions.
|
|
11227
11227
|
This actually runs a ZIM animation and animates the frames.
|
|
11228
11228
|
|
|
11229
|
+
Sprites can also be used a Texture Atlas
|
|
11230
|
+
which is one image that holds many pictures.
|
|
11231
|
+
The sprite can be told to go to a frame and show the picture.
|
|
11232
|
+
This is how most games are made with a SpriteSheet of treasures, trees, etc.
|
|
11233
|
+
It is faster as it makes one GPU call.
|
|
11234
|
+
If the Sprite is not run, it will show a random frame (as if ZIM 017).
|
|
11235
|
+
If you want a specific frame then use the frame property or the run({frame:num}).
|
|
11236
|
+
|
|
11229
11237
|
SEE:
|
|
11230
11238
|
https://zimjs.com/interactiveanimation.html
|
|
11231
11239
|
https://zimjs.com/interactiveanimation/
|
|
11240
|
+
|
|
11241
|
+
older:
|
|
11232
11242
|
https://zimjs.com/spritesheet/
|
|
11233
11243
|
https://zimjs.com/spritesheet/skateboard.html
|
|
11234
11244
|
https://codepen.io/danzen/pen/yEKbbR
|
|
@@ -11301,11 +11311,23 @@ function ready() {
|
|
|
11301
11311
|
}
|
|
11302
11312
|
END EXAMPLE
|
|
11303
11313
|
|
|
11314
|
+
EXAMPLE
|
|
11315
|
+
// using Sprite as a texture atlas - or spritesheet of different images
|
|
11316
|
+
// load in assets and path
|
|
11317
|
+
new Frame({ready, assets:"ai_trees02.png", path:"https://zimjs.org/assets/"});
|
|
11318
|
+
function ready() {
|
|
11319
|
+
new Sprite("ai_trees02.png", 5, 4).center(); // will show a random tree
|
|
11320
|
+
new Sprite("ai_trees02.png", 5, 4).loc(200,200).run({frame:2}); // will show the third tree
|
|
11321
|
+
const tree = new Sprite("ai_trees02.png", 5, 4).loc(500,500);
|
|
11322
|
+
tree.frame = 5; // will show the 6th tree
|
|
11323
|
+
}
|
|
11324
|
+
END EXAMPLE
|
|
11325
|
+
|
|
11304
11326
|
EXAMPLE
|
|
11305
11327
|
// using Sprite as a texture atlas - or spritesheet of different images
|
|
11306
11328
|
// see: https://zimjs.com/zapp/Z_FDJXA
|
|
11307
11329
|
// load in assets and path
|
|
11308
|
-
new Frame({ready, assets:["fruit.png", "fruit.json"], path:"assets/"});
|
|
11330
|
+
new Frame({ready, assets:["fruit.png", "fruit.json"], path:"https://zimjs.org/assets/"});
|
|
11309
11331
|
function ready() {
|
|
11310
11332
|
new Sprite({json:"fruit.json", label:"apple"}).center();
|
|
11311
11333
|
}
|
|
@@ -11378,6 +11400,7 @@ globalControl - (default true) pauseRun and stopRun will control other animation
|
|
|
11378
11400
|
spriteSheet - (default null) pass in a CreateJS SpriteSheet to build a Sprite from that
|
|
11379
11401
|
label - (default null) pass in a label to stop on initially - to play from a label use the run({label:val}) method
|
|
11380
11402
|
frame - (default zimDefaultFrame) specify a Frame other than the default frame
|
|
11403
|
+
note - this is not the frame number of the Sprite - for that use the frame property or run({frame:num})
|
|
11381
11404
|
style - (default true) set to false to ignore styles set with the STYLE - will receive original parameter defaults
|
|
11382
11405
|
group - (default null) set to String (or comma delimited String) so STYLE can set default styles to the group(s) (like a CSS class)
|
|
11383
11406
|
inherit - (default null) used internally but can receive an {} of styles directly
|
|
@@ -11425,6 +11448,7 @@ run(time, label, call, params, wait, waitedCall, waitedParams, loop, loopCount,
|
|
|
11425
11448
|
endFrame - (default null - or totalFrames) the frame to end on - will be overridden by a label with frames
|
|
11426
11449
|
frame - (default null) set the single frame to run - will override startFrame and endFrame
|
|
11427
11450
|
this is good for a TextureAtlas where you show one frame of the sprite as a picture
|
|
11451
|
+
also see frame property - this just goes to the frame and does not use ZIM animate() in the background
|
|
11428
11452
|
tweek - (default 1) a factor for extra time on rewind and loops if needed
|
|
11429
11453
|
id - (default randomly assigned) an id you can use in other animations - available as sprite.id
|
|
11430
11454
|
use this id in other animations for pauseRun and stopRun to act on these as well
|
|
@@ -11458,6 +11482,7 @@ PROPERTIES
|
|
|
11458
11482
|
type - holds the class name as a String
|
|
11459
11483
|
id - an id that you can use in other animations to also be controlled by pauseRun() and stopRun()
|
|
11460
11484
|
frame - get and set the current frame of the Sprite
|
|
11485
|
+
As of ZIM 017, if the sprite is not run() then it will show a random frame
|
|
11461
11486
|
normalizedFrame - if animations have CreateJS speeds applied, zim handles these by making extra frames
|
|
11462
11487
|
for example, if a speed is given of .5 then two frames are made (min resulution is .1)
|
|
11463
11488
|
normalizedFrames - an array of total frames after being normalized - really for internal usage
|
|
@@ -11718,7 +11743,12 @@ animationend, change, added, click, dblclick, mousedown, mouseout, mouseover, pr
|
|
|
11718
11743
|
if (zot(tweek)) tweek = 1;
|
|
11719
11744
|
if (!zot(id)) that.id = id;
|
|
11720
11745
|
if (!zot(globalControl)) that.globalControl = globalControl;
|
|
11721
|
-
if (!zot(frame))
|
|
11746
|
+
if (!zot(frame)) {
|
|
11747
|
+
startFrame = endFrame = frame;
|
|
11748
|
+
that.frame = frame;
|
|
11749
|
+
that.randFrame = false;
|
|
11750
|
+
return that; // just go to the frame ZIM 017
|
|
11751
|
+
}
|
|
11722
11752
|
|
|
11723
11753
|
var extraTime;
|
|
11724
11754
|
if (Array.isArray(label)) {
|
|
@@ -11772,7 +11802,7 @@ animationend, change, added, click, dblclick, mousedown, mouseout, mouseover, pr
|
|
|
11772
11802
|
_normalizedFrame = 0;
|
|
11773
11803
|
that.gotoAndStop(_normalizedFrames[_normalizedFrame]);
|
|
11774
11804
|
startFrame = endFrame = null;
|
|
11775
|
-
obj = {normalizedFrame:_normalizedFrames.length-1};
|
|
11805
|
+
obj = {normalizedFrame:_normalizedFrames.length-1};
|
|
11776
11806
|
}
|
|
11777
11807
|
|
|
11778
11808
|
if (zot(time)) time = timeType=="s"?1:1000;
|
|
@@ -11843,6 +11873,7 @@ animationend, change, added, click, dblclick, mousedown, mouseout, mouseover, pr
|
|
|
11843
11873
|
}
|
|
11844
11874
|
return that;
|
|
11845
11875
|
};
|
|
11876
|
+
|
|
11846
11877
|
|
|
11847
11878
|
Object.defineProperty(this, 'frame', {
|
|
11848
11879
|
get: function() {
|
|
@@ -11850,6 +11881,7 @@ animationend, change, added, click, dblclick, mousedown, mouseout, mouseover, pr
|
|
|
11850
11881
|
},
|
|
11851
11882
|
set: function(value) {
|
|
11852
11883
|
value = Math.round(value);
|
|
11884
|
+
that.randFrame = false;
|
|
11853
11885
|
if (this.paused) {
|
|
11854
11886
|
this.gotoAndStop(value);
|
|
11855
11887
|
} else {
|
|
@@ -11887,11 +11919,11 @@ animationend, change, added, click, dblclick, mousedown, mouseout, mouseover, pr
|
|
|
11887
11919
|
});
|
|
11888
11920
|
|
|
11889
11921
|
if (style!==false) zim.styleTransforms(this, DS); // global function - would have put on DisplayObject if had access to it
|
|
11890
|
-
this.clone = function() {
|
|
11922
|
+
this.clone = function(exact) {
|
|
11891
11923
|
var s = this.cloneProps(new zim.Sprite(image, cols, rows, count, offsetX, offsetY, spacingX, spacingY, width, height, animations, json, null, globalControl, spriteSheet, label, frame, style, this.group, inherit));
|
|
11892
11924
|
|
|
11893
|
-
//
|
|
11894
|
-
if (that.
|
|
11925
|
+
// modified ZIM 017 late patch - for random frame sprite default with Tile, etc.
|
|
11926
|
+
if (exact || !that.randFrame) s.frame = that.frame;
|
|
11895
11927
|
|
|
11896
11928
|
return s;
|
|
11897
11929
|
};
|
|
@@ -11950,6 +11982,12 @@ animationend, change, added, click, dblclick, mousedown, mouseout, mouseover, pr
|
|
|
11950
11982
|
}
|
|
11951
11983
|
return that.cjsSprite_getBounds();
|
|
11952
11984
|
};
|
|
11985
|
+
|
|
11986
|
+
if (!label) {
|
|
11987
|
+
that.gotoAndStop(zim.rand(that.totalFrames-1));
|
|
11988
|
+
that.randFrame = true;
|
|
11989
|
+
}
|
|
11990
|
+
|
|
11953
11991
|
this.dispose = function() {
|
|
11954
11992
|
zim.gD(this); // globalDispose function for common elements
|
|
11955
11993
|
this.dispatchEvent("removed");
|
|
@@ -17316,7 +17354,7 @@ Note the points property has been split into points and pointObjects (and there
|
|
|
17316
17354
|
});
|
|
17317
17355
|
|
|
17318
17356
|
if (that.selectPoints) {
|
|
17319
|
-
sets.tap(function (e) {
|
|
17357
|
+
sets.tap({call:function (e) {
|
|
17320
17358
|
if (e.target.rect1) { // then mousedown on ball - which has a rect1
|
|
17321
17359
|
var ball = e.target;
|
|
17322
17360
|
that.selectedBalls.toggle(ball.parent.num);
|
|
@@ -17335,7 +17373,7 @@ Note the points property has been split into points and pointObjects (and there
|
|
|
17335
17373
|
po[3].color = that.selectedRect2s.isSelected(i)?selectColor:getBackgroundColor(po[4]);
|
|
17336
17374
|
}
|
|
17337
17375
|
stage.update();
|
|
17338
|
-
});
|
|
17376
|
+
}, mobileUp:true});
|
|
17339
17377
|
}
|
|
17340
17378
|
|
|
17341
17379
|
sets.on("pressmove", function(e) {
|
|
@@ -19567,7 +19605,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
19567
19605
|
});
|
|
19568
19606
|
|
|
19569
19607
|
if (that.selectPoints) {
|
|
19570
|
-
sets.tap(function (e) {
|
|
19608
|
+
sets.tap({call:function (e) {
|
|
19571
19609
|
var ball;
|
|
19572
19610
|
if (e.target.rect1) { // then mousedown on ball - which has a rect1
|
|
19573
19611
|
ball = e.target;
|
|
@@ -19587,7 +19625,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
19587
19625
|
po[3].color = that.selectedRect2s.isSelected(i)?selectColor:getBackgroundColor(po[4]);
|
|
19588
19626
|
}
|
|
19589
19627
|
e.target.stage.update();
|
|
19590
|
-
});
|
|
19628
|
+
}, mobileUp:true});
|
|
19591
19629
|
}
|
|
19592
19630
|
|
|
19593
19631
|
sets.on("pressmove", function(e) {
|
|
@@ -24942,6 +24980,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
24942
24980
|
var originalText = label.text;
|
|
24943
24981
|
var originalColor = label.color;
|
|
24944
24982
|
var originalRollColor = label.rollColor;
|
|
24983
|
+
var originalDownColor = label.rollColor;
|
|
24945
24984
|
this.on(toggleEvent, function() {
|
|
24946
24985
|
that.toggled = !that.toggled;
|
|
24947
24986
|
setToggled();
|
|
@@ -25334,7 +25373,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
25334
25373
|
downColor = value;
|
|
25335
25374
|
if (originalDownColor) originalDownColor = downColor;
|
|
25336
25375
|
if (that.label) {
|
|
25337
|
-
that.label.
|
|
25376
|
+
that.label.colorOnly = downColor;
|
|
25338
25377
|
}
|
|
25339
25378
|
}
|
|
25340
25379
|
});
|
|
@@ -27769,7 +27808,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
27769
27808
|
}
|
|
27770
27809
|
that.titleBar.tap(function () {
|
|
27771
27810
|
that.collapsed = !that.collapsed;
|
|
27772
|
-
}, null, null, null, true, null, null, null, null, false);
|
|
27811
|
+
}, null, null, null, true, null, null, null, null, false, true);
|
|
27773
27812
|
// that.collapseEvent = that.titleBar.on("dblclick", function () {
|
|
27774
27813
|
// that.collapsed = !that.collapsed;
|
|
27775
27814
|
// });
|
|
@@ -28956,8 +28995,10 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
28956
28995
|
stageEvent = stage.on("stagemousemove", function (e) {
|
|
28957
28996
|
// that.windowMouseX = e.stageX/zim.scaX;
|
|
28958
28997
|
// that.windowMouseY = e.stageY/zim.scaY;
|
|
28959
|
-
|
|
28960
|
-
|
|
28998
|
+
if (stage && stage.frame) {
|
|
28999
|
+
that.windowMouseX = stage.frame.mouseX;
|
|
29000
|
+
that.windowMouseY = stage.frame.mouseY;
|
|
29001
|
+
}
|
|
28961
29002
|
});
|
|
28962
29003
|
});
|
|
28963
29004
|
|
|
@@ -29262,7 +29303,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
29262
29303
|
if (that.titleBar) {
|
|
29263
29304
|
that.titleBar.tap(function () {
|
|
29264
29305
|
that.collapsed = !that.collapsed;
|
|
29265
|
-
}, null, null, null, true, null, null, null, null, false);
|
|
29306
|
+
}, null, null, null, true, null, null, null, null, false, true);
|
|
29266
29307
|
// that.collapseEvent = that.titleBar.on("dblclick", function () {
|
|
29267
29308
|
// that.collapsed = !that.collapsed;
|
|
29268
29309
|
// });
|
|
@@ -30721,7 +30762,7 @@ END EXAMPLE
|
|
|
30721
30762
|
PARAMETERS
|
|
30722
30763
|
** supports DUO - parameters or single object with properties below
|
|
30723
30764
|
** supports OCT - parameter defaults can be set with STYLE control (like CSS)
|
|
30724
|
-
width - (default
|
|
30765
|
+
width - (default 300) width of indicator
|
|
30725
30766
|
height - (default 50) height of indicator
|
|
30726
30767
|
num - (default 6) the number of lights
|
|
30727
30768
|
foregroundColor - (default "orange") color of the light(s) turned on
|
|
@@ -31400,7 +31441,7 @@ zim.TextInput = function(width, height, placeholder, text, size, font, color, ba
|
|
|
31400
31441
|
// that.dispatchEvent(e);
|
|
31401
31442
|
});
|
|
31402
31443
|
that.label.on("blinker", function () {
|
|
31403
|
-
|
|
31444
|
+
|
|
31404
31445
|
// Pettis Brandon code '23
|
|
31405
31446
|
var thatX = that.localToGlobal(0,0).x; // Get the global X of that.
|
|
31406
31447
|
var thatFull = thatX + width-paddingH-label.blinker.width; // Get the global coordinates of the far right corner.
|
|
@@ -31669,6 +31710,7 @@ zim.TextInput.LabelInput = function(text, size, maxLength, password, selectionCo
|
|
|
31669
31710
|
this.hiddenInput.pattern = "[^(0-9).\-+*/%$]*";
|
|
31670
31711
|
this.hiddenInput.inputmode = "numeric";
|
|
31671
31712
|
}
|
|
31713
|
+
var that = this;
|
|
31672
31714
|
|
|
31673
31715
|
if (maxLength > 0) this.hiddenInput.maxLength = maxLength;
|
|
31674
31716
|
this.hiddenInput.autocapitalize = "off";
|
|
@@ -31786,14 +31828,19 @@ zim.TextInput.LabelInput = function(text, size, maxLength, password, selectionCo
|
|
|
31786
31828
|
this.hiddenInput.select();
|
|
31787
31829
|
this.positionBlinkerAndSelection();
|
|
31788
31830
|
}
|
|
31831
|
+
this.hiddenInput.addEventListener("paste", function() {
|
|
31832
|
+
setTimeout(function() {
|
|
31833
|
+
that.hiddenInput.setSelectionRange(that.hiddenInput.selectionStart, that.hiddenInput.selectionEnd, rtl?"forward":"backward");
|
|
31834
|
+
// setTimeout(function() {that.positionBlinkerAndSelection()}, 50);
|
|
31835
|
+
}, 50);
|
|
31836
|
+
});
|
|
31789
31837
|
this.positionBlinkerAndSelection = function() {
|
|
31790
31838
|
// ZIM NFT 01 Patch any le or rtl
|
|
31791
31839
|
var le = this.text.length;
|
|
31792
31840
|
if (this.focus) {
|
|
31793
31841
|
var paddingH = this.backing || this.background ? this.paddingH : 0;
|
|
31794
31842
|
var paddingV = this.backing || this.background ? this.paddingV : 0;
|
|
31795
|
-
|
|
31796
|
-
if (this.hiddenInput.selectionStart !== this.hiddenInput.selectionEnd || le == 0) {
|
|
31843
|
+
if (this.hiddenInput.selectionStart !== this.hiddenInput.selectionEnd || le == 0) {
|
|
31797
31844
|
var startX, endX;
|
|
31798
31845
|
if (rtl) {
|
|
31799
31846
|
startX = this.textWidthArray[le-this.hiddenInput.selectionStart]
|
|
@@ -32141,7 +32188,7 @@ const list = new List({
|
|
|
32141
32188
|
.tap(()=>{
|
|
32142
32189
|
const currentID = list.accordionIndex;
|
|
32143
32190
|
const currentText = list.value;
|
|
32144
|
-
const parentID = list.tree.getParent(currentID);
|
|
32191
|
+
const parentID = list.tree.getParent("id"+currentID);
|
|
32145
32192
|
let parentText;
|
|
32146
32193
|
if (parentID) parentText = list.tree.getData(parentID).obj;
|
|
32147
32194
|
zog(currentID, currentText, parentID, parentText);
|
|
@@ -32171,7 +32218,7 @@ list - (default Options 1-30) an array of strings, numbers or zim Label objects
|
|
|
32171
32218
|
expander - (default "plus") set to "arrow" or "none" to change the expander icon - thanks Christopher Browne and Ofweird Top for the suggestions
|
|
32172
32219
|
subStyles - (default null) an array of style objects for each sublevel - with all the color and background color properties
|
|
32173
32220
|
See: https://zimjs.com/ten/accordion.html
|
|
32174
|
-
note: the Accordion List is currently incompatible with the Organizer,
|
|
32221
|
+
note: the Accordion List is currently incompatible with the Organizer, addAt() and removeAt()
|
|
32175
32222
|
viewNum - (default 5) how many items to show in the width and height provided
|
|
32176
32223
|
adjusting this number will also change the overall scale of custom items for horizontal lists
|
|
32177
32224
|
(this does not affect vertical lists due to the way vertical tabs are optimized)
|
|
@@ -32179,7 +32226,7 @@ viewNum - (default 5) how many items to show in the width and height provided
|
|
|
32179
32226
|
if no items are provided to start but rather added with addAt() then choose a viewNum that roughly matches how many items will fit in the view
|
|
32180
32227
|
Note - the items will not be scaled larger by a viewNum setting... only scaled smaller.
|
|
32181
32228
|
vertical - (default true) set to false to make a horizontal list
|
|
32182
|
-
currentSelected - (default false) set to true to show the
|
|
32229
|
+
currentSelected - (default false) set to true to show the curret selection as highlighted
|
|
32183
32230
|
align - (default CENTER) horizontal align
|
|
32184
32231
|
set to START to align LEFT for ZIM DIR constant is "ltr" or RIGHT when DIR="rtl" - END is the opposite
|
|
32185
32232
|
valign - (default CENTER) vertical align
|
|
@@ -33066,7 +33113,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
33066
33113
|
}
|
|
33067
33114
|
});
|
|
33068
33115
|
|
|
33069
|
-
that.tap(function(e) {
|
|
33116
|
+
that.tap({call:function(e) {
|
|
33070
33117
|
if (!that.selected || !that.selected.expander) return;
|
|
33071
33118
|
var data = tree.getData(that.selected.listZID);
|
|
33072
33119
|
if (!data.open && closeOthers) { // close
|
|
@@ -33075,19 +33122,19 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
33075
33122
|
return;
|
|
33076
33123
|
}
|
|
33077
33124
|
tapList(e);
|
|
33078
|
-
});
|
|
33125
|
+
}, mobileUp:true});
|
|
33079
33126
|
}
|
|
33080
33127
|
|
|
33081
33128
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
33082
33129
|
|
|
33083
33130
|
var _index;
|
|
33084
|
-
tabs.tap(function (e) {
|
|
33131
|
+
tabs.tap({call:function (e) {
|
|
33085
33132
|
if (e.target.index == that.index) return;
|
|
33086
33133
|
that.index = tabs.index;
|
|
33087
33134
|
that.dispatchEvent("change");
|
|
33088
33135
|
if (pulldownToggle) that.index = 0; // will cause pulldown to collapse
|
|
33089
33136
|
e.preventDefault();
|
|
33090
|
-
});
|
|
33137
|
+
}, mobileUp:true});
|
|
33091
33138
|
tabs.on("keychange", function (e) {
|
|
33092
33139
|
if (e.target.index == that.index) return;
|
|
33093
33140
|
that.index = tabs.index;
|
|
@@ -34135,10 +34182,10 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
34135
34182
|
c.backing = new zim.Rectangle(width-spacing*2, c.checkBox.height+paddingV*2, backgroundColor).addTo(c);
|
|
34136
34183
|
c.checkBox.center(c);
|
|
34137
34184
|
if (align != "center" && align != "middle") c.checkBox.pos(paddingH,null,align=="right");
|
|
34138
|
-
c.backing.tap(function () {
|
|
34185
|
+
c.backing.tap({call:function () {
|
|
34139
34186
|
c.checkBox.toggle();
|
|
34140
34187
|
c.zimOut(); // could do over() but like out()
|
|
34141
|
-
});
|
|
34188
|
+
}, mobileUp:true});
|
|
34142
34189
|
c.checkBox.change(function () {
|
|
34143
34190
|
c.zimOut();
|
|
34144
34191
|
});
|
|
@@ -38581,7 +38628,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
38581
38628
|
button.on("mousedown", function(e) {
|
|
38582
38629
|
that.buttonDown = e.currentTarget;
|
|
38583
38630
|
});
|
|
38584
|
-
button.on("pressup", function(e) {
|
|
38631
|
+
button.on("pressup", function(e) {
|
|
38585
38632
|
that.buttonDown = null;
|
|
38586
38633
|
var num = e.currentTarget.znum;
|
|
38587
38634
|
if (useTap || zim.ACTIONEVENT=="click") setTimeout(function(){changeBack(num);},50)
|
|
@@ -41332,7 +41379,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
41332
41379
|
that.titleBar.tap(function () {
|
|
41333
41380
|
if (that.collapsed) that.collapse(false);
|
|
41334
41381
|
else that.collapse(true);
|
|
41335
|
-
}, null, null, null, true, null, null, null, null, false);
|
|
41382
|
+
}, null, null, null, true, null, null, null, null, false, true);
|
|
41336
41383
|
// that.collapseEvent = dragger.on("dblclick", function () {
|
|
41337
41384
|
// if (that.collapsed) that.collapse(false);
|
|
41338
41385
|
// else that.collapse(true);
|
|
@@ -50145,16 +50192,16 @@ RETURNS obj for chaining
|
|
|
50145
50192
|
};//-47.76
|
|
50146
50193
|
|
|
50147
50194
|
/*--
|
|
50148
|
-
obj.tap = function(call, distance, time, once, dbl, dblTime, call2, call3, call4)
|
|
50195
|
+
obj.tap = function(call, distance, time, once, dbl, dblTime, call2, call3, call4, cursor, mobileUp)
|
|
50149
50196
|
|
|
50150
50197
|
tap
|
|
50151
50198
|
zim DisplayObject method
|
|
50152
50199
|
|
|
50153
50200
|
DESCRIPTION
|
|
50154
50201
|
Chainable convenience method that adds a mousedown and mouseup event to the object
|
|
50155
|
-
that requires the to move less than distance parameter
|
|
50202
|
+
that requires the mouse to move less than distance parameter
|
|
50156
50203
|
This is more like a proper click - down up without dragging.
|
|
50157
|
-
This method works on desktop or mobile, etc.
|
|
50204
|
+
This method works on desktop or mobile, etc. but on mobile, the default tap is mousedown
|
|
50158
50205
|
An optional time parameter is provided if a minimum time is desired.
|
|
50159
50206
|
Note that a click event also works on mobile as a "tap"
|
|
50160
50207
|
but click also allows dragging between down and up presses - so really is a mouseup.
|
|
@@ -50216,11 +50263,12 @@ call2 - (default null) a function to call on pressup if a tap is not made
|
|
|
50216
50263
|
call3 - (default null) with dbl set to true, a function to call on single tap regardless of a double tap or not
|
|
50217
50264
|
call4 - (default null) with dbl set to true, a function to call on single tap only if double tap fails
|
|
50218
50265
|
cursor - (default pointer) set to a CSS cursor or false if not wanting to set cursor on tap
|
|
50266
|
+
mobileUp - (default false) set to true to make tap() work on pressup on mobile - by default tap on mobile works on mousedown
|
|
50219
50267
|
|
|
50220
50268
|
RETURNS obj for chaining
|
|
50221
50269
|
--*///+47.8
|
|
50222
|
-
zim.tap = function(obj, call, distance, time, once, dbl, dblTime, call2, call3, call4, cursor) {
|
|
50223
|
-
var sig = "obj, call, distance, time, once, dbl, dblTime, call2, call3, call4, cursor";
|
|
50270
|
+
zim.tap = function(obj, call, distance, time, once, dbl, dblTime, call2, call3, call4, cursor, mobileUp) {
|
|
50271
|
+
var sig = "obj, call, distance, time, once, dbl, dblTime, call2, call3, call4, cursor, mobileUp";
|
|
50224
50272
|
var duo; if (duo = zob(zim.tap, arguments, sig)) return duo;
|
|
50225
50273
|
z_d("47.8");
|
|
50226
50274
|
if (zot(obj) || zot(call) || typeof call != "function") return;
|
|
@@ -50298,23 +50346,33 @@ RETURNS obj for chaining
|
|
|
50298
50346
|
var local = e.currentTarget.globalToLocal(e.stageX / zim.scaX, e.stageY / zim.scaY);
|
|
50299
50347
|
if (local.y <= 0) return; // avoid titleBar and organizer
|
|
50300
50348
|
}
|
|
50301
|
-
|
|
50302
|
-
|
|
50303
|
-
|
|
50304
|
-
|
|
50305
|
-
|
|
50306
|
-
|
|
50307
|
-
|
|
50308
|
-
|
|
50309
|
-
|
|
50310
|
-
|
|
50311
|
-
|
|
50312
|
-
|
|
50313
|
-
|
|
50314
|
-
|
|
50315
|
-
|
|
50316
|
-
|
|
50317
|
-
|
|
50349
|
+
if (M && !mobileUp && e.currentTarget.type != "List") {
|
|
50350
|
+
if (obj.excludeTap) return;
|
|
50351
|
+
call(e);
|
|
50352
|
+
if (once) {
|
|
50353
|
+
obj.off("mousedown", obj.zimClickDownEvent);
|
|
50354
|
+
obj.zimClickDownEvent = null;
|
|
50355
|
+
if (obj.cursor) obj.cur("default");
|
|
50356
|
+
}
|
|
50357
|
+
} else {
|
|
50358
|
+
var lastX = e.stageX / zim.scaX;
|
|
50359
|
+
var lastY = e.stageY / zim.scaY;
|
|
50360
|
+
var startTime = Date.now();
|
|
50361
|
+
obj.zimClickUpEvent = obj.on("pressup", function (e) {
|
|
50362
|
+
// commented does not work on 45 degree - hahaha - was still activating tap on 45 degree sliding list
|
|
50363
|
+
// if (Math.abs(lastX + lastY - e.stageX / zim.scaX - e.stageY / zim.scaY) < distance && Date.now() - startTime < (timeType=="s"?time*1000:time)) {
|
|
50364
|
+
if (Math.abs(lastX - e.stageX / zim.scaX) < distance && Math.abs(lastY - e.stageY / zim.scaY) < distance && Date.now() - startTime < (timeType=="s"?time*1000:time)) {
|
|
50365
|
+
if (obj.excludeTap) return;
|
|
50366
|
+
call(e);
|
|
50367
|
+
if (once) {
|
|
50368
|
+
obj.off("mousedown", obj.zimClickDownEvent);
|
|
50369
|
+
obj.zimClickDownEvent = null;
|
|
50370
|
+
if (obj.cursor) obj.cur("default");
|
|
50371
|
+
}
|
|
50372
|
+
} else if (call2) call2(e);
|
|
50373
|
+
e.remove();
|
|
50374
|
+
});
|
|
50375
|
+
}
|
|
50318
50376
|
});
|
|
50319
50377
|
}
|
|
50320
50378
|
|
|
@@ -59618,6 +59676,7 @@ RETURNS obj for chaining
|
|
|
59618
59676
|
zim.expand = function(obj, padding, paddingV, paddingRight, paddingBottom) {
|
|
59619
59677
|
var sig = "obj, padding, paddingV, paddingRight, paddingBottom";
|
|
59620
59678
|
var duo; if (duo = zob(zim.expand, arguments, sig)) return duo;
|
|
59679
|
+
if (obj.type=="AC"&&WW.zdf) {WW.zdf.ac("expand", arguments); return obj;}
|
|
59621
59680
|
z_d("50");
|
|
59622
59681
|
if (zot(obj) || !obj.getBounds || !obj.getBounds()) {zogy("zim methods - expand(): please provide object with bounds set"); return obj;}
|
|
59623
59682
|
if (zot(padding)) padding = 20;
|
|
@@ -64885,6 +64944,7 @@ note: the item is not the event object target - as that is the tile
|
|
|
64885
64944
|
if (zot(backdropPaddingH)) backdropPaddingH = DS.backdropPaddingH!=null?DS.backdropPaddingH:!zot(backdropColor)?backdropPadding:0;
|
|
64886
64945
|
if (zot(backdropPaddingV)) backdropPaddingV = DS.backdropPaddingV!=null?DS.backdropPaddingV:!zot(backdropColor)?backdropPadding:0;
|
|
64887
64946
|
if (backdropPaddingV || backdropPaddingH) backdropPadding = true; // numbers only used from H and V values
|
|
64947
|
+
if (zot(exact)) exact = DS.exact!=null?DS.exact:null;
|
|
64888
64948
|
if (zot(mat)) mat = DS.mat!=null?DS.mat:false;
|
|
64889
64949
|
|
|
64890
64950
|
var that = this;
|
|
@@ -78369,6 +78429,7 @@ dispatches a "pause" event when the Dynamo is paused - could be delayed
|
|
|
78369
78429
|
var frames = this.frames = sprite.parseFrames(label, startFrame, endFrame, true); // last true is fromDynamo
|
|
78370
78430
|
if (frames.length == 0) return;
|
|
78371
78431
|
this.totalFrames = frames.length;
|
|
78432
|
+
if (startFrame==null) sprite.frame = 0;
|
|
78372
78433
|
var _frame = 0; // frame for getter and setter methods
|
|
78373
78434
|
if (zot(speed)) speed = DS.speed!=null?DS.speed:30;
|
|
78374
78435
|
if (zot(reversible)) reversible = DS.reversible!=null?DS.reversible:true;
|
|
@@ -81066,7 +81127,7 @@ borderWidth - |ZIM VEE| (default depends on penType) the thickness of a line dow
|
|
|
81066
81127
|
end - (default "butt") the cap type as a String "butt", "square", "round" - from CreateJS
|
|
81067
81128
|
paper - (default null) a ZIM Container to hold the drawing - or Pen will make a Container to use
|
|
81068
81129
|
see also the paper property to change containers - for layers in a drawing for instance
|
|
81069
|
-
nib - (default null) an optional DisplayObject that will be used as the pen - would suggest
|
|
81130
|
+
nib - (default null) an optional DisplayObject that will be used as the pen - would suggest reg(CENTER) for this
|
|
81070
81131
|
cache - (default true) caches drawing in a Bitmap (improves performance) - set to false to not cache - the paper property points to the Bitmap or the Shape depending
|
|
81071
81132
|
ctrlKey - (default true) turns off drawing when CTRL key is being pressed. Set to false to not turn off drawing when the CTRL key is pressed
|
|
81072
81133
|
cropScale - (default 1) number times stage dimensions image will be cropped
|
|
@@ -89280,7 +89341,7 @@ END EXAMPLE
|
|
|
89280
89341
|
zim[zim.colors[z_i]] = zim.colorsHex[z_i];
|
|
89281
89342
|
}
|
|
89282
89343
|
// zim.red = "#fb4758"; // red dedicated to Alexa
|
|
89283
|
-
// zim.salmon = "#
|
|
89344
|
+
// zim.salmon = "#fa8072";
|
|
89284
89345
|
// zim.orange = "#f58e25";
|
|
89285
89346
|
// zim.yellow = "#ebcb35";
|
|
89286
89347
|
// zim.green = "#acd241";
|
|
@@ -90286,9 +90347,9 @@ function zimify(obj, a, b, c, d, list) {
|
|
|
90286
90347
|
noMovement:function() {
|
|
90287
90348
|
return zim.noMovement(this);
|
|
90288
90349
|
},
|
|
90289
|
-
tap:function(call, distance, time, once, dbl, dblTime, call2, call3, call4, cursor) {
|
|
90350
|
+
tap:function(call, distance, time, once, dbl, dblTime, call2, call3, call4, cursor, mobileUp) {
|
|
90290
90351
|
if (isDUO(arguments)) {arguments[0].obj = this; return zim.tap(arguments[0]);}
|
|
90291
|
-
else {return zim.tap(this, call, distance, time, once, dbl, dblTime, call2, call3, call4, cursor);}
|
|
90352
|
+
else {return zim.tap(this, call, distance, time, once, dbl, dblTime, call2, call3, call4, cursor, mobileUp);}
|
|
90292
90353
|
},
|
|
90293
90354
|
noTap:function() {
|
|
90294
90355
|
return zim.noTap(this);
|
|
@@ -95751,4 +95812,4 @@ export let Ticker = zim.Ticker;
|
|
|
95751
95812
|
export let Style = zim.Style;
|
|
95752
95813
|
export let assets = zim.assets;
|
|
95753
95814
|
export let assetIDs = zim.assetIDs;
|
|
95754
|
-
export let ZIMON = zim.ZIMON;
|
|
95815
|
+
export let ZIMON = zim.ZIMON;
|
|
@@ -3202,8 +3202,8 @@ declare namespace zim {
|
|
|
3202
3202
|
constructor()
|
|
3203
3203
|
}
|
|
3204
3204
|
export class Layout extends createjs.EventDispatcher {
|
|
3205
|
-
constructor(config_or_holder: Stage | Container, regions: {}[], lastMargin?: number | string, lastMarginMin?: number, backgroundColor?: color, vertical?: boolean,
|
|
3206
|
-
constructor(config: { holder: Stage | Container, regions: {}[], lastMargin?: number | string, lastMarginMin?: number, backgroundColor?: color, vertical?: boolean,
|
|
3205
|
+
constructor(config_or_holder: Stage | Container, regions: {}[], lastMargin?: number | string, lastMarginMin?: number, backgroundColor?: color, vertical?: boolean, showRegions?: boolean, scalingObject?: Stage | Container, hideKey?: string, style?: boolean, group?: string, inherit?: {})
|
|
3206
|
+
constructor(config: { holder: Stage | Container, regions: {}[], lastMargin?: number | string, lastMarginMin?: number, backgroundColor?: color, vertical?: boolean, showRegions?: boolean, scalingObject?: Stage | Container, hideKey?: string, style?: boolean, group?: string, inherit?: {} })
|
|
3207
3207
|
resize(): void
|
|
3208
3208
|
dispose(): boolean
|
|
3209
3209
|
addShape(shape: Shape): void
|