zimjs 16.2.9 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/zim.js +19 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zimjs",
3
- "version": "16.2.9",
3
+ "version": "16.3.0",
4
4
  "type": "module",
5
5
  "main": "./src/zim.js",
6
6
  "types": "./ts-src/typings/zim",
package/src/zim.js CHANGED
@@ -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
- Pannel must have a titleBar - use a Pane or a Rectangle if a titleBar is not desired.
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
@@ -83743,6 +83745,10 @@ var sound = Aud("sound.mp3").play(); // sound is an AbstractSoundInstance
83743
83745
 
83744
83746
  METHODS (of AbstractSoundInstance)
83745
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()});
83746
83752
  stop() - stops the sound and sets the time to 0
83747
83753
  play() - plays the sound again - usually, the sound is already playing from the sound.play()
83748
83754
  but if it is stopped - this will start it again
@@ -83759,6 +83765,10 @@ item - the CreateJS data item used for preload - available on complete event
83759
83765
 
83760
83766
  PROPERTIES (of AbstractSoundInstance)
83761
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});
83762
83772
  paused - set to true to pause and false to unpause
83763
83773
  muted - set to true to mute - but sound keeps playing or false to unmute
83764
83774
  volume - the volume with 1 being the default
@@ -85602,6 +85612,7 @@ F.loadAssets(zimAudioSpriteData, "assets/");
85602
85612
  F.on("complete", ()=>{
85603
85613
  // will show tabs at top of stage - press to play audio
85604
85614
  previewAudioSprite(zimAudioSpriteData, 2);
85615
+ S.update();
85605
85616
  });
85606
85617
  END EXAMPLE
85607
85618
 
@@ -85789,6 +85800,7 @@ content - the content to make - using one of three formats:
85789
85800
  spacingH - horizontal space between the buttons (default 20xbuttonScale)
85790
85801
  spacingV - vertical space between the content areas (default 20)
85791
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
85792
85804
  maxWidth - (default null) pass in a maximum width to keep scale the content to
85793
85805
  color - message color - also see color as property of content config object {}
85794
85806
 
@@ -85823,7 +85835,7 @@ RETURNS - a Label if a string or number is passed as content, a Container if a c
85823
85835
  obj = new zim.Container();
85824
85836
  var spacer = new Container(10,spacingV).addTo(obj);
85825
85837
  if (data.header) data.header.pos(0,spacingV,"left","top",obj);
85826
- if (data.message) var label = new zim.Label(data.message, null, null, zot(data.color)?color:data.color).loc(0,obj.height+(data.header?spacingV:0),obj);
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);
85827
85839
  if (data.display) data.display.pos(0,-data.display.height-(data.header||data.message?spacingV:0),"left","bottom",obj);
85828
85840
  if (data.buttons) {
85829
85841
  if (!Array.isArray(data.buttons)) data.buttons = [data.buttons];
@@ -85844,6 +85856,8 @@ RETURNS - a Label if a string or number is passed as content, a Container if a c
85844
85856
  bd.button.sca(data.buttonScale).loc((bb==0?0:buts.width+spacingH),0,buts).tap(function(e){e.target.call(e.target)});
85845
85857
  }
85846
85858
  }
85859
+ var bb = obj.getBounds();
85860
+ obj.setBounds(bb.x, bb.y, bb.width, bb.height);
85847
85861
  for (i=0; i<obj.numChildren; i++) {
85848
85862
  var o = obj.getChildAt(i);
85849
85863
  o.lastY = o.y;
@@ -85855,6 +85869,9 @@ RETURNS - a Label if a string or number is passed as content, a Container if a c
85855
85869
  }
85856
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));
85857
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
+
85858
85875
  spacer.top();
85859
85876
  obj.config = data;
85860
85877
  obj.header = data.header;