zimjs 16.2.8 → 16.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 +32 -7
package/package.json
CHANGED
package/src/zim.js
CHANGED
|
@@ -32,7 +32,7 @@ Node module - also see ES6 modules at https://zimjs.com/cdn
|
|
|
32
32
|
// Thanks to Karel Rosseel for proof-reading the site
|
|
33
33
|
// Thanks Ami Hanya and team for such prolific work with ZIM and all the suggestions
|
|
34
34
|
// Of course, thanks to all the ZIM users - it is always nice to hear from you
|
|
35
|
-
// at https://zimjs.com
|
|
35
|
+
// at https://forum.zimjs.com and https://zimjs.com/discord
|
|
36
36
|
// There are several dozen thanks through out the code as well - cheers!
|
|
37
37
|
|
|
38
38
|
// This is used for the build but in a browser would be
|
|
@@ -25696,6 +25696,7 @@ content - (default " ") optional content to be centered in one of three formats:
|
|
|
25696
25696
|
color - the color of the message
|
|
25697
25697
|
spacingH - horizontal space between the buttons
|
|
25698
25698
|
spacingV - vertical space between the content areas
|
|
25699
|
+
align - default CENTER, or use LEFT or RIGHT
|
|
25699
25700
|
backgroundColor - (default white) a css color for the background of the Pane
|
|
25700
25701
|
color - (default black) a css color for the text color of the Pane
|
|
25701
25702
|
width - (default AUTO) width of pane - AUTO will matches content width - see also autoPadding and autoPaddingH
|
|
@@ -26303,8 +26304,9 @@ content - (default null) optional content to be centered in one of three formats
|
|
|
26303
26304
|
color - the color of the message
|
|
26304
26305
|
spacingH - (default 20*buttonScale) horizontal space between the buttons
|
|
26305
26306
|
spacingV - (default 20) vertical space between the content areas
|
|
26307
|
+
align - default CENTER, or use LEFT or RIGHT
|
|
26306
26308
|
titleBar - |ZIM VEE| (default "PANEL") a String or ZIM Label title for the panel that will be presented on a titleBar across the top
|
|
26307
|
-
|
|
26309
|
+
Panel must have a titleBar - use a Pane or a Rectangle if a titleBar is not desired.
|
|
26308
26310
|
titleBarColor - |ZIM VEE| (default black) the text color of the titleBar
|
|
26309
26311
|
titleBarBackgroundColor - |ZIM VEE| (default "rgba(0,0,0,.2)") the background color of the titleBar
|
|
26310
26312
|
titleBarHeight - (default fit label) the height of the titleBar
|
|
@@ -36177,6 +36179,11 @@ NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set
|
|
|
36177
36179
|
|
|
36178
36180
|
EXAMPLE
|
|
36179
36181
|
const label = new Label("").pos(0,100,CENTER);
|
|
36182
|
+
|
|
36183
|
+
// The NumPad is built in to the Keyboard
|
|
36184
|
+
// To set the parameters, such as titleBar, use STYLE before making the Keyboard
|
|
36185
|
+
STYLE = {titleBar:"CALCULATE", align:CENTER};
|
|
36186
|
+
|
|
36180
36187
|
const keyboard = new Keyboard({
|
|
36181
36188
|
labels:label,
|
|
36182
36189
|
numPadScale:.75,
|
|
@@ -36193,7 +36200,7 @@ PARAMETERS
|
|
|
36193
36200
|
** supports OCT - parameter defaults can be set with STYLE control (like CSS)
|
|
36194
36201
|
advanced - (default false) set to true to add one more row of round brackets, exponential and percent or modulus
|
|
36195
36202
|
or set to "simple" to show only numbers, backspace and return
|
|
36196
|
-
titleBar - |ZIM VEE| (default "
|
|
36203
|
+
titleBar - |ZIM VEE| (default "NUMPAD") a String or ZIM Label title that will be presented on a titleBar across the top
|
|
36197
36204
|
titleBarColor - |ZIM VEE| (default black) the text color of the titleBar if a titleBar is requested
|
|
36198
36205
|
titleBarBackgroundColor - |ZIM VEE| (default "rgba(0,0,0,.2)") the background color of the titleBar if a titleBar is requested
|
|
36199
36206
|
titleBarHeight - (default fit label) the height of the titleBar if a titleBar is requested
|
|
@@ -36291,7 +36298,6 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
|
|
|
36291
36298
|
this.type = "NumPad";
|
|
36292
36299
|
|
|
36293
36300
|
var that = this;
|
|
36294
|
-
|
|
36295
36301
|
|
|
36296
36302
|
function ms(letter, color) {
|
|
36297
36303
|
if (zot(color)) color = mist;
|
|
@@ -68781,7 +68787,11 @@ dispatches a "moving" event if target is moving and "startmoving" and "stopmovin
|
|
|
68781
68787
|
if (container && container.backing) this.mousedownIncludes.push(container.backing);
|
|
68782
68788
|
// this.mousedownExcludes = mousedownExcludes;
|
|
68783
68789
|
if (zot(dampKeyup)) dampKeyup = .3;
|
|
68784
|
-
|
|
68790
|
+
|
|
68791
|
+
if (boundary && boundary.type!="Blob") {
|
|
68792
|
+
target.x = zim.constrain(target.x, boundary.x, boundary.x+boundary.width);
|
|
68793
|
+
target.y = zim.constrain(target.y, boundary.y, boundary.y+boundary.height);
|
|
68794
|
+
}
|
|
68785
68795
|
|
|
68786
68796
|
that.dampKeyup = dampKeyup;
|
|
68787
68797
|
this.dirX = 0;
|
|
@@ -83735,6 +83745,10 @@ var sound = Aud("sound.mp3").play(); // sound is an AbstractSoundInstance
|
|
|
83735
83745
|
|
|
83736
83746
|
METHODS (of AbstractSoundInstance)
|
|
83737
83747
|
** full docs here: https://www.createjs.com/docs/soundjs/classes/AbstractSoundInstance.html
|
|
83748
|
+
** these methods are on the results of a new Aud().play() not on the new Aud()
|
|
83749
|
+
const sound = new Aud();
|
|
83750
|
+
const soundInstance = sound.play();
|
|
83751
|
+
timeout(2, ()=>{soundInstance.stop()});
|
|
83738
83752
|
stop() - stops the sound and sets the time to 0
|
|
83739
83753
|
play() - plays the sound again - usually, the sound is already playing from the sound.play()
|
|
83740
83754
|
but if it is stopped - this will start it again
|
|
@@ -83751,6 +83765,10 @@ item - the CreateJS data item used for preload - available on complete event
|
|
|
83751
83765
|
|
|
83752
83766
|
PROPERTIES (of AbstractSoundInstance)
|
|
83753
83767
|
** full docs here: https://www.createjs.com/docs/soundjs/classes/AbstractSoundInstance.html
|
|
83768
|
+
** these properties are on the results of a new Aud().play() not on the new Aud()
|
|
83769
|
+
const sound = new Aud();
|
|
83770
|
+
const soundInstance = sound.play();
|
|
83771
|
+
timeout(2, ()=>{soundInstance.volume = .5});
|
|
83754
83772
|
paused - set to true to pause and false to unpause
|
|
83755
83773
|
muted - set to true to mute - but sound keeps playing or false to unmute
|
|
83756
83774
|
volume - the volume with 1 being the default
|
|
@@ -85594,6 +85612,7 @@ F.loadAssets(zimAudioSpriteData, "assets/");
|
|
|
85594
85612
|
F.on("complete", ()=>{
|
|
85595
85613
|
// will show tabs at top of stage - press to play audio
|
|
85596
85614
|
previewAudioSprite(zimAudioSpriteData, 2);
|
|
85615
|
+
S.update();
|
|
85597
85616
|
});
|
|
85598
85617
|
END EXAMPLE
|
|
85599
85618
|
|
|
@@ -85781,6 +85800,7 @@ content - the content to make - using one of three formats:
|
|
|
85781
85800
|
spacingH - horizontal space between the buttons (default 20xbuttonScale)
|
|
85782
85801
|
spacingV - vertical space between the content areas (default 20)
|
|
85783
85802
|
scrollBar - set to true if a default scrollBar is present in Window or a number if custom
|
|
85803
|
+
align - default CENTER, or use LEFT or RIGHT
|
|
85784
85804
|
maxWidth - (default null) pass in a maximum width to keep scale the content to
|
|
85785
85805
|
color - message color - also see color as property of content config object {}
|
|
85786
85806
|
|
|
@@ -85815,7 +85835,7 @@ RETURNS - a Label if a string or number is passed as content, a Container if a c
|
|
|
85815
85835
|
obj = new zim.Container();
|
|
85816
85836
|
var spacer = new Container(10,spacingV).addTo(obj);
|
|
85817
85837
|
if (data.header) data.header.pos(0,spacingV,"left","top",obj);
|
|
85818
|
-
if (data.message) var label = new zim.Label(data.message,
|
|
85838
|
+
if (data.message) var label = new zim.Label({text:data.message, color:zot(data.color)?color:data.color, align:data.align}).reg(LEFT,TOP).loc(0,obj.height+(data.header?spacingV:0),obj);
|
|
85819
85839
|
if (data.display) data.display.pos(0,-data.display.height-(data.header||data.message?spacingV:0),"left","bottom",obj);
|
|
85820
85840
|
if (data.buttons) {
|
|
85821
85841
|
if (!Array.isArray(data.buttons)) data.buttons = [data.buttons];
|
|
@@ -85836,6 +85856,8 @@ RETURNS - a Label if a string or number is passed as content, a Container if a c
|
|
|
85836
85856
|
bd.button.sca(data.buttonScale).loc((bb==0?0:buts.width+spacingH),0,buts).tap(function(e){e.target.call(e.target)});
|
|
85837
85857
|
}
|
|
85838
85858
|
}
|
|
85859
|
+
var bb = obj.getBounds();
|
|
85860
|
+
obj.setBounds(bb.x, bb.y, bb.width, bb.height);
|
|
85839
85861
|
for (i=0; i<obj.numChildren; i++) {
|
|
85840
85862
|
var o = obj.getChildAt(i);
|
|
85841
85863
|
o.lastY = o.y;
|
|
@@ -85847,6 +85869,9 @@ RETURNS - a Label if a string or number is passed as content, a Container if a c
|
|
|
85847
85869
|
}
|
|
85848
85870
|
if (maxWidth && typeof maxWidth == "number") obj.width = Math.min(obj.width, maxWidth-spacingH*2-(data.scrollBar===true?12:data.scrollBar>0?data.scrollBar:0));
|
|
85849
85871
|
new zim.Container(10,spacingV).pos(0,-spacer.height,"center","bottom",obj).bot();
|
|
85872
|
+
|
|
85873
|
+
obj.setBounds(null); // make spacer in bottom adjust bounds
|
|
85874
|
+
|
|
85850
85875
|
spacer.top();
|
|
85851
85876
|
obj.config = data;
|
|
85852
85877
|
obj.header = data.header;
|
|
@@ -91133,4 +91158,4 @@ export let Ticker = zim.Ticker;
|
|
|
91133
91158
|
export let Style = zim.Style;
|
|
91134
91159
|
export let assets = zim.assets;
|
|
91135
91160
|
export let assetIDs = zim.assetIDs;
|
|
91136
|
-
export let ZIMON = zim.ZIMON;
|
|
91161
|
+
export let ZIMON = zim.ZIMON;
|