zimjs 17.0.3 → 17.1.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 +615 -252
- package/ts-src/typings/zim/index.d.ts +5 -5
package/src/zim.js
CHANGED
|
@@ -9457,7 +9457,7 @@ normalize(prop, from, from2, min, max, factor, clamp) - sets a ratio property (1
|
|
|
9457
9457
|
setting normalize("reg", CENTER) will do both horizontal and vertical to the container dimensions.
|
|
9458
9458
|
If this is not desired, use container.loop(item=>{item.reg(item._orX, item._orY, true)});
|
|
9459
9459
|
to set the registration point back but still keep the ratio property
|
|
9460
|
-
USAGE: the ratio property can be used by animate() with
|
|
9460
|
+
USAGE: the ratio property can be used by animate() with sequenceRatio to set the rate of an animation based on ratio
|
|
9461
9461
|
Or the ratio property can be used directly - for instance, to set a scale based on a distance from somewhere
|
|
9462
9462
|
Or as another example, set the alpha based on the rotation of a shape in the container
|
|
9463
9463
|
specialColor(colorCommand, colorObject) - used internally by ZIM Shapes
|
|
@@ -9487,8 +9487,8 @@ height - gets or sets the height. Setting the height will scale the width to kee
|
|
|
9487
9487
|
widthOnly - gets or sets the width. This sets only the width and may change the aspect ratio of the object
|
|
9488
9488
|
heightOnly - gets or sets the height. This sets only the height and may change the aspect ratio of the object
|
|
9489
9489
|
ratio - get a ratio set by the Container normalize method() - or Tile itemRegX, itemRegY parameters
|
|
9490
|
-
|
|
9491
|
-
|
|
9490
|
+
this will probably be a value from 1 to 0 as to how close the property is the end specified in the from parameter of normalize()
|
|
9491
|
+
a value of 1 is the closest and a value of 0 is the farthest - see the normalize() method for details
|
|
9492
9492
|
normalized - get if the container has been normalized - see normalized parameter
|
|
9493
9493
|
draggable - set to true for a default drag() and false for a noDrag()
|
|
9494
9494
|
level - gets or sets the level of the object in its parent container (or the stage) - a property for parent.getChildIndex() and parent.setChildIndex()
|
|
@@ -10958,7 +10958,7 @@ group - (default null) set to String (or comma delimited String) so STYLE can se
|
|
|
10958
10958
|
inherit - (default null) used internally but can receive an {} of styles directly
|
|
10959
10959
|
|
|
10960
10960
|
METHODS
|
|
10961
|
-
run(time, label, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startFrame, endFrame, tweek, id, globalControl)
|
|
10961
|
+
run(time, label, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startFrame, endFrame, frame, tweek, id, globalControl)
|
|
10962
10962
|
The run() method animates the Sprite over an amount of time
|
|
10963
10963
|
Would recommend this method over the CreateJS play() and gotoAndPlay()
|
|
10964
10964
|
methods because the framerate for these get overwritten by other S.update() calls
|
|
@@ -10998,6 +10998,8 @@ run(time, label, call, params, wait, waitedCall, waitedParams, loop, loopCount,
|
|
|
10998
10998
|
note - this goes backwards - so "bounceOut" would happen at the end of the rewind
|
|
10999
10999
|
startFrame - (default null - or 0) the frame to start on - will be overridden by a label with frames
|
|
11000
11000
|
endFrame - (default null - or totalFrames) the frame to end on - will be overridden by a label with frames
|
|
11001
|
+
frame - (default null) set the single frame to run - will override startFrame and endFrame
|
|
11002
|
+
this is good for a TextureAtlas where you show one frame of the sprite as a picture
|
|
11001
11003
|
tweek - (default 1) a factor for extra time on rewind and loops if needed
|
|
11002
11004
|
id - (default randomly assigned) an id you can use in other animations - available as sprite.id
|
|
11003
11005
|
use this id in other animations for pauseRun and stopRun to act on these as well
|
|
@@ -11281,8 +11283,8 @@ animationend, change, added, click, dblclick, mousedown, mouseout, mouseover, pr
|
|
|
11281
11283
|
return framesNormalized;
|
|
11282
11284
|
};
|
|
11283
11285
|
|
|
11284
|
-
this.run = function(time, label, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startFrame, endFrame, tweek, id, globalControl, pauseOnBlur) {
|
|
11285
|
-
var sig = "time, label, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startFrame, endFrame, tweek, id, globalControl, pauseOnBlur";
|
|
11286
|
+
this.run = function(time, label, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startFrame, endFrame, frame, tweek, id, globalControl, pauseOnBlur) {
|
|
11287
|
+
var sig = "time, label, call, params, wait, waitedCall, waitedParams, loop, loopCount, loopWait, loopCall, loopParams, loopWaitCall, loopWaitParams, loopPick, rewind, rewindWait, rewindCall, rewindParams, rewindWaitCall, rewindWaitParams, rewindTime, rewindEase, startFrame, endFrame, frame, tweek, id, globalControl, pauseOnBlur";
|
|
11286
11288
|
var duo; if (duo = zob(that.run, arguments, sig)) return duo;
|
|
11287
11289
|
|
|
11288
11290
|
var timeType = getTIME();
|
|
@@ -11291,6 +11293,7 @@ animationend, change, added, click, dblclick, mousedown, mouseout, mouseover, pr
|
|
|
11291
11293
|
if (zot(tweek)) tweek = 1;
|
|
11292
11294
|
if (!zot(id)) that.id = id;
|
|
11293
11295
|
if (!zot(globalControl)) that.globalControl = globalControl;
|
|
11296
|
+
if (!zot(frame)) startFrame = endFrame = frame;
|
|
11294
11297
|
|
|
11295
11298
|
var extraTime;
|
|
11296
11299
|
if (Array.isArray(label)) {
|
|
@@ -14317,15 +14320,15 @@ dashed - (default false) set to true for dashed border (if borderWidth or border
|
|
|
14317
14320
|
percent - (default 100) set to a percentage of a circle (arc) - registration stays at radius center, bounds shrink to arc
|
|
14318
14321
|
percentClose - (default true) set to false to not close the border of a circle with percent set
|
|
14319
14322
|
percentArc - (default false) set to a percent to make moon shapes - must have percent turned on
|
|
14320
|
-
|
|
14321
|
-
|
|
14322
|
-
|
|
14323
|
-
|
|
14324
|
-
|
|
14325
|
-
|
|
14326
|
-
|
|
14327
|
-
|
|
14328
|
-
|
|
14323
|
+
the value is the distance the arc-making circle is placed from the original circle's edge
|
|
14324
|
+
this distance is given as a percentage of the original circle's radius
|
|
14325
|
+
so if percentArc is set to 0 then the arc-making circle is at the radius (the edge) of the original circle
|
|
14326
|
+
if the percentArc is set to 50 then the arc-making circle is half the radius outside the original radius and the arc is less
|
|
14327
|
+
if the percentArc is set to -50 then the arc-making circle is half the radius inside the original radius and the arc is more
|
|
14328
|
+
Note, due to canvas winding, the arc will not do very thin cresents as expected
|
|
14329
|
+
instead once the inner arc is as wide as the outer arc, it makes a straight line
|
|
14330
|
+
for thin crecents, overlap the circle with a circle that matches the background color
|
|
14331
|
+
or if the background is an image, etc. then mask a clone of the background with the arc circle
|
|
14329
14332
|
strokeObj - (default {caps:"butt", joints:"miter", miterLimit:10, ignoreScale:false}) set to adjust stroke properties
|
|
14330
14333
|
// note, not all applicable to a Circle - perhaps just ignoreScale...
|
|
14331
14334
|
caps options: "butt", "round", "square" or 0,1,2
|
|
@@ -14474,8 +14477,18 @@ zim.Circle = function(radius, color, borderColor, borderWidth, dashed, percent,
|
|
|
14474
14477
|
var dY = Math.cos(p*Math.PI/180)*that._radius;
|
|
14475
14478
|
if (!zot(percentArc)) {
|
|
14476
14479
|
var r2 = Math.sqrt(Math.pow(dX,2) + Math.pow((that._radius+dY)+percentArc/100*that._radius,2));
|
|
14477
|
-
|
|
14478
|
-
|
|
14480
|
+
if (percentArc >= 0) {
|
|
14481
|
+
var a1 = Math.asin(dX/r2);
|
|
14482
|
+
var y2 = that._radius+percentArc/100*that._radius;
|
|
14483
|
+
var a2 = -90*zim.RAD+a1;
|
|
14484
|
+
var a3 = -90*zim.RAD-a1;
|
|
14485
|
+
g.arc(0, y2, r2, a2, a3, true);
|
|
14486
|
+
} else {
|
|
14487
|
+
// var y3 = dY - Math.sqrt(Math.pow(r2, 2) - Math.pow(dX, 2));
|
|
14488
|
+
// var a2 = Math.acos(dX/r2);
|
|
14489
|
+
// var a3 = 180*RAD - a2;
|
|
14490
|
+
// g.arc(0, y3, r2, a2, a3, false);
|
|
14491
|
+
}
|
|
14479
14492
|
}
|
|
14480
14493
|
if (percentClose) g.cp();
|
|
14481
14494
|
h = that._radius-dY;
|
|
@@ -20764,7 +20777,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
20764
20777
|
if (color.type) that.color = color;
|
|
20765
20778
|
function drawShape(lengths, angles, anglesA, anglesB, anglesEnd, cross, crossColors, close) {
|
|
20766
20779
|
that.removeAllChildren();
|
|
20767
|
-
|
|
20780
|
+
|
|
20768
20781
|
var s = that.shape = new zim.Shape().addTo(that);
|
|
20769
20782
|
that.colorCommand = s.c().f(color).command;
|
|
20770
20783
|
if (color && color.type) that.specialColor(that.colorCommand, color, that);
|
|
@@ -28341,7 +28354,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
28341
28354
|
stage = that.stage;
|
|
28342
28355
|
content.loop(function(item) {
|
|
28343
28356
|
// ADJUSTED ZIM 016 - look into how we can optimize a wrapper and keep scrollbars the right size
|
|
28344
|
-
if (!item.hitTestBounds || !item.stage || item.type == "Wrapper") return; // don't turn off items if not on stage yet
|
|
28357
|
+
if (!item.hitTestBounds || !item.stage || item.type == "Wrapper" || item.type == "List") return; // don't turn off items if not on stage yet
|
|
28345
28358
|
if (item.hitTestBounds(that,300)) {
|
|
28346
28359
|
item.visible = true;
|
|
28347
28360
|
if (item.loop) item.loop(function(item2) {
|
|
@@ -28376,6 +28389,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
28376
28389
|
setTimeout(function(){
|
|
28377
28390
|
if (content) {
|
|
28378
28391
|
zim.drag({
|
|
28392
|
+
singleTouch:true,
|
|
28379
28393
|
obj:content,
|
|
28380
28394
|
currentTarget:true,
|
|
28381
28395
|
axis:continuous,
|
|
@@ -30315,9 +30329,9 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
30315
30329
|
for (var i=0; i<num; i++) {
|
|
30316
30330
|
light = new Container(size,size).reg("center","center");
|
|
30317
30331
|
|
|
30318
|
-
//
|
|
30319
|
-
if (indicatorType == "dot") {
|
|
30320
|
-
light.dim = new zim.Circle(size/2, backgroundColor, borderColor, borderWidth, null, null, null, null, null, false);
|
|
30332
|
+
// dim
|
|
30333
|
+
if (indicatorType == "dot" || indicatorType == "circle") {
|
|
30334
|
+
light.dim = new zim.Circle(size/2, backgroundColor, borderColor, borderWidth, null, null, null, null, null, false);
|
|
30321
30335
|
} else if (indicatorType == "square" || indicatorType == "box") {
|
|
30322
30336
|
light.dim = new zim.Rectangle(size, size, backgroundColor, borderColor, borderWidth, null, null, null, null, false);
|
|
30323
30337
|
light.dim.regX = light.dim.width/2;
|
|
@@ -30340,7 +30354,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
30340
30354
|
this.lights.push(light);
|
|
30341
30355
|
|
|
30342
30356
|
// brights
|
|
30343
|
-
if (selectedIndicatorType == "dot") {
|
|
30357
|
+
if (selectedIndicatorType == "dot" || indicatorType == "circle") {
|
|
30344
30358
|
light.bright = new zim.Circle(size/2, foregroundColor, borderColor, borderWidth, null, null, null, null, null, false);
|
|
30345
30359
|
} else if (selectedIndicatorType == "square" || selectedIndicatorType == "box") {
|
|
30346
30360
|
light.bright = new zim.Rectangle(size, size, foregroundColor, borderColor, borderWidth, null, null, null, null, false);
|
|
@@ -30514,7 +30528,7 @@ text - |ZIM VEE| String for the the text of the label
|
|
|
30514
30528
|
size - (default 36) the size of the font in pixels
|
|
30515
30529
|
font - (default arial) the font or list of fonts for the text
|
|
30516
30530
|
color - |ZIM VEE| (default dark) color of font
|
|
30517
|
-
backgroundColor - |ZIM VEE| (default lighter) background color - set to
|
|
30531
|
+
backgroundColor - |ZIM VEE| (default lighter) background color - set to clear for no background
|
|
30518
30532
|
borderColor - |ZIM VEE| (default null) the background stroke color
|
|
30519
30533
|
borderWidth - (default null) thickness of the background border
|
|
30520
30534
|
maxLength - (default null) set to limit the number of characters in the field
|
|
@@ -31383,7 +31397,7 @@ zim.extend(zim.TextInput.LabelInput, zim.Label, "dispose", "zimLabel", false);
|
|
|
31383
31397
|
|
|
31384
31398
|
|
|
31385
31399
|
/*--
|
|
31386
|
-
zim.List = function(width, height, list, viewNum, vertical, currentSelected, align, valign, labelAlign, labelValign, labelIndent, labelIndentH, labelIndentV, indent, spacing, backgroundColor, rollBackgroundColor, downBackgroundColor, selectedBackgroundColor, selectedRollBackgroundColor, backdropColor, color, rollColor, downColor, selectedColor, selectedRollColor, borderColor, borderWidth, padding, corner, swipe, scrollBarActive, scrollBarDrag, scrollBarColor, scrollBarAlpha, scrollBarFade, scrollBarH, scrollBarV, scrollBarOverlay, slide, slideFactor, slideSnap, slideSnapDamp, shadowColor, shadowBlur, paddingH, paddingV, scrollWheel, damp, titleBar, titleBarColor, titleBarBackgroundColor, titleBarHeight, draggable, boundary, onTop, close, closeColor, collapse, collapseColor, collapsed, excludeCustomTap, organizer, checkBox, pulldown, clone, cancelCurrentDrag, index, noScale, pulldownToggle, optimize, keyEnabled, resizeHandle, resizeBoundary, resizeVisible, continuous, closeOthers, drop, dropTargets, dropColor, dropThickness, dropScrollSpeed, dropReticleAlpha, selectedIndex, style, group, inherit)
|
|
31400
|
+
zim.List = function(width, height, list, viewNum, vertical, currentSelected, align, valign, labelAlign, labelValign, labelIndent, labelIndentH, labelIndentV, indent, spacing, backgroundColor, rollBackgroundColor, downBackgroundColor, selectedBackgroundColor, selectedRollBackgroundColor, backdropColor, color, rollColor, downColor, selectedColor, selectedRollColor, borderColor, borderWidth, padding, corner, swipe, scrollBarActive, scrollBarDrag, scrollBarColor, scrollBarAlpha, scrollBarFade, scrollBarH, scrollBarV, scrollBarOverlay, slide, slideFactor, slideSnap, slideSnapDamp, shadowColor, shadowBlur, paddingH, paddingV, scrollWheel, damp, titleBar, titleBarColor, titleBarBackgroundColor, titleBarHeight, draggable, boundary, onTop, close, closeColor, collapse, collapseColor, collapsed, excludeCustomTap, organizer, checkBox, pulldown, clone, cancelCurrentDrag, index, noScale, pulldownToggle, optimize, keyEnabled, resizeHandle, resizeBoundary, resizeVisible, continuous, closeOthers, drop, dropTargets, dropSelf, dropCopy, dropColor, dropThickness, dropScrollSpeed, dropReticleAlpha, dropHitTest, dropFull, dropSnap, dropEnd, dropScale, dropWidth, dropHeight, selectedIndex, style, group, inherit)
|
|
31387
31401
|
|
|
31388
31402
|
List
|
|
31389
31403
|
zim class - extends a zim.Window which extends a zim.Container which extends a createjs.Container
|
|
@@ -31428,6 +31442,12 @@ Indent only works with custom items in the list in left, right alignment or top,
|
|
|
31428
31442
|
This moves the items away from their alignment
|
|
31429
31443
|
There is also label indenting for items with labels - and labelIndentV and labelIndentH
|
|
31430
31444
|
|
|
31445
|
+
DROP
|
|
31446
|
+
As if ZIM 017, drop parameters and properties have been added.
|
|
31447
|
+
These allow List items to be dragged and dropped within the same list or to other lists or to other objects.
|
|
31448
|
+
Objects not in lists can also be dragged into a list - see the drag() method's drop parameters.
|
|
31449
|
+
See https://zimjs.com/017/dropping.html
|
|
31450
|
+
|
|
31431
31451
|
NOTE: List can have a ZIM Organizer added with the organizer parameter
|
|
31432
31452
|
The organizer lets the user add, remove and move items up, down, to the top or the bottom
|
|
31433
31453
|
See: https://zimjs.com/docs.html?item=organizer
|
|
@@ -31452,7 +31472,6 @@ const list = new List({
|
|
|
31452
31472
|
list:["Enormous", "Big", "Medium", "Small", "Puny"],
|
|
31453
31473
|
viewNum:3, // this number will change the size of the list elements (default is 5)
|
|
31454
31474
|
}).center()
|
|
31455
|
-
S.update();
|
|
31456
31475
|
END EXAMPLE
|
|
31457
31476
|
|
|
31458
31477
|
EXAMPLE
|
|
@@ -31460,6 +31479,7 @@ EXAMPLE
|
|
|
31460
31479
|
// drop is set to true in the STYLE - this means the list can drop its items onto itself
|
|
31461
31480
|
// dropTargets is set after the lists are made - to be able to drop onto other lists
|
|
31462
31481
|
// these two things are separate - items can be dropped onto other lists but not their own, etc.
|
|
31482
|
+
// also see https://zimjs.com/017/dropping.html for dropping to and from outside a list
|
|
31463
31483
|
|
|
31464
31484
|
const w = 60;
|
|
31465
31485
|
const h = 60;
|
|
@@ -31670,10 +31690,10 @@ titleBarHeight - (default fit label) the height of the titleBar if a titleBar is
|
|
|
31670
31690
|
draggable - (default true if titleBar) set to false to not allow dragging titleBar to drag list
|
|
31671
31691
|
boundary - (default null) set to ZIM Boundary() object - or CreateJS.rectangle()
|
|
31672
31692
|
onTop - (default true) set to false to not bring list to top of container when dragging
|
|
31673
|
-
close - (default false)
|
|
31674
|
-
closeColor - (default grey)
|
|
31675
|
-
collapse - (default false)
|
|
31676
|
-
collapseColor - (default grey)
|
|
31693
|
+
close - (default false) a close X for the top right corner that closes the list when pressed
|
|
31694
|
+
closeColor - (default grey) the color of the close X if close is requested
|
|
31695
|
+
collapse - (default false) set to true to add a collapse button to the titleBar that reduces the list so only the bar shows and adds a button to expand
|
|
31696
|
+
collapseColor - (default grey) the color of the collapse icon
|
|
31677
31697
|
collapsed - (default false) set to true to start the list collapsed
|
|
31678
31698
|
excludeCustomTap - (default false) set to true to exclude custom buttons from tap() which would override existing tap() on the custom buttons
|
|
31679
31699
|
organizer - (default null) the ZIM Organizer for the list
|
|
@@ -31687,15 +31707,15 @@ pulldown - (default false) set to true to have List act like a Pulldown
|
|
|
31687
31707
|
use tapClose and offClose parameters to optionally adjust behaviour
|
|
31688
31708
|
See: https://zimjs.com/ten/pulldown.html
|
|
31689
31709
|
clone - (default false) set to true to add clones of the list items rather than the items themselves
|
|
31690
|
-
cancelCurrentDrag - (default false)
|
|
31710
|
+
cancelCurrentDrag - (default false) set to true to cancel window dragging when document window loses focus
|
|
31691
31711
|
this functionality seems to work except if ZIM is being used with Animate - so we have left it turned off by default
|
|
31692
|
-
index - (default 0)
|
|
31693
|
-
noScale - (default false)
|
|
31694
|
-
pulldownToggle - (default false)
|
|
31712
|
+
index - (default 0) set the index at start - set to -1 for no selection
|
|
31713
|
+
noScale - (default false) set to true to not scale custom items - this ignores viewNum
|
|
31714
|
+
pulldownToggle - (default false) set to true to collapse list in pulldown mode when final item is selected or pressing off list
|
|
31695
31715
|
optimize - (default true) set to false to not turn DisplayObjects that are not on the stage visible false
|
|
31696
31716
|
as the Window is scrolled, any objects within the content and any objects within one level of those objects
|
|
31697
31717
|
are set to visible false if their bounds are not hitting the stage bounds
|
|
31698
|
-
resizeHandle - (default false)
|
|
31718
|
+
resizeHandle - (default false) set to true to rollover bottom right corner to resize list with resizeHandle
|
|
31699
31719
|
currently, the List content does not automatically expand
|
|
31700
31720
|
so create the list with a width as wide as it will go
|
|
31701
31721
|
then call the resize() method to start the list at the desired width
|
|
@@ -31707,24 +31727,38 @@ resizeBoundary - (default null) add a ZIM Boundary() object for the resize handl
|
|
|
31707
31727
|
resizeVisible - (default false) set to true to always see the resizeHandle - if resizeHandle is set to true
|
|
31708
31728
|
continuous - (default false) set to true to make the list scroll continuously - should have more elements than the viewNum for this
|
|
31709
31729
|
closeOthers - (default false) set to true to close any open branches before expanding selected branch
|
|
31710
|
-
drop - (default false)
|
|
31730
|
+
drop - (default false) set to true to allow drag and drop of items onto the current list
|
|
31711
31731
|
if the list is vertical, dragging the item horizontally will pull it from the list
|
|
31712
31732
|
the item can then be dragged to a different location and dropped in place
|
|
31713
31733
|
for a horizontal list, dragging the item vertical will pull it from the list
|
|
31714
31734
|
also see the dropTargets parameter and the drop and dropTarget properties
|
|
31715
31735
|
note: the dropTargets alone can be set to drop onto other lists but not the current list
|
|
31716
31736
|
also see updateDrop() method if a list has been moved or scaled
|
|
31717
|
-
dropTargets - (default null)
|
|
31737
|
+
dropTargets - (default null) add a list or an array of lists to drop an item from the current list
|
|
31718
31738
|
see the drop parameter and the drop and dropTargets properties
|
|
31719
31739
|
note: dropTargets can be set without setting the drop parameter to true
|
|
31720
31740
|
and then items can be dragged to the target lists but not onto the current list
|
|
31721
31741
|
also see updateDrop() method if a list has been moved or scaled
|
|
31722
|
-
|
|
31723
|
-
|
|
31724
|
-
|
|
31742
|
+
dropSelf - (default true) set to false to not drop on itself if drop is true
|
|
31743
|
+
dropCopy - (default false) set to true to drop a copy
|
|
31744
|
+
dropColor - (default white) the color of the diamond reticle that indicates where an item will be dropped
|
|
31745
|
+
dropThickness - (default 1) the thickness of the diamond reticle that indicates where an item will be dropped
|
|
31746
|
+
dropScrollSpeed - (default 5) the speed the list is scrolled as a drop item is dragged up to 50px off an end of the list
|
|
31725
31747
|
this is only applied if the list scrolls on that end
|
|
31726
31748
|
the speed is multiplied by 1.5 when the item is between 50px and 80px off the end
|
|
31727
|
-
dropReticleAlpha - (default 1)
|
|
31749
|
+
dropReticleAlpha - (default 1) set the alpha of the drop reticle diamond - set to 0 to not show reticle
|
|
31750
|
+
dropScale - (default null) set a scale when dropped
|
|
31751
|
+
dropWidth - (default null) set a width when dropped - overrides scale
|
|
31752
|
+
height will keep proportion unless both dropWidth and dropHeight are provided
|
|
31753
|
+
dropHeight - (default null) set a height when dropped - overrides scale
|
|
31754
|
+
width will keep proportion unless both dropWidth and dropHeight are provided
|
|
31755
|
+
*** Drop parameters that work only when dropping on a dropTarget that is NOT a List
|
|
31756
|
+
dropHitTest - (default "bounds") can also be "reg", "circles", "circle", "rect" - see ZIM HitTests
|
|
31757
|
+
dropFull - (default true) do not drop on a full target
|
|
31758
|
+
note - if the object is removed from the target then a drop can occur again on that target
|
|
31759
|
+
dropSnap - (default true) snap to the target object
|
|
31760
|
+
dropEnd - (default true) once dropped on a target a noMouse() is set on the object
|
|
31761
|
+
*** End drop parameters that work only when dropping on a target that is NOT a List
|
|
31728
31762
|
selectedIndex - same as index, kept in for backwards compatibility in ZIM DUO
|
|
31729
31763
|
style - (default true) set to false to ignore styles set with the STYLE - will receive original parameter defaults
|
|
31730
31764
|
group - (default null) set to String (or comma delimited String) so STYLE can set default styles to the group(s) (like a CSS class)
|
|
@@ -31859,10 +31893,16 @@ dropReticle - each list that can be dropped on gets a dropReticle property that
|
|
|
31859
31893
|
so individual reticles can be adjusted - say different colors for different lists
|
|
31860
31894
|
dropItem - after a dropdown event, the dropItem is the ghost being dragged
|
|
31861
31895
|
dropIndex - after a dropdown event, the dropIndex is the original index of the item being dragged
|
|
31862
|
-
|
|
31896
|
+
dropTarget - after a dropup event, the dropTarget is the object the item was dropped into (could be original list)
|
|
31863
31897
|
dropNewIndex - after a dropup event, the dropNewIndex is the index in the list the item has been dropped
|
|
31864
31898
|
enabled - default is true - set to false to disable
|
|
31865
31899
|
|
|
31900
|
+
DROP ITEM PROPERTIES
|
|
31901
|
+
dropTarget - is the target dropped on
|
|
31902
|
+
dropList - is list item came from
|
|
31903
|
+
|
|
31904
|
+
// dropEnd should not be false if dropBack is true - when dropping from a list
|
|
31905
|
+
|
|
31866
31906
|
ALSO: see all Window properties - like titleBar, titleBarLabel, resizeHandle, etc.
|
|
31867
31907
|
|
|
31868
31908
|
ALSO: see ZIM Container for properties such as:
|
|
@@ -31881,17 +31921,18 @@ dispatches an "expanded" event when items have been expanded
|
|
|
31881
31921
|
this receives an event object with an items property of the items just opened
|
|
31882
31922
|
dispatches a "collapsed" event when items have been collapsed
|
|
31883
31923
|
dispatches a "dropdown" event when drop item is pulled from list
|
|
31884
|
-
list will have dropItem and dropIndex properties
|
|
31924
|
+
list will have dropItem and dropIndex properties
|
|
31885
31925
|
dispatches a "dropup" event when drop item is dropped
|
|
31886
|
-
list will have dropItem,
|
|
31926
|
+
list will have dropItem, dropTarget and dropNewIndex properties
|
|
31927
|
+
item dropped will have dropList for which list it came from and dropTarget for which object it is dropped on
|
|
31887
31928
|
|
|
31888
31929
|
ALSO: All Window events including "scrolling"
|
|
31889
31930
|
|
|
31890
31931
|
ALSO: see the CreateJS Easel Docs for Container events such as:
|
|
31891
31932
|
added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmove, pressup, removed, rollout, rollover
|
|
31892
31933
|
--*///+60.5
|
|
31893
|
-
zim.List = function(width, height, list, viewNum, vertical, currentSelected, align, valign, labelAlign, labelValign, labelIndent, labelIndentH, labelIndentV, indent, spacing, backgroundColor, rollBackgroundColor, downBackgroundColor, selectedBackgroundColor, selectedRollBackgroundColor, backdropColor, color, rollColor, downColor, selectedColor, selectedRollColor, borderColor, borderWidth, padding, corner, swipe, scrollBarActive, scrollBarDrag, scrollBarColor, scrollBarAlpha, scrollBarFade, scrollBarH, scrollBarV, scrollBarOverlay, slide, slideFactor, slideSnap, slideSnapDamp, shadowColor, shadowBlur, paddingH, paddingV, scrollWheel, damp, titleBar, titleBarColor, titleBarBackgroundColor, titleBarHeight, draggable, boundary, onTop, close, closeColor, collapse, collapseColor, collapsed, excludeCustomTap, organizer, checkBox, pulldown, clone, cancelCurrentDrag, index, noScale, pulldownToggle, optimize, keyEnabled, resizeHandle, resizeBoundary, resizeVisible, continuous, closeOthers, drop, dropTargets, dropColor, dropThickness, dropScrollSpeed, dropReticleAlpha, selectedIndex, style, group, inherit) {
|
|
31894
|
-
var sig = "width, height, list, viewNum, vertical, currentSelected, align, valign, labelAlign, labelValign, labelIndent, labelIndentH, labelIndentV, indent, spacing, backgroundColor, rollBackgroundColor, downBackgroundColor, selectedBackgroundColor, selectedRollBackgroundColor, backdropColor, color, rollColor, downColor, selectedColor, selectedRollColor, borderColor, borderWidth, padding, corner, swipe, scrollBarActive, scrollBarDrag, scrollBarColor, scrollBarAlpha, scrollBarFade, scrollBarH, scrollBarV, scrollBarOverlay, slide, slideFactor, slideSnap, slideSnapDamp, shadowColor, shadowBlur, paddingH, paddingV, scrollWheel, damp, titleBar, titleBarColor, titleBarBackgroundColor, titleBarHeight, draggable, boundary, onTop, close, closeColor, collapse, collapseColor, collapsed, excludeCustomTap, organizer, checkBox, pulldown, clone, cancelCurrentDrag, index, noScale, pulldownToggle, optimize, keyEnabled, resizeHandle, resizeBoundary, resizeVisible, continuous, closeOthers, drop, dropTargets, dropColor, dropThickness, dropScrollSpeed, dropReticleAlpha, selectedIndex, style, group, inherit";
|
|
31934
|
+
zim.List = function(width, height, list, viewNum, vertical, currentSelected, align, valign, labelAlign, labelValign, labelIndent, labelIndentH, labelIndentV, indent, spacing, backgroundColor, rollBackgroundColor, downBackgroundColor, selectedBackgroundColor, selectedRollBackgroundColor, backdropColor, color, rollColor, downColor, selectedColor, selectedRollColor, borderColor, borderWidth, padding, corner, swipe, scrollBarActive, scrollBarDrag, scrollBarColor, scrollBarAlpha, scrollBarFade, scrollBarH, scrollBarV, scrollBarOverlay, slide, slideFactor, slideSnap, slideSnapDamp, shadowColor, shadowBlur, paddingH, paddingV, scrollWheel, damp, titleBar, titleBarColor, titleBarBackgroundColor, titleBarHeight, draggable, boundary, onTop, close, closeColor, collapse, collapseColor, collapsed, excludeCustomTap, organizer, checkBox, pulldown, clone, cancelCurrentDrag, index, noScale, pulldownToggle, optimize, keyEnabled, resizeHandle, resizeBoundary, resizeVisible, continuous, closeOthers, drop, dropTargets, dropSelf, dropCopy, dropColor, dropThickness, dropScrollSpeed, dropReticleAlpha, dropHitTest, dropFull, dropSnap, dropEnd, dropScale, dropWidth, dropHeight, selectedIndex, style, group, inherit) {
|
|
31935
|
+
var sig = "width, height, list, viewNum, vertical, currentSelected, align, valign, labelAlign, labelValign, labelIndent, labelIndentH, labelIndentV, indent, spacing, backgroundColor, rollBackgroundColor, downBackgroundColor, selectedBackgroundColor, selectedRollBackgroundColor, backdropColor, color, rollColor, downColor, selectedColor, selectedRollColor, borderColor, borderWidth, padding, corner, swipe, scrollBarActive, scrollBarDrag, scrollBarColor, scrollBarAlpha, scrollBarFade, scrollBarH, scrollBarV, scrollBarOverlay, slide, slideFactor, slideSnap, slideSnapDamp, shadowColor, shadowBlur, paddingH, paddingV, scrollWheel, damp, titleBar, titleBarColor, titleBarBackgroundColor, titleBarHeight, draggable, boundary, onTop, close, closeColor, collapse, collapseColor, collapsed, excludeCustomTap, organizer, checkBox, pulldown, clone, cancelCurrentDrag, index, noScale, pulldownToggle, optimize, keyEnabled, resizeHandle, resizeBoundary, resizeVisible, continuous, closeOthers, drop, dropTargets, dropSelf, dropCopy, dropColor, dropThickness, dropScrollSpeed, dropReticleAlpha, dropHitTest, dropFull, dropSnap, dropEnd, dropScale, dropWidth, dropHeight, selectedIndex, style, group, inherit";
|
|
31895
31936
|
var duo; if (duo = zob(zim.List, arguments, sig, this)) return duo;
|
|
31896
31937
|
z_d("60.5");
|
|
31897
31938
|
|
|
@@ -31986,11 +32027,22 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
31986
32027
|
|
|
31987
32028
|
if (zot(drop)) drop = DS.drop!=null?DS.drop:false;
|
|
31988
32029
|
if (zot(dropTargets)) dropTargets = DS.dropTargets!=null?DS.dropTargets:null;
|
|
32030
|
+
if (zot(dropSelf)) dropSelf = DS.dropSelf!=null?DS.dropSelf:true;
|
|
32031
|
+
if (zot(dropCopy)) dropCopy = DS.dropCopy!=null?DS.dropCopy:false;
|
|
31989
32032
|
if (zot(dropColor)) dropColor = DS.dropColor!=null?DS.dropColor:zim.white;
|
|
31990
32033
|
if (zot(dropThickness)) dropThickness = DS.dropThickness!=null?DS.dropThickness:1;
|
|
31991
32034
|
if (zot(dropScrollSpeed)) dropScrollSpeed = DS.dropScrollSpeed!=null?DS.dropScrollSpeed:5;
|
|
31992
32035
|
if (zot(dropReticleAlpha)) dropReticleAlpha = DS.dropReticleAlpha!=null?DS.dropReticleAlpha:1;
|
|
31993
32036
|
|
|
32037
|
+
// Drop off list
|
|
32038
|
+
if (zot(dropHitTest)) dropHitTest = DS.dropHitTest!=null?DS.dropHitTest:"bounds";
|
|
32039
|
+
if (zot(dropSnap)) dropSnap = DS.dropSnap!=null?DS.dropSnap:true;
|
|
32040
|
+
if (zot(dropFull)) dropFull = DS.dropFull!=null?DS.dropFull:true;
|
|
32041
|
+
if (zot(dropEnd)) dropEnd = DS.dropEnd!=null?DS.dropEnd:true;
|
|
32042
|
+
if (zot(dropScale)) dropScale = DS.dropScale!=null?DS.dropScale:null;
|
|
32043
|
+
if (zot(dropWidth)) dropWidth = DS.dropWidth!=null?DS.dropWidth:null;
|
|
32044
|
+
if (zot(dropHeight)) dropHeight = DS.dropHeight!=null?DS.dropHeight:null;
|
|
32045
|
+
|
|
31994
32046
|
|
|
31995
32047
|
if (titleBar === false) titleBar = null;
|
|
31996
32048
|
this.vertical = vertical;
|
|
@@ -32667,7 +32719,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
32667
32719
|
// drop and dropTargets are assigned independently but both are added to dropTargets array
|
|
32668
32720
|
if (dropTargets && !Array.isArray(dropTargets)) dropTargets = [dropTargets];
|
|
32669
32721
|
if (!dropTargets) dropTargets = [];
|
|
32670
|
-
if (drop) dropTargets.unshift(that);
|
|
32722
|
+
if (drop && dropSelf) dropTargets.unshift(that);
|
|
32671
32723
|
|
|
32672
32724
|
that.added(function(stage) {
|
|
32673
32725
|
frame = stage.frame;
|
|
@@ -32680,12 +32732,13 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
32680
32732
|
});
|
|
32681
32733
|
|
|
32682
32734
|
that.dropDown = that.on("mousedown", function(e){
|
|
32735
|
+
// if (downItem) return;
|
|
32683
32736
|
// make sure is item in list
|
|
32684
|
-
downItem = checkItem = e.target;
|
|
32737
|
+
downItem = checkItem = e.target;
|
|
32685
32738
|
// e.target can be something in the item - or the item
|
|
32686
32739
|
// but custom List items are usually in a Container
|
|
32687
32740
|
// so want to drag the item which is the child of the container that is in the List items
|
|
32688
|
-
if (!that.items.includes(downItem)) {
|
|
32741
|
+
if (!that.items.includes(downItem)) {
|
|
32689
32742
|
var good = false;
|
|
32690
32743
|
var checkItem = downItem
|
|
32691
32744
|
while(checkItem.parent) {
|
|
@@ -32698,6 +32751,9 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
32698
32751
|
}
|
|
32699
32752
|
if (!good) return;
|
|
32700
32753
|
}
|
|
32754
|
+
// watch - the List item container has a backing rectangle that has a parent that is in the items
|
|
32755
|
+
// so get the parent but then get the content
|
|
32756
|
+
if (that.items.includes(downItem.parent)) downItem = downItem.parent.content;
|
|
32701
32757
|
downPoint = that.globalToLocal(frame.mouseX, frame.mouseY);
|
|
32702
32758
|
itemPoint = downItem.globalToLocal(frame.mouseX, frame.mouseY);
|
|
32703
32759
|
itemIndex = zot(checkItem.znum) ? checkItem.parent.znum : checkItem.znum;
|
|
@@ -32707,45 +32763,6 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
32707
32763
|
that.dropNewIndex = null;
|
|
32708
32764
|
});
|
|
32709
32765
|
|
|
32710
|
-
function scrollUp(target, dropScrollSpeed) {
|
|
32711
|
-
if (target.scrollInt) target.scrollInt.clear();
|
|
32712
|
-
target.scrollInt = zim.interval(.01, function() {
|
|
32713
|
-
if (target.dropReticle.parent) target.dropReticle.removeFrom();
|
|
32714
|
-
if (target.vertical) {
|
|
32715
|
-
target.scrollY += dropScrollSpeed;
|
|
32716
|
-
if (target.scrollY > 0) {
|
|
32717
|
-
target.scrollY = 0;
|
|
32718
|
-
target.scrollInt.clear();
|
|
32719
|
-
}
|
|
32720
|
-
} else {
|
|
32721
|
-
target.scrollX += dropScrollSpeed;
|
|
32722
|
-
if (target.scrollX > 0) {
|
|
32723
|
-
target.scrollX = 0;
|
|
32724
|
-
target.scrollInt.clear();
|
|
32725
|
-
}
|
|
32726
|
-
}
|
|
32727
|
-
}, null, null, null, "seconds");
|
|
32728
|
-
}
|
|
32729
|
-
|
|
32730
|
-
function scrollDown(target, dropScrollSpeed) {
|
|
32731
|
-
if (target.scrollInt) target.scrollInt.clear();
|
|
32732
|
-
target.scrollInt = zim.interval(.01, function() {
|
|
32733
|
-
if (target.dropReticle.parent) target.dropReticle.removeFrom();
|
|
32734
|
-
if (target.vertical) {
|
|
32735
|
-
target.scrollY -= dropScrollSpeed;
|
|
32736
|
-
if (target.scrollY < -target.scrollYMax) {
|
|
32737
|
-
target.scrollY = -target.scrollYMax;
|
|
32738
|
-
target.scrollInt.clear();
|
|
32739
|
-
}
|
|
32740
|
-
} else {
|
|
32741
|
-
target.scrollX -= dropScrollSpeed;
|
|
32742
|
-
if (target.scrollX < -target.scrollXMax) {
|
|
32743
|
-
target.scrollX = -target.scrollXMax;
|
|
32744
|
-
target.scrollInt.clear();
|
|
32745
|
-
}
|
|
32746
|
-
}
|
|
32747
|
-
}, null, null, null, "seconds");
|
|
32748
|
-
}
|
|
32749
32766
|
|
|
32750
32767
|
that.dropMove = that.on("pressmove", function() {
|
|
32751
32768
|
if (ghost || !downPoint) return;
|
|
@@ -32762,194 +32779,113 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
32762
32779
|
) {
|
|
32763
32780
|
that.cancelCurrentDrag();
|
|
32764
32781
|
var sc = downItem.getConcatenatedDisplayProps().matrix.decompose().scaleX/F.stage.scaleX; // sigh
|
|
32765
|
-
ghost = downItem.clone().reg(itemPoint.x, itemPoint.y).sca(sc).alp(.5); //.sha("rgba(0,0,0,.3)",5,5,5);
|
|
32782
|
+
ghost = downItem.clone(true).reg(itemPoint.x, itemPoint.y).sca(sc).alp(.5); //.sha("rgba(0,0,0,.3)",5,5,5);
|
|
32766
32783
|
that.dropItem = ghost;
|
|
32767
32784
|
that.dropIndex = itemIndex;
|
|
32768
32785
|
that.dropStage = frame.stage.on("stagemousemove", function(){
|
|
32769
|
-
ghost.loc(frame.mouseX, frame.mouseY)
|
|
32770
|
-
|
|
32786
|
+
ghost.loc(frame.mouseX, frame.mouseY);
|
|
32771
32787
|
// scroll if ghost is at edges of scrollable list
|
|
32772
|
-
|
|
32773
|
-
zim.loop(dropTargets, function(target) {
|
|
32774
|
-
if (target.type != "List") return;
|
|
32775
|
-
if (onCheck) {
|
|
32776
|
-
if (target.scrollInt) target.scrollInt.clear();
|
|
32777
|
-
target.dropReticle.removeFrom();
|
|
32778
|
-
target.dropReticleIndex = null;
|
|
32779
|
-
return; // next in loop
|
|
32780
|
-
}
|
|
32781
|
-
if (target.vertical) {
|
|
32782
|
-
if (ghost.x > target.zgb.x && ghost.x < target.zgb.x + target.zgb.width) {
|
|
32783
|
-
if (ghost.y < target.zgb.y) { // carefull - need to do these separately to turn off diamond
|
|
32784
|
-
if (ghost.y > target.zgbtarget.zgb.y - 50) scrollUp(target, dropScrollSpeed);
|
|
32785
|
-
else if (ghost.y > target.zgbtarget.zgb.y - 80) scrollUp(target, dropScrollSpeed*1.5);
|
|
32786
|
-
onCheck = true;
|
|
32787
|
-
} else if (ghost.y > target.zgbtarget.zgb.y + target.zgbtarget.zgb.height) {
|
|
32788
|
-
if (ghost.y < target.zgbtarget.zgb.y + target.zgbtarget.zgb.height + 50) scrollDown(target, dropScrollSpeed);
|
|
32789
|
-
else if (ghost.y < target.zgbtarget.zgb.y + target.zgbtarget.zgb.height + 80) scrollDown(target, dropScrollSpeed*1.5);
|
|
32790
|
-
onCheck = true;
|
|
32791
|
-
} else if (target.scrollInt) target.scrollInt.clear();
|
|
32792
|
-
} else {
|
|
32793
|
-
if (target.scrollInt) target.scrollInt.clear();
|
|
32794
|
-
}
|
|
32795
|
-
} else {
|
|
32796
|
-
if (ghost.y > target.zgb.y && ghost.y < target.zgb.y + target.zgb.height) {
|
|
32797
|
-
if (ghost.x < target.zgb.x) {
|
|
32798
|
-
if (ghost.x > target.zgb.x - 50) scrollUp(target, dropScrollSpeed);
|
|
32799
|
-
else if (ghost.x > target.zgb.x - 80) scrollUp(target, dropScrollSpeed*1.5);
|
|
32800
|
-
onCheck = true;
|
|
32801
|
-
} else if (ghost.x > target.zgb.x + target.zgb.width) {
|
|
32802
|
-
if (ghost.x < target.zgb.x + target.zgb.width + 50) scrollDown(target, dropScrollSpeed);
|
|
32803
|
-
else if (ghost.x < target.zgb.x + target.zgb.width + 80) scrollDown(target, dropScrollSpeed*1.5);
|
|
32804
|
-
onCheck = true;
|
|
32805
|
-
} else if (target.scrollInt) target.scrollInt.clear();
|
|
32806
|
-
} else {
|
|
32807
|
-
if (target.scrollInt) target.scrollInt.clear();
|
|
32808
|
-
}
|
|
32809
|
-
}
|
|
32810
|
-
|
|
32811
|
-
// place reticle
|
|
32812
|
-
if (target.hitTestReg(ghost)) {
|
|
32813
|
-
onCheck = true;
|
|
32814
|
-
var point = target.tabs.globalToLocal(ghost.x, ghost.y);
|
|
32815
|
-
var item = target.tabs.getObjectUnderPoint(point.x, point.y, 1);
|
|
32816
|
-
var yy;
|
|
32817
|
-
var xx;
|
|
32818
|
-
var bounds;
|
|
32819
|
-
if (item) {
|
|
32820
|
-
checkItem = item;
|
|
32821
|
-
var good = target.items.includes(checkItem);
|
|
32822
|
-
if (zot(item.znum)) {
|
|
32823
|
-
while(checkItem.parent) {
|
|
32824
|
-
if (target.items.includes(checkItem.parent)) {
|
|
32825
|
-
good = true;
|
|
32826
|
-
item = checkItem.parent;
|
|
32827
|
-
break;
|
|
32828
|
-
}
|
|
32829
|
-
checkItem = checkItem.parent;
|
|
32830
|
-
}
|
|
32831
|
-
}
|
|
32832
|
-
if (!good) return;
|
|
32833
|
-
bounds = item.boundsToGlobal();
|
|
32834
|
-
|
|
32835
|
-
// target.dropReticle.visible = true;
|
|
32836
|
-
// if (checkItem == downItem) target.dropReticle.visible = false;
|
|
32837
|
-
|
|
32838
|
-
if (target.vertical) {
|
|
32839
|
-
if (ghost.y > bounds.y + bounds.height/2) {
|
|
32840
|
-
yy = bounds.y + bounds.height + target.spacing*target.zgs/2;
|
|
32841
|
-
if (yy > target.zgb.y && yy < target.zgb.y + target.zgb.height) {
|
|
32842
|
-
target.dropReticle.loc(bounds.x + bounds.width/2, yy);
|
|
32843
|
-
target.dropReticleIndex = item.znum + 1;
|
|
32844
|
-
}
|
|
32845
|
-
} else {
|
|
32846
|
-
yy = bounds.y - target.spacing*target.zgs/2;
|
|
32847
|
-
if (yy > target.zgb.y && yy < target.zgb.y + target.zgb.height) {
|
|
32848
|
-
target.dropReticle.loc(bounds.x + bounds.width/2, yy);
|
|
32849
|
-
target.dropReticleIndex = item.znum;
|
|
32850
|
-
}
|
|
32851
|
-
}
|
|
32852
|
-
} else {
|
|
32853
|
-
if (ghost.x > bounds.x + bounds.width/2) {
|
|
32854
|
-
xx = bounds.x + bounds.width + target.spacing*target.zgs/2;
|
|
32855
|
-
if (xx > target.zgb.x && xx < target.zgb.x + target.zgb.width) {
|
|
32856
|
-
target.dropReticle.loc(xx, bounds.y + bounds.height/2);
|
|
32857
|
-
target.dropReticleIndex = item.znum + 1;
|
|
32858
|
-
}
|
|
32859
|
-
} else {
|
|
32860
|
-
xx = bounds.x - target.spacing*target.zgs/2;
|
|
32861
|
-
if (xx > target.zgb.x && xx < target.zgb.x + target.zgb.width) {
|
|
32862
|
-
target.dropReticle.loc(xx, bounds.y + bounds.height/2);
|
|
32863
|
-
target.dropReticleIndex = item.znum;
|
|
32864
|
-
}
|
|
32865
|
-
}
|
|
32866
|
-
}
|
|
32867
|
-
} else {
|
|
32868
|
-
if (target.items.length > 0) {
|
|
32869
|
-
bounds = target.items[target.items.length-1].boundsToGlobal();
|
|
32870
|
-
if (target.vertical) {
|
|
32871
|
-
if (ghost.y > bounds.y + bounds.height) {
|
|
32872
|
-
yy = bounds.y + bounds.height + target.spacing*target.zgs/2;
|
|
32873
|
-
target.dropReticle.loc(target.zgb.x + target.zgb.width/2, yy);
|
|
32874
|
-
target.dropReticleIndex = target.items.length;
|
|
32875
|
-
} else {
|
|
32876
|
-
target.dropReticle.removeFrom();
|
|
32877
|
-
target.dropReticleIndex = null;
|
|
32878
|
-
}
|
|
32879
|
-
} else {
|
|
32880
|
-
if (ghost.x > bounds.x + bounds.width) {
|
|
32881
|
-
xx = bounds.x + bounds.width + target.spacing*target.zgs/2;
|
|
32882
|
-
target.dropReticle.loc(xx, target.zgb.y + target.zgb.height/2);
|
|
32883
|
-
target.dropReticleIndex = target.items.length;
|
|
32884
|
-
} else {
|
|
32885
|
-
target.dropReticle.removeFrom();
|
|
32886
|
-
target.dropReticleIndex = null;
|
|
32887
|
-
}
|
|
32888
|
-
}
|
|
32889
|
-
} else {
|
|
32890
|
-
if (target.vertical) {
|
|
32891
|
-
yy = target.zgb.y + target.spacing*target.zgs/2;
|
|
32892
|
-
target.dropReticle.loc(target.zgb.x + target.zgb.width/2, yy);
|
|
32893
|
-
target.dropReticleIndex = 0;
|
|
32894
|
-
} else {
|
|
32895
|
-
xx = target.zgb.x + target.spacing*target.zgs/2;
|
|
32896
|
-
target.dropReticle.loc(xx, target.zgb.y + target.zgb.height/2);
|
|
32897
|
-
target.dropReticleIndex = 0;
|
|
32898
|
-
}
|
|
32899
|
-
}
|
|
32900
|
-
}
|
|
32901
|
-
} else {
|
|
32902
|
-
target.dropReticle.removeFrom();
|
|
32903
|
-
target.dropReticleIndex = null;
|
|
32904
|
-
}
|
|
32905
|
-
});
|
|
32788
|
+
zim.List.doDropOver(dropTargets, ghost, checkItem, dropScrollSpeed);
|
|
32906
32789
|
});
|
|
32907
32790
|
|
|
32908
32791
|
that.dispatchEvent("dropdown");
|
|
32909
32792
|
|
|
32910
|
-
frame.
|
|
32911
|
-
|
|
32912
|
-
|
|
32793
|
+
// frame.on("mouseupplus", smu, null, true); // once - but does not work with touch
|
|
32794
|
+
that.pointerUpEvent = frame.on("pointerup", smu); // pointer does not have a once!
|
|
32795
|
+
// frame.stage.on("stagemouseup", smu, null, true); // once - seems to be working on iframes, etc.
|
|
32796
|
+
function smu() {
|
|
32797
|
+
frame.off("pointerup", that.pointerUpEvent)
|
|
32798
|
+
frame.stage.off("stagemousemove", that.dropStage);
|
|
32799
|
+
|
|
32913
32800
|
var empty = zim.loop(dropTargets, function(target) {
|
|
32914
|
-
if (target.type != "List")
|
|
32801
|
+
if (target.type != "List") {
|
|
32802
|
+
|
|
32803
|
+
// DROPPING OUTSIDE LIST
|
|
32804
|
+
|
|
32805
|
+
if (ghost["hitTest"+String(dropHitTest).charAt(0).toUpperCase() + String(dropHitTest).slice(1)](target)) {
|
|
32806
|
+
|
|
32807
|
+
if (!dropFull || !target.dropFull) {
|
|
32808
|
+
downItem.alpha = itemAlpha;
|
|
32809
|
+
if (!dropCopy) that.removeAt(1,itemIndex);
|
|
32810
|
+
ghost.reg(downItem.regX, downItem.regY, true);
|
|
32811
|
+
if (dropSnap) ghost.loc(target);
|
|
32812
|
+
if (dropScale) ghost.sca(dropScale);
|
|
32813
|
+
if (dropWidth || dropHeight) ghost.siz(dropWidth, dropHeight);
|
|
32814
|
+
if (dropEnd) ghost.noMouse();
|
|
32815
|
+
if (dropFull) target.dropFull = true;
|
|
32816
|
+
ghost.droppedTarget = target;
|
|
32817
|
+
ghost.dropClone = true;
|
|
32818
|
+
ghost.dropList = that;
|
|
32819
|
+
ghost.dropTarget = target;
|
|
32820
|
+
ghost.alpha = itemAlpha;
|
|
32821
|
+
|
|
32822
|
+
ghost.dropStartX = downItem.dropStartX;
|
|
32823
|
+
ghost.dropStartY = downItem.dropStartY;
|
|
32824
|
+
ghost.dropStartS = downItem.dropStartS;
|
|
32825
|
+
|
|
32826
|
+
that.dropItem = ghost;
|
|
32827
|
+
that.dropTarget = target;
|
|
32828
|
+
ghost = null;
|
|
32829
|
+
downPoint = null;
|
|
32830
|
+
downItem = null;
|
|
32831
|
+
return false;
|
|
32832
|
+
}
|
|
32833
|
+
}
|
|
32834
|
+
return;
|
|
32835
|
+
}
|
|
32915
32836
|
if (target.scrollInt) target.scrollInt.clear();
|
|
32916
32837
|
if (!zot(target.dropReticleIndex)) {
|
|
32917
32838
|
target.dropReticle.removeFrom();
|
|
32918
|
-
that.removeAt(1,itemIndex);
|
|
32839
|
+
if (!dropCopy) that.removeAt(1,itemIndex);
|
|
32919
32840
|
|
|
32920
32841
|
if (itemIndex < target.dropReticleIndex && that == target) target.dropReticleIndex--;
|
|
32921
|
-
|
|
32842
|
+
|
|
32843
|
+
if (dropCopy) {
|
|
32844
|
+
target.addAt(ghost, target.dropReticleIndex);
|
|
32845
|
+
ghost.alpha = itemAlpha;
|
|
32846
|
+
ghost.dropList = that;
|
|
32847
|
+
ghost.dropTarget = target;
|
|
32848
|
+
that.dropItem = ghost;
|
|
32849
|
+
} else {
|
|
32850
|
+
target.addAt(downItem, target.dropReticleIndex);
|
|
32851
|
+
downItem.dropList = that;
|
|
32852
|
+
downItem.dropTarget = target;
|
|
32853
|
+
that.dropItem = downItem;
|
|
32854
|
+
ghost.dispose();
|
|
32855
|
+
}
|
|
32856
|
+
ghost = null;
|
|
32922
32857
|
|
|
32923
|
-
ghost.dispose();
|
|
32924
32858
|
downItem.alpha = itemAlpha;
|
|
32925
|
-
|
|
32926
|
-
|
|
32927
|
-
|
|
32928
|
-
that.dropItem = downItem;
|
|
32929
|
-
that.dropList = target;
|
|
32859
|
+
downPoint = null;
|
|
32860
|
+
|
|
32861
|
+
that.dropTarget = target;
|
|
32930
32862
|
that.dropNewIndex = target.dropReticleIndex;
|
|
32931
32863
|
target.dropReticleIndex = null;
|
|
32932
|
-
|
|
32864
|
+
downItem = null;
|
|
32865
|
+
|
|
32933
32866
|
return false;
|
|
32934
32867
|
}
|
|
32935
32868
|
});
|
|
32936
32869
|
|
|
32937
32870
|
if (empty) {
|
|
32871
|
+
if (!downItem) return;
|
|
32938
32872
|
var point = downItem.localToGlobal(itemPoint.x, itemPoint.y);
|
|
32939
32873
|
ghost.animate({x:point.x, y:point.y}, .1, null, function() {
|
|
32940
32874
|
ghost.dispose();
|
|
32941
32875
|
downItem.alpha = itemAlpha;
|
|
32942
32876
|
ghost = null;
|
|
32943
32877
|
downPoint = null;
|
|
32878
|
+
downItem = null;
|
|
32944
32879
|
})
|
|
32945
32880
|
that.dropItem = downItem;
|
|
32946
32881
|
that.dropList = that;
|
|
32882
|
+
that.dropTarget = null;
|
|
32947
32883
|
that.dropNewIndex = that.dropIndex;
|
|
32948
32884
|
}
|
|
32949
|
-
|
|
32950
32885
|
that.dispatchEvent("dropup");
|
|
32886
|
+
that.stage.update();
|
|
32951
32887
|
|
|
32952
|
-
}
|
|
32888
|
+
}
|
|
32953
32889
|
downItem.alp(.5);
|
|
32954
32890
|
}
|
|
32955
32891
|
});
|
|
@@ -33316,7 +33252,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
33316
33252
|
|
|
33317
33253
|
if (style!==false) zim.styleTransforms(this, DS);
|
|
33318
33254
|
this.clone = function() {
|
|
33319
|
-
return that.cloneProps(new zim.List(width, originalHeight, zim.copy(that.originalList, true), viewNum, vertical, currentSelected, align, valign, labelAlign, labelValign, labelIndent, labelIndentH, labelIndentV, indent, spacing, backgroundColor, rollBackgroundColor, downBackgroundColor, selectedBackgroundColor, selectedRollBackgroundColor, backdropColor, color, rollColor, downColor, selectedColor, selectedRollColor, originalBorderColor, originalBorderWidth, padding, zim.copy(corner), swipe, scrollBarActive, scrollBarDrag, scrollBarColor, scrollBarAlpha, scrollBarFade, scrollBarH, scrollBarV, scrollBarOverlay, slide, slideFactor, slideSnap, slideSnapDamp, shadowColor, shadowBlur, paddingH, paddingV, scrollWheel, damp, titleBar, titleBarColor, titleBarBackgroundColor, titleBarHeight, draggable, boundary, onTop, close, closeColor, collapse, collapseColor, collapsed, excludeCustomTap, organizer, checkBox, pulldown, clone, cancelCurrentDrag, index, noScale, pulldownToggle, optimize, keyEnabled, resizeHandle, resizeBoundary, resizeVisible, continuous, closeOthers, drop, dropTargets, dropColor, dropThickness, dropScrollSpeed, dropReticleAlpha, selectedIndex, style, this.group, inherit));
|
|
33255
|
+
return that.cloneProps(new zim.List(width, originalHeight, zim.copy(that.originalList, true), viewNum, vertical, currentSelected, align, valign, labelAlign, labelValign, labelIndent, labelIndentH, labelIndentV, indent, spacing, backgroundColor, rollBackgroundColor, downBackgroundColor, selectedBackgroundColor, selectedRollBackgroundColor, backdropColor, color, rollColor, downColor, selectedColor, selectedRollColor, originalBorderColor, originalBorderWidth, padding, zim.copy(corner), swipe, scrollBarActive, scrollBarDrag, scrollBarColor, scrollBarAlpha, scrollBarFade, scrollBarH, scrollBarV, scrollBarOverlay, slide, slideFactor, slideSnap, slideSnapDamp, shadowColor, shadowBlur, paddingH, paddingV, scrollWheel, damp, titleBar, titleBarColor, titleBarBackgroundColor, titleBarHeight, draggable, boundary, onTop, close, closeColor, collapse, collapseColor, collapsed, excludeCustomTap, organizer, checkBox, pulldown, clone, cancelCurrentDrag, index, noScale, pulldownToggle, optimize, keyEnabled, resizeHandle, resizeBoundary, resizeVisible, continuous, closeOthers, drop, dropTargets, dropSelf, dropCopy, dropColor, dropThickness, dropScrollSpeed, dropReticleAlpha, dropHitTest, dropFull, dropSnap, dropEnd, dropScale, dropWidth, dropHeight, selectedIndex, style, this.group, inherit));
|
|
33320
33256
|
};
|
|
33321
33257
|
this.dispose = function(a,b,disposing) {
|
|
33322
33258
|
if (!disposing) {
|
|
@@ -33330,6 +33266,188 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
33330
33266
|
};
|
|
33331
33267
|
zim.extend(zim.List, zim.Window, ["clone","dispose"], "zimWindow", false);
|
|
33332
33268
|
|
|
33269
|
+
|
|
33270
|
+
zim.List.scrollUp = function(target, dropScrollSpeed) {
|
|
33271
|
+
if (target.scrollInt) target.scrollInt.clear();
|
|
33272
|
+
target.scrollInt = zim.interval(.01, function() {
|
|
33273
|
+
if (target.dropReticle.parent) target.dropReticle.removeFrom();
|
|
33274
|
+
if (target.vertical) {
|
|
33275
|
+
target.scrollY += dropScrollSpeed;
|
|
33276
|
+
if (target.scrollY > 0) {
|
|
33277
|
+
target.scrollY = 0;
|
|
33278
|
+
target.scrollInt.clear();
|
|
33279
|
+
}
|
|
33280
|
+
} else {
|
|
33281
|
+
target.scrollX += dropScrollSpeed;
|
|
33282
|
+
if (target.scrollX > 0) {
|
|
33283
|
+
target.scrollX = 0;
|
|
33284
|
+
target.scrollInt.clear();
|
|
33285
|
+
}
|
|
33286
|
+
}
|
|
33287
|
+
}, null, null, null, "seconds");
|
|
33288
|
+
}
|
|
33289
|
+
|
|
33290
|
+
zim.List.scrollDown = function(target, dropScrollSpeed) {
|
|
33291
|
+
if (target.scrollInt) target.scrollInt.clear();
|
|
33292
|
+
target.scrollInt = zim.interval(.01, function() {
|
|
33293
|
+
if (target.dropReticle.parent) target.dropReticle.removeFrom();
|
|
33294
|
+
if (target.vertical) {
|
|
33295
|
+
target.scrollY -= dropScrollSpeed;
|
|
33296
|
+
if (target.scrollY < -target.scrollYMax) {
|
|
33297
|
+
target.scrollY = -target.scrollYMax;
|
|
33298
|
+
target.scrollInt.clear();
|
|
33299
|
+
}
|
|
33300
|
+
} else {
|
|
33301
|
+
target.scrollX -= dropScrollSpeed;
|
|
33302
|
+
if (target.scrollX < -target.scrollXMax) {
|
|
33303
|
+
target.scrollX = -target.scrollXMax;
|
|
33304
|
+
target.scrollInt.clear();
|
|
33305
|
+
}
|
|
33306
|
+
}
|
|
33307
|
+
}, null, null, null, "seconds");
|
|
33308
|
+
}
|
|
33309
|
+
|
|
33310
|
+
zim.List.doDropOver = function(dropTargets, ghost, checkItem, dropScrollSpeed) {
|
|
33311
|
+
var onCheck;
|
|
33312
|
+
zim.loop(dropTargets, function(target) {
|
|
33313
|
+
if (target.type != "List") return;
|
|
33314
|
+
if (onCheck) {
|
|
33315
|
+
if (target.scrollInt) target.scrollInt.clear();
|
|
33316
|
+
target.dropReticle.removeFrom();
|
|
33317
|
+
target.dropReticleIndex = null;
|
|
33318
|
+
return; // next in loop
|
|
33319
|
+
}
|
|
33320
|
+
if (target.vertical) {
|
|
33321
|
+
if (target.scrollYMax > 0) {
|
|
33322
|
+
if (ghost.x > target.zgb.x && ghost.x < target.zgb.x + target.zgb.width) {
|
|
33323
|
+
if (ghost.y < target.zgb.y) { // carefull - need to do these separately to turn off diamond
|
|
33324
|
+
if (ghost.y > target.zgb.y - 50) zim.List.scrollUp(target, dropScrollSpeed);
|
|
33325
|
+
else if (ghost.y > target.zgb.y - 80) zim.List.scrollUp(target, dropScrollSpeed*1.5);
|
|
33326
|
+
onCheck = true;
|
|
33327
|
+
} else if (ghost.y > target.zgb.y + target.zgb.height) {
|
|
33328
|
+
if (ghost.y < target.zgb.y + target.zgb.height + 50) zim.List.scrollDown(target, dropScrollSpeed);
|
|
33329
|
+
else if (ghost.y < target.zgb.y + target.zgb.height + 80) zim.List.scrollDown(target, dropScrollSpeed*1.5);
|
|
33330
|
+
onCheck = true;
|
|
33331
|
+
} else if (target.scrollInt) target.scrollInt.clear();
|
|
33332
|
+
} else {
|
|
33333
|
+
if (target.scrollInt) target.scrollInt.clear();
|
|
33334
|
+
}
|
|
33335
|
+
}
|
|
33336
|
+
} else {
|
|
33337
|
+
if (target.scrollXMax > 0) {
|
|
33338
|
+
if (ghost.y > target.zgb.y && ghost.y < target.zgb.y + target.zgb.height) {
|
|
33339
|
+
if (ghost.x < target.zgb.x) {
|
|
33340
|
+
if (ghost.x > target.zgb.x - 50) zim.List.scrollUp(target, dropScrollSpeed);
|
|
33341
|
+
else if (ghost.x > target.zgb.x - 80) zim.List.scrollUp(target, dropScrollSpeed*1.5);
|
|
33342
|
+
onCheck = true;
|
|
33343
|
+
} else if (ghost.x > target.zgb.x + target.zgb.width) {
|
|
33344
|
+
if (ghost.x < target.zgb.x + target.zgb.width + 50) zim.List.scrollDown(target, dropScrollSpeed);
|
|
33345
|
+
else if (ghost.x < target.zgb.x + target.zgb.width + 80) zim.List.scrollDown(target, dropScrollSpeed*1.5);
|
|
33346
|
+
onCheck = true;
|
|
33347
|
+
} else if (target.scrollInt) target.scrollInt.clear();
|
|
33348
|
+
} else {
|
|
33349
|
+
if (target.scrollInt) target.scrollInt.clear();
|
|
33350
|
+
}
|
|
33351
|
+
}
|
|
33352
|
+
}
|
|
33353
|
+
|
|
33354
|
+
// place reticle
|
|
33355
|
+
if (target.hitTestReg(ghost)) {
|
|
33356
|
+
onCheck = true;
|
|
33357
|
+
var point = target.tabs.globalToLocal(ghost.x, ghost.y);
|
|
33358
|
+
var item = target.tabs.getObjectUnderPoint(point.x, point.y, 1);
|
|
33359
|
+
var yy;
|
|
33360
|
+
var xx;
|
|
33361
|
+
var bounds;
|
|
33362
|
+
if (item) {
|
|
33363
|
+
checkItem = item;
|
|
33364
|
+
var good = target.items.includes(checkItem);
|
|
33365
|
+
if (zot(item.znum)) {
|
|
33366
|
+
while(checkItem.parent) {
|
|
33367
|
+
if (target.items.includes(checkItem.parent)) {
|
|
33368
|
+
good = true;
|
|
33369
|
+
item = checkItem.parent;
|
|
33370
|
+
break;
|
|
33371
|
+
}
|
|
33372
|
+
checkItem = checkItem.parent;
|
|
33373
|
+
}
|
|
33374
|
+
}
|
|
33375
|
+
if (!good) return;
|
|
33376
|
+
bounds = item.boundsToGlobal();
|
|
33377
|
+
|
|
33378
|
+
// target.dropReticle.visible = true;
|
|
33379
|
+
// if (checkItem == downItem) target.dropReticle.visible = false;
|
|
33380
|
+
|
|
33381
|
+
if (target.vertical) {
|
|
33382
|
+
if (ghost.y > bounds.y + bounds.height/2) {
|
|
33383
|
+
yy = bounds.y + bounds.height + target.spacing*target.zgs/2;
|
|
33384
|
+
if (yy > target.zgb.y && yy < target.zgb.y + target.zgb.height) {
|
|
33385
|
+
target.dropReticle.loc(bounds.x + bounds.width/2, yy);
|
|
33386
|
+
target.dropReticleIndex = item.znum + 1;
|
|
33387
|
+
}
|
|
33388
|
+
} else {
|
|
33389
|
+
yy = bounds.y - target.spacing*target.zgs/2;
|
|
33390
|
+
if (yy > target.zgb.y && yy < target.zgb.y + target.zgb.height) {
|
|
33391
|
+
target.dropReticle.loc(bounds.x + bounds.width/2, yy);
|
|
33392
|
+
target.dropReticleIndex = item.znum;
|
|
33393
|
+
}
|
|
33394
|
+
}
|
|
33395
|
+
} else {
|
|
33396
|
+
if (ghost.x > bounds.x + bounds.width/2) {
|
|
33397
|
+
xx = bounds.x + bounds.width + target.spacing*target.zgs/2;
|
|
33398
|
+
if (xx > target.zgb.x && xx < target.zgb.x + target.zgb.width) {
|
|
33399
|
+
target.dropReticle.loc(xx, bounds.y + bounds.height/2);
|
|
33400
|
+
target.dropReticleIndex = item.znum + 1;
|
|
33401
|
+
}
|
|
33402
|
+
} else {
|
|
33403
|
+
xx = bounds.x - target.spacing*target.zgs/2;
|
|
33404
|
+
if (xx > target.zgb.x && xx < target.zgb.x + target.zgb.width) {
|
|
33405
|
+
target.dropReticle.loc(xx, bounds.y + bounds.height/2);
|
|
33406
|
+
target.dropReticleIndex = item.znum;
|
|
33407
|
+
}
|
|
33408
|
+
}
|
|
33409
|
+
}
|
|
33410
|
+
} else {
|
|
33411
|
+
if (target.items.length > 0) {
|
|
33412
|
+
bounds = target.items[target.items.length-1].boundsToGlobal();
|
|
33413
|
+
if (target.vertical) {
|
|
33414
|
+
if (ghost.y > bounds.y + bounds.height) {
|
|
33415
|
+
yy = bounds.y + bounds.height + target.spacing*target.zgs/2;
|
|
33416
|
+
target.dropReticle.loc(target.zgb.x + target.zgb.width/2, yy);
|
|
33417
|
+
target.dropReticleIndex = target.items.length;
|
|
33418
|
+
} else {
|
|
33419
|
+
target.dropReticle.removeFrom();
|
|
33420
|
+
target.dropReticleIndex = null;
|
|
33421
|
+
}
|
|
33422
|
+
} else {
|
|
33423
|
+
if (ghost.x > bounds.x + bounds.width) {
|
|
33424
|
+
xx = bounds.x + bounds.width + target.spacing*target.zgs/2;
|
|
33425
|
+
target.dropReticle.loc(xx, target.zgb.y + target.zgb.height/2);
|
|
33426
|
+
target.dropReticleIndex = target.items.length;
|
|
33427
|
+
} else {
|
|
33428
|
+
target.dropReticle.removeFrom();
|
|
33429
|
+
target.dropReticleIndex = null;
|
|
33430
|
+
}
|
|
33431
|
+
}
|
|
33432
|
+
} else {
|
|
33433
|
+
if (target.vertical) {
|
|
33434
|
+
yy = target.zgb.y + target.spacing*target.zgs/2;
|
|
33435
|
+
target.dropReticle.loc(target.zgb.x + target.zgb.width/2, yy);
|
|
33436
|
+
target.dropReticleIndex = 0;
|
|
33437
|
+
} else {
|
|
33438
|
+
xx = target.zgb.x + target.spacing*target.zgs/2;
|
|
33439
|
+
target.dropReticle.loc(xx, target.zgb.y + target.zgb.height/2);
|
|
33440
|
+
target.dropReticleIndex = 0;
|
|
33441
|
+
}
|
|
33442
|
+
}
|
|
33443
|
+
}
|
|
33444
|
+
} else {
|
|
33445
|
+
target.dropReticle.removeFrom();
|
|
33446
|
+
target.dropReticleIndex = null;
|
|
33447
|
+
}
|
|
33448
|
+
});
|
|
33449
|
+
}
|
|
33450
|
+
|
|
33333
33451
|
zim.List.makeBase = function(c, label, paddingLeft, backgroundColor) {
|
|
33334
33452
|
if (zot(backgroundColor)) backgroundColor = zim.dark;
|
|
33335
33453
|
c.backing = new zim.Rectangle(c.width, c.height, backgroundColor).center(c);
|
|
@@ -45654,10 +45772,12 @@ only if the TextArea is directly in the Pane or the page (not nested in further
|
|
|
45654
45772
|
|
|
45655
45773
|
NOTE: rotation and skewing of TextArea is not supported - although might work with custom CSS transformations
|
|
45656
45774
|
|
|
45657
|
-
NOTE: because of these limitations, consider the TextEditor as a solution.
|
|
45775
|
+
NOTE: because of these limitations, consider the TextEditor or TextInput as a solution.
|
|
45658
45776
|
The TextEditor allows you to use a Label which is a proper part of the Canvas
|
|
45659
45777
|
and then change the label with a pop-up editor that includes a TextArea.
|
|
45660
45778
|
SEE: https://zimjs.com/cat/texteditor.html
|
|
45779
|
+
TextInput is a one line input text field that is actually part of the canvas
|
|
45780
|
+
SEE https://zimjs.com/explore/textinput.html
|
|
45661
45781
|
|
|
45662
45782
|
NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
|
|
45663
45783
|
|
|
@@ -48834,7 +48954,7 @@ RETURNS obj for chaining
|
|
|
48834
48954
|
};//-47.95
|
|
48835
48955
|
|
|
48836
48956
|
/*--
|
|
48837
|
-
obj.drag = function(boundary, axis, overCursor, dragCursor, all, swipe, localBoundary, onTop, surround, slide, slideFactor, slideSnap, slideSnapDamp, reg, removeTweens, startBounds, rect, currentTarget, offStage, immediateBoundary, singleTouch)
|
|
48957
|
+
obj.drag = function(boundary, axis, overCursor, dragCursor, all, swipe, localBoundary, onTop, surround, slide, slideFactor, slideSnap, slideSnapDamp, reg, removeTweens, startBounds, rect, currentTarget, offStage, immediateBoundary, singleTouch, dropTargets, dropCopy, dropSnap, dropBack, dropEnd, dropFull, dropHitTest, dropScale, dropWidth, dropHeight)
|
|
48838
48958
|
|
|
48839
48959
|
drag
|
|
48840
48960
|
zim DisplayObject method
|
|
@@ -48845,6 +48965,12 @@ Handles scaled, rotated nested objects.
|
|
|
48845
48965
|
Also see draggable property for setting a default drag() and noDrag()
|
|
48846
48966
|
and to indicate whether a drag has been set.
|
|
48847
48967
|
|
|
48968
|
+
DROP
|
|
48969
|
+
As if ZIM 017, drop parameters and properties have been added.
|
|
48970
|
+
These allow List items to be dragged and dropped on targets and ZIM Lists
|
|
48971
|
+
Also see ZIM List drop parameters
|
|
48972
|
+
See https://zimjs.com/017/dropping.html
|
|
48973
|
+
|
|
48848
48974
|
NOTE: drag() will stop ZIM Swipe() from triggering a swipe event.
|
|
48849
48975
|
Set the overridNoSwipe parameter of ZIM Swipe() to true to capture swipe events.
|
|
48850
48976
|
|
|
@@ -48893,6 +49019,18 @@ circle.on("mousedown", ()=>{
|
|
|
48893
49019
|
circle.on("pressup", ()=>{circle.dragBoundary()});
|
|
48894
49020
|
END EXAMPLE
|
|
48895
49021
|
|
|
49022
|
+
EXAMPLE
|
|
49023
|
+
// Dropping on targets
|
|
49024
|
+
// see also https://zimjs.com/017/dropping.html
|
|
49025
|
+
const rectangles = new Tile(new Rectangle(130,130).reg(CENTER),3,1,50,0).pos(0,100,CENTER,CENTER);
|
|
49026
|
+
new Tile(new Circle(50,series(red,blue,pink)),3,1,70,0).pos(0,-100,CENTER,CENTER).drag({
|
|
49027
|
+
dropTargets:rectangles.items,
|
|
49028
|
+
// dropEnd:false,
|
|
49029
|
+
// dropCopy:true,
|
|
49030
|
+
// dropBack:false // and more!
|
|
49031
|
+
});
|
|
49032
|
+
END EXAMPLE
|
|
49033
|
+
|
|
48896
49034
|
PARAMETERS supports DUO - parameters or single object with properties below
|
|
48897
49035
|
boundary - (default null) a ZIM Boundary object for the drag boundary
|
|
48898
49036
|
or a ZIM DisplayObject including stage
|
|
@@ -48944,6 +49082,21 @@ immediateBoundary - (default false) set to true to add bounds immediately when d
|
|
|
48944
49082
|
this is normally set to false for a .05 second delay to allow objects to be added to Container before setting bounds.
|
|
48945
49083
|
singleTouch - (default false) set to true to let only one touch operate the drag
|
|
48946
49084
|
also see Frame() singleTouch setting - but setting on drag will only affect that object's drag
|
|
49085
|
+
dropTargets - an object or an array of objects that can receive a drop
|
|
49086
|
+
this can be a List or a Container or a single object
|
|
49087
|
+
if it is a list see the dropListProps as well to set reticle properties and scroll speed
|
|
49088
|
+
dropCopy - (default false) make a copy of the object as it is being dragged
|
|
49089
|
+
dropSnap - (default true) snap to the target object
|
|
49090
|
+
dropBack - (default true) go back to start if not dropped on a target
|
|
49091
|
+
dropEnd - (default true) once dropped on a target a noMouse() is set on the object
|
|
49092
|
+
dropFull - (default true) do not drop on a full target
|
|
49093
|
+
note - if the object is removed from the target then a drop can occur again on that target
|
|
49094
|
+
dropHitTest - (default "bounds") can also be "reg", "circles", "circle", "rect" - see ZIM HitTests
|
|
49095
|
+
dropScale - set a scale for the dropped object
|
|
49096
|
+
dropWidth - set a width for the dropped object - overrides scale
|
|
49097
|
+
height will keep aspect ratio unless dropHeight is provided
|
|
49098
|
+
dropHeight - set a height for the dropped object - overrides scale
|
|
49099
|
+
width will keep aspect ratio unless dropWidth is provided
|
|
48947
49100
|
|
|
48948
49101
|
note: will not update stage if OPTIMIZE is set to true
|
|
48949
49102
|
unless Ticker.update is set to true or you run Ticker.always(stage) see zim.Ticker
|
|
@@ -48951,6 +49104,19 @@ unless Ticker.update is set to true or you run Ticker.always(stage) see zim.Tick
|
|
|
48951
49104
|
PROPERTIES
|
|
48952
49105
|
adds a dragPaused property to get or set the pause of the drag - which allows setting to be kept
|
|
48953
49106
|
see also noDrag() where settings will be removed
|
|
49107
|
+
*** if dropTargets is set then drag() adds the following properties to the dragged object:
|
|
49108
|
+
dropTarget - on pressup, what target the object is dropped on (or null)
|
|
49109
|
+
dropList - which List if any a dropped object has
|
|
49110
|
+
dropListProps - to be used if planning on dropping object into a List
|
|
49111
|
+
The dropListProps have the following default values
|
|
49112
|
+
{
|
|
49113
|
+
color:white,
|
|
49114
|
+
thickness:1,
|
|
49115
|
+
alpha:1,
|
|
49116
|
+
speed:5
|
|
49117
|
+
}
|
|
49118
|
+
These can be changed to set List reticle properties and drop speed
|
|
49119
|
+
See the ZIM List drop parameters for more information
|
|
48954
49120
|
|
|
48955
49121
|
EVENTS
|
|
48956
49122
|
Adds a "slidestart" event to the drag object that is dispatched when the object starts sliding - if slide is true
|
|
@@ -48958,8 +49124,8 @@ Adds a "slidestop" event to the drag object that is dispatched when the object c
|
|
|
48958
49124
|
|
|
48959
49125
|
RETURNS obj for chaining
|
|
48960
49126
|
--*///+31
|
|
48961
|
-
zim.drag = function(obj, boundary, axis, overCursor, dragCursor, all, swipe, localBoundary, onTop, surround, slide, slideFactor, slideSnap, slideSnapDamp, reg, removeTweens, startBounds, rect, currentTarget, offStage, immediateBoundary, singleTouch) {
|
|
48962
|
-
var sig = "obj, boundary, axis, overCursor, dragCursor, all, swipe, localBoundary, onTop, surround, slide, slideFactor, slideSnap, slideSnapDamp, reg, removeTweens, startBounds, rect, currentTarget, offStage, immediateBoundary, singleTouch";
|
|
49127
|
+
zim.drag = function(obj, boundary, axis, overCursor, dragCursor, all, swipe, localBoundary, onTop, surround, slide, slideFactor, slideSnap, slideSnapDamp, reg, removeTweens, startBounds, rect, currentTarget, offStage, immediateBoundary, singleTouch, dropTargets, dropCopy, dropSnap, dropBack, dropEnd, dropFull, dropHitTest, dropScale, dropWidth, dropHeight) {
|
|
49128
|
+
var sig = "obj, boundary, axis, overCursor, dragCursor, all, swipe, localBoundary, onTop, surround, slide, slideFactor, slideSnap, slideSnapDamp, reg, removeTweens, startBounds, rect, currentTarget, offStage, immediateBoundary, singleTouch, dropTargets, dropCopy, dropSnap, dropBack, dropEnd, dropFull, dropHitTest, dropScale, dropWidth, dropHeight";
|
|
48963
49129
|
var duo; if (duo = zob(zim.drag, arguments, sig)) return duo;
|
|
48964
49130
|
if (obj.type=="AC"&&WW.zdf) {WW.zdf.ac("drag", arguments); return obj;}
|
|
48965
49131
|
z_d("31");
|
|
@@ -49010,7 +49176,20 @@ RETURNS obj for chaining
|
|
|
49010
49176
|
if (zot(startBounds)) startBounds = true;
|
|
49011
49177
|
if (zot(boundary) && !zot(rect)) boundary = rect;
|
|
49012
49178
|
if (zot(singleTouch)) singleTouch = false;
|
|
49013
|
-
|
|
49179
|
+
|
|
49180
|
+
if (dropTargets) {
|
|
49181
|
+
slide = false;
|
|
49182
|
+
obj.dropTargets = dropTargets;
|
|
49183
|
+
}
|
|
49184
|
+
if (zot(dropBack)) dropBack = true;
|
|
49185
|
+
if (zot(dropSnap)) dropSnap = true;
|
|
49186
|
+
if (zot(dropEnd)) dropEnd = true;
|
|
49187
|
+
if (zot(dropFull)) dropFull = true;
|
|
49188
|
+
var hitTypes = ["reg", "circles", "rect", "circle"];
|
|
49189
|
+
if (dropHitTest) dropHitTest.toLowerCase();
|
|
49190
|
+
if (!hitTypes.includes(dropHitTest)) dropHitTest = null;
|
|
49191
|
+
if (zot(dropHitTest)) dropHitTest = "bounds";
|
|
49192
|
+
|
|
49014
49193
|
obj.dragPaused = false;
|
|
49015
49194
|
|
|
49016
49195
|
if (slide) {
|
|
@@ -49151,6 +49330,7 @@ RETURNS obj for chaining
|
|
|
49151
49330
|
var stage;
|
|
49152
49331
|
obj.pointers = {};
|
|
49153
49332
|
var stCheck = false;
|
|
49333
|
+
var dropListCheck;
|
|
49154
49334
|
obj.zimDown = obj.on("mousedown", function(e) {
|
|
49155
49335
|
if (!obj.stage || obj.dragPaused) return;
|
|
49156
49336
|
if (singleTouch && stCheck) {
|
|
@@ -49162,6 +49342,7 @@ RETURNS obj for chaining
|
|
|
49162
49342
|
// obj.zimMove = obj.on("pressmove", obj.zimMove); // for some reason causing squiggle drag problems
|
|
49163
49343
|
|
|
49164
49344
|
stCheck = true;
|
|
49345
|
+
dropListCheck = false;
|
|
49165
49346
|
stage = obj.stage;
|
|
49166
49347
|
if (!obj.zmu) obj.zmu = stage.frame.on("mouseupplus", function(e) {
|
|
49167
49348
|
if (obj.downCheck) {
|
|
@@ -49169,6 +49350,7 @@ RETURNS obj for chaining
|
|
|
49169
49350
|
doUp(e, true); // true for cancel slide
|
|
49170
49351
|
}
|
|
49171
49352
|
});
|
|
49353
|
+
|
|
49172
49354
|
obj.dragMouseX = Math.round(e.stageX/zim.scaX)+stage.x;
|
|
49173
49355
|
obj.dragMouseY = Math.round(e.stageY/zim.scaY)+stage.y;
|
|
49174
49356
|
var id = "id"+Math.abs(e.pointerID+1);
|
|
@@ -49178,6 +49360,8 @@ RETURNS obj for chaining
|
|
|
49178
49360
|
// bring stageX and stageY into the parent's frame of reference
|
|
49179
49361
|
// could use e.localX and e.localY but might be dragging container or contents
|
|
49180
49362
|
dragObject = (currentTarget)?e.currentTarget:e.target;
|
|
49363
|
+
|
|
49364
|
+
|
|
49181
49365
|
if (obj.zimBoundary && !dragObject.getBounds()) {zogy("zim.drag() - drag object needs bounds set"); return;}
|
|
49182
49366
|
obj.downCheck = true;
|
|
49183
49367
|
obj.stage.mouseMoveOutside = true;
|
|
@@ -49245,6 +49429,44 @@ RETURNS obj for chaining
|
|
|
49245
49429
|
moveCheck = false;
|
|
49246
49430
|
}
|
|
49247
49431
|
|
|
49432
|
+
// DROP - added ZIM 017 Patch
|
|
49433
|
+
if (zot(dragObject.dropStartS)) {
|
|
49434
|
+
dragObject.dropStartX = dragObject.x;
|
|
49435
|
+
dragObject.dropStartY = dragObject.y;
|
|
49436
|
+
dragObject.dropStartS = dragObject.scale;
|
|
49437
|
+
}
|
|
49438
|
+
if (obj.dropTargets && dropCopy && !dragObject.dropClone) {
|
|
49439
|
+
if (dragObject.clone) {
|
|
49440
|
+
dragObject.dropCopy = dragObject.clone(true).addTo(dragObject.parent, dragObject.parent.getChildIndex(dragObject));
|
|
49441
|
+
dragObject.dropCopy.dropClone = true;
|
|
49442
|
+
dragObject.dropCopy.dropStartX = dragObject.dropStartX;
|
|
49443
|
+
dragObject.dropCopy.dropStartY = dragObject.dropStartY;
|
|
49444
|
+
dragObject.dropCopy.dropStartS = dragObject.dropStartS;
|
|
49445
|
+
dragObject.dropCopy.noMouse();
|
|
49446
|
+
}
|
|
49447
|
+
}
|
|
49448
|
+
// HANDLE DROP ON LIST
|
|
49449
|
+
if (obj.dropTargets) {
|
|
49450
|
+
var notList = true;
|
|
49451
|
+
zim.loop(obj.dropTargets, function(target){
|
|
49452
|
+
if (target.type == "List") {
|
|
49453
|
+
if (!obj.dropListProps) obj.dropListProps = {
|
|
49454
|
+
color:white,
|
|
49455
|
+
thickness:1,
|
|
49456
|
+
alpha:1,
|
|
49457
|
+
speed:5
|
|
49458
|
+
};
|
|
49459
|
+
if (!target.dropReticle) {
|
|
49460
|
+
target.dropReticle = new zim.Rectangle(20,20,clear,obj.dropListProps.color,obj.dropListProps.thickness).reg(CENTER).rot(45).alp(obj.dropListProps.alpha);
|
|
49461
|
+
target.dropReticleIndex = null;
|
|
49462
|
+
target.zgb = target.boundsToGlobal();
|
|
49463
|
+
target.zgs = target.getConcatenatedDisplayProps().matrix.decompose().scaleX/stage.scaleX;
|
|
49464
|
+
}
|
|
49465
|
+
notList = false;
|
|
49466
|
+
}
|
|
49467
|
+
});
|
|
49468
|
+
dropListCheck = !notList;
|
|
49469
|
+
}
|
|
49248
49470
|
}, true);
|
|
49249
49471
|
|
|
49250
49472
|
obj.zimMove = obj.on("pressmove", function(e) {
|
|
@@ -49266,8 +49488,18 @@ RETURNS obj for chaining
|
|
|
49266
49488
|
if (dragObject.ZIMoutlineShape) dragObject.outline();
|
|
49267
49489
|
if (obj.type == "Pen" && !moveCheck && obj.drawing) moveCheck = true;
|
|
49268
49490
|
else if (obj.type == "Tag" || obj.type == "TextArea" || obj.type == "Loader") obj.resize();
|
|
49491
|
+
|
|
49492
|
+
// DROP ON LIST - added ZIM 017
|
|
49493
|
+
if (dropListCheck) {
|
|
49494
|
+
// scroll if ghost is at edges of scrollable list
|
|
49495
|
+
var ghost = dragObject;
|
|
49496
|
+
var checkItem;
|
|
49497
|
+
var dropScrollSpeed = obj.dropListProps.speed;
|
|
49498
|
+
zim.List.doDropOver(dropTargets, ghost, checkItem, dropScrollSpeed);
|
|
49499
|
+
}
|
|
49269
49500
|
}, true);
|
|
49270
49501
|
|
|
49502
|
+
|
|
49271
49503
|
// obj.off("pressmove",obj.zimMove); // for some reason causing squiggle drag problems
|
|
49272
49504
|
|
|
49273
49505
|
function positionObject(o, x, y) {
|
|
@@ -49346,6 +49578,7 @@ RETURNS obj for chaining
|
|
|
49346
49578
|
}
|
|
49347
49579
|
}
|
|
49348
49580
|
|
|
49581
|
+
|
|
49349
49582
|
obj.zimPosition = positionObject;
|
|
49350
49583
|
|
|
49351
49584
|
obj.zimUp = obj.on("pressup", function(e){doUp(e);}, true);
|
|
@@ -49433,9 +49666,96 @@ RETURNS obj for chaining
|
|
|
49433
49666
|
// if (moveCheck) obj.stopCheck();
|
|
49434
49667
|
}
|
|
49435
49668
|
}
|
|
49669
|
+
|
|
49670
|
+
// DROP - added ZIM 017 patch
|
|
49671
|
+
|
|
49672
|
+
if (obj.dropTargets) {
|
|
49673
|
+
if (!Array.isArray(obj.dropTargets)) obj.dropTargets = [obj.dropTargets];
|
|
49674
|
+
// watch - could drop from one target to another
|
|
49675
|
+
if (dragObject.droppedTarget) {
|
|
49676
|
+
dragObject.droppedTarget.dropFull = false;
|
|
49677
|
+
dragObject.droppedTarget = null;
|
|
49678
|
+
}
|
|
49679
|
+
var miss = zim.loop(obj.dropTargets, function(target) {
|
|
49680
|
+
|
|
49681
|
+
if (target.type == "List") {
|
|
49682
|
+
if (target.scrollInt) target.scrollInt.clear();
|
|
49683
|
+
if (!zot(target.dropReticleIndex)) {
|
|
49684
|
+
target.dropReticle.removeFrom();
|
|
49685
|
+
var placeObject = dragObject;
|
|
49686
|
+
if (dropCopy) {
|
|
49687
|
+
// need to do the swap on one of these
|
|
49688
|
+
if (dropCopy && dragObject.dropCopy) {
|
|
49689
|
+
placeObject = dragObject.dropCopy;
|
|
49690
|
+
swapProperties("x", dragObject, placeObject);
|
|
49691
|
+
swapProperties("y", dragObject, placeObject);
|
|
49692
|
+
}
|
|
49693
|
+
}
|
|
49694
|
+
if (dropScale) placeObject.sca(dropScale);
|
|
49695
|
+
if (dropWidth || dropHeight) placeObject.siz(dropWidth, dropHeight);
|
|
49696
|
+
if (dropEnd) placeObject.noMouse();
|
|
49697
|
+
else placeObject.mouse();
|
|
49698
|
+
placeObject.droppedTarget = target;
|
|
49699
|
+
target.addAt(placeObject, target.dropReticleIndex);
|
|
49700
|
+
|
|
49701
|
+
target.dropItem = dragObject;
|
|
49702
|
+
target.dropList = target;
|
|
49703
|
+
target.dropNewIndex = target.dropReticleIndex;
|
|
49704
|
+
target.dropReticleIndex = null;
|
|
49705
|
+
return false
|
|
49706
|
+
}
|
|
49707
|
+
return;
|
|
49708
|
+
}
|
|
49709
|
+
|
|
49710
|
+
if (dragObject["hitTest"+String(dropHitTest).charAt(0).toUpperCase() + String(dropHitTest).slice(1)](target)) {
|
|
49711
|
+
if (!dropFull || !target.dropFull) {
|
|
49712
|
+
var placeObject = dragObject;
|
|
49713
|
+
if (dropCopy && dragObject.dropCopy) {
|
|
49714
|
+
placeObject = dragObject.dropCopy;
|
|
49715
|
+
swapProperties("x", dragObject, placeObject);
|
|
49716
|
+
swapProperties("y", dragObject, placeObject);
|
|
49717
|
+
}
|
|
49718
|
+
// clone gets all these things
|
|
49719
|
+
if (dropSnap) placeObject.loc(target);
|
|
49720
|
+
if (dropScale) placeObject.sca(dropScale);
|
|
49721
|
+
if (dropWidth || dropHeight) placeObject.siz(dropWidth, dropHeight);
|
|
49722
|
+
if (dropEnd) placeObject.noMouse();
|
|
49723
|
+
else placeObject.mouse();
|
|
49724
|
+
if (dropFull) target.dropFull = true;
|
|
49725
|
+
placeObject.droppedTarget = target;
|
|
49726
|
+
return false;
|
|
49727
|
+
}
|
|
49728
|
+
}
|
|
49729
|
+
});
|
|
49730
|
+
if (miss) {
|
|
49731
|
+
if (dropBack) {
|
|
49732
|
+
dragObject.animate({
|
|
49733
|
+
props:{x:dragObject.dropStartX, y:dragObject.dropStartY, scale:dragObject.dropStartS},
|
|
49734
|
+
time:.2,
|
|
49735
|
+
timeUnit:"s",
|
|
49736
|
+
call:function(target) {
|
|
49737
|
+
if (dropCopy) {
|
|
49738
|
+
if (target.dropCopy) target.dropCopy.dispose();
|
|
49739
|
+
else target.dispose();
|
|
49740
|
+
}
|
|
49741
|
+
}
|
|
49742
|
+
});
|
|
49743
|
+
} else {
|
|
49744
|
+
dragObject.sca(dragObject.dropStartS);
|
|
49745
|
+
if (dropCopy && dragObject.dropCopy) {
|
|
49746
|
+
swapProperties("x", dragObject, dragObject.dropCopy);
|
|
49747
|
+
swapProperties("y", dragObject, dragObject.dropCopy);
|
|
49748
|
+
dragObject.dropCopy.mouse();
|
|
49749
|
+
}
|
|
49750
|
+
}
|
|
49751
|
+
|
|
49752
|
+
}
|
|
49753
|
+
}
|
|
49436
49754
|
if (obj.stage) obj.stage.update();
|
|
49437
49755
|
}
|
|
49438
49756
|
|
|
49757
|
+
|
|
49758
|
+
|
|
49439
49759
|
// the bounds check for registration inside the bounds
|
|
49440
49760
|
// or if surround is set for the whole object staying outside the bounds
|
|
49441
49761
|
function checkBounds(o, x, y) {
|
|
@@ -53530,7 +53850,7 @@ sequenceCall - (default null) the function that will be called for each sequence
|
|
|
53530
53850
|
Note: the value of the sequenceCall parameter will be the object that just ended animation unless there is a sequenceParams value
|
|
53531
53851
|
sequenceParams - (default null) a parameter sent to the sequenceCall function
|
|
53532
53852
|
sequenceReverse - |ZIM VEE| (default false) set to true to sequence through container or array backwards
|
|
53533
|
-
|
|
53853
|
+
sequenceRatio - (default null) set to a value to adjust the rate based on item ratio property
|
|
53534
53854
|
see https://zimjs.com/016/normalize.html
|
|
53535
53855
|
see Container() ratio property and normalize() method which give a ratio property.
|
|
53536
53856
|
This will automatically set sequence to 0 so that each item in the container (or tile) is animated individually
|
|
@@ -77265,11 +77585,11 @@ zim.Emitter = function(obj, width, height, interval, num, life, fade, shrink, wa
|
|
|
77265
77585
|
var shrinkMe = particle.emitShape?false:that.shrink;
|
|
77266
77586
|
|
|
77267
77587
|
var myLife = (container?container:particle).life = zik(that.life);
|
|
77588
|
+
that.traceFadeTime = Math.min(myLife, that.traceFadeTime);
|
|
77589
|
+
that.decayTime = Math.min(myLife, that.decayTime);
|
|
77268
77590
|
|
|
77269
77591
|
if (that.decayTime > 0 && (that.fade || shrinkMe || (that.trace && that.traceFadeTime > 0))) {
|
|
77270
|
-
// zog(pool)
|
|
77271
77592
|
if (that.trace && that.traceFadeTime > 0) {
|
|
77272
|
-
// zog("here")
|
|
77273
77593
|
container.animate({
|
|
77274
77594
|
obj:{alpha:0},
|
|
77275
77595
|
time:that.traceFadeTime,
|
|
@@ -83013,7 +83333,15 @@ EVENTS
|
|
|
83013
83333
|
also stores F.altKey, F.ctrlKey, F.metaKey, F.shiftKey
|
|
83014
83334
|
Note: Alt ArrowLeft and Alt ArrowRight has been set to go back or forward in the browser history
|
|
83015
83335
|
"keyup" - fired on keyup - just like the window keyup event with eventObject.keyCode, etc.
|
|
83336
|
+
"pointerdown", "pointermove", "pointerup", "pointerenter", "pointerleave" - mirrors DOM Pointer Events
|
|
83337
|
+
Note: the event object is a raw JavaScript event object, not a CreateJS event object
|
|
83338
|
+
so there is no clear() on the event object nor a once parameter for the on() method, instead use:
|
|
83339
|
+
const ev = F.on("pointerdown", ()=>{
|
|
83340
|
+
F.off("pointerdown", ev);
|
|
83341
|
+
// this will only run once
|
|
83342
|
+
});
|
|
83016
83343
|
"mouseupplus" - fired when the browser window receives a mouseup event
|
|
83344
|
+
NOTE: deprecated - would suggest using pointerup instead of this
|
|
83017
83345
|
also fired when the mouse enters the stage from an iFrame and is no longer down.
|
|
83018
83346
|
Note there is no eventObject.
|
|
83019
83347
|
ALSO see mouseupplusonly for only firing as mouse enters the stage from an iFrame and is no longer down.
|
|
@@ -83026,6 +83354,7 @@ EVENTS
|
|
|
83026
83354
|
This will call the up function as the mouse comes back onto the stage
|
|
83027
83355
|
if the mouse was down when leaving the stage and let up outside the iframe the canvas is in - goodness.
|
|
83028
83356
|
"mouseuplusonly" - fired when the mouse comes back from an iframe (not holding the canvas)
|
|
83357
|
+
NOTE: deprecated - would suggest using pointerup instead of this
|
|
83029
83358
|
and the mouse was down on the canvas and up in the iframe.
|
|
83030
83359
|
this does not fire on a regular mouseup whereas the mouseupplus will.
|
|
83031
83360
|
"wheel" - fired on mousewheel (Window wheel event)
|
|
@@ -84337,6 +84666,35 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
|
|
|
84337
84666
|
if (assetHolder.sound) assetHolder.sound.pan = value;
|
|
84338
84667
|
}
|
|
84339
84668
|
});
|
|
84669
|
+
Object.defineProperty(assetHolder.proxy, 'paused', {
|
|
84670
|
+
get: function() {
|
|
84671
|
+
if (assetHolder.sound) return assetHolder.sound.paused;
|
|
84672
|
+
else return null;
|
|
84673
|
+
},
|
|
84674
|
+
set: function(value) {
|
|
84675
|
+
assetHolder.paused = value;
|
|
84676
|
+
if (assetHolder.sound) assetHolder.sound.paused = value;
|
|
84677
|
+
}
|
|
84678
|
+
});
|
|
84679
|
+
Object.defineProperty(assetHolder.proxy, 'position', {
|
|
84680
|
+
get: function() {
|
|
84681
|
+
if (assetHolder.sound) return assetHolder.sound.position;
|
|
84682
|
+
else return null;
|
|
84683
|
+
},
|
|
84684
|
+
set: function(value) {
|
|
84685
|
+
assetHolder.position = value;
|
|
84686
|
+
if (assetHolder.sound) assetHolder.sound.position = value;
|
|
84687
|
+
}
|
|
84688
|
+
});
|
|
84689
|
+
Object.defineProperty(assetHolder.proxy, 'duration', {
|
|
84690
|
+
get: function() {
|
|
84691
|
+
if (assetHolder.sound) return assetHolder.sound.duration;
|
|
84692
|
+
else return null;
|
|
84693
|
+
},
|
|
84694
|
+
set: function(value) {
|
|
84695
|
+
zogy("ZIM Aud - duration is read only");
|
|
84696
|
+
}
|
|
84697
|
+
});
|
|
84340
84698
|
return assetHolder.proxy;
|
|
84341
84699
|
}
|
|
84342
84700
|
}
|
|
@@ -84355,9 +84713,10 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
|
|
|
84355
84713
|
assetHolder.play = loaded.play;
|
|
84356
84714
|
assetHolder.type = "Sound";
|
|
84357
84715
|
assetHolder.src = loaded.src;
|
|
84358
|
-
assetHolder.item = loaded.item;
|
|
84716
|
+
assetHolder.item = loaded.item;
|
|
84359
84717
|
if (assetHolder.playParams) {
|
|
84360
84718
|
assetHolder.sound = assetHolder.play.apply(null, assetHolder.playParams);
|
|
84719
|
+
assetHolder.proxy.sound = assetHolder.sound;
|
|
84361
84720
|
if (assetHolder.volume != null) assetHolder.sound.volume = assetHolder.volume;
|
|
84362
84721
|
if (assetHolder.pan != null) assetHolder.sound.pan = assetHolder.pan;
|
|
84363
84722
|
assetHolder.sound.on("complete", function () {
|
|
@@ -85691,8 +86050,12 @@ ABSTRACT SOUND INSTANCE
|
|
|
85691
86050
|
The return result of the play() makes a CreateJS AbstractSoundInstance
|
|
85692
86051
|
var sound = Aud("sound.mp3").play(); // sound is an AbstractSoundInstance
|
|
85693
86052
|
// note: if lazy-loaded then the result of a play() before the sound has loaded
|
|
85694
|
-
// will be a proxy object with
|
|
85695
|
-
// methods, other properties and events will only be available on a play()
|
|
86053
|
+
// will be a proxy object with volume, pan, paused, position and duration properties and will dispatch a complete event
|
|
86054
|
+
// methods, other properties and events will only be available on a play() of the sound played after loaded
|
|
86055
|
+
// or if the sound is played before loaded, there will be a sound property added after loaded
|
|
86056
|
+
// that has the rest of the AbstractSoundInstance properties and methods
|
|
86057
|
+
// for instance, myLazyPlay.sound.muted or myLazyPlay.sound.stop()
|
|
86058
|
+
// If the sound were preloaded, then these would be myPreloadPlay.muted and myPreloadPlay.stop()
|
|
85696
86059
|
|
|
85697
86060
|
METHODS (of AbstractSoundInstance)
|
|
85698
86061
|
** full docs here: https://www.createjs.com/docs/soundjs/classes/AbstractSoundInstance.html
|