ZIM DOCS - UPDATES DOCS
This document lists the changes to ZIM from version to version.
The code that matches these changes can be found on GIT HUB.
BREAK is highlighted below if you will need to change an app when updating it to the new ZIM.
This happens if a parameter position is changed (new parameters might be placed next to related parameters)
or if a method is removed and a replacement property added, etc.
Breaks are kept to a minimum but in "later" parameter cases, ZIM DUO is often used so order is less important
Shifts in names and functionality are also more common in recently added features.
RECOMMENDATION: just leave any finished apps with the version of ZIM that was used at the time
unless you see an IMPROVEMENT that will help your app - then make sure you test after upgrading!
ZIM 9.2.0
PEN
https://zimjs.com/pen.html
Handles dynamic drawing with a set of different penTypes
You can drag() or gesture() pen, move it with a MotionController(),
animate() it, animate() it along a Squiggle or Blob path, etc.
Holding down the CTRL key will allow the pen to move without drawing
LABELONPATH
https://zimjs.com/explore/labelonpath.html - thanks KV for the request!
Makes a label along a path of a Squiggle or Blob - which can be interactive, fixed, toggled or hidden
A list of percentages for where the letters are can be provided to move around letters
TOGGLE
https://zimjs.com/explore/toggle.html - thanks Andi Erni for the idea and code start.
Added a Toggle() component after the RadioButtons
Parameters: width, height, label, startToggled, backgroundColor, margin, indicatorType, indicatorColor, toggleBackgroundColor,
color, borderColor, borderWidth, corner, indicatorCorner, shadowColor, shadowBlur, time, labelLeft, style, group
Gives a change event and check the toggled (or selected) property - works with STYLE and Accesibility
LIST
https://zimjs.com/explore/list.html
https://zimjs.com/explore/listObjects.html
Added a ZIM List component for a vertical or horizontal list of items - thanks Andi Erni for the prompting
This is really a zim.Tabs object inside a zim.Window object.
The list can be strings, numbers or Label objects and these are added to Tabs buttons.
The list can also include any DisplayObject with bounds (which most ZIM objects have except a Shape needs bounds set manually with setBounds()).
If the object is not a string, number or Label then selection will not highlight and currently animateTo() may not work if size is different.
Items can be added or removed from the list with addAt() and removeAt()
You can animateTo() and index as well - not working properly yet for when custom objects are in the list
BUTTON AND TABS - IMPROVEMENT
https://zimjs.com/explore/verticalTabs.html
Added align, valign, indent, indentHorizontal, indentVertical parameters to end of Button and Tabs
BREAK - added a vertical parameter to Tabs just before spacing set to true to make vertical tabs
BREAK - flatBottom parameter of Tabs is changed to base with default "none" when no corner or corner is an array
and more values of "bottom" (default when corner and not vertical), "left" (default when corner and vertical), "top", "right"
corner will then be the opposite corners to the base
Fixed currentSelected to not show selected value - got lost in color / backgroundColor change over
BREAK - removed flatBottom from Rectangle as corner is now configurable with Array and Tabs use base rather than flatBottom
Note - this breaks any traditional parameter order pointing to dashed.
Added labelIndent, labelIndentHorizontal, labelIndentVertical parameters to Tabs
**** Added change() and noChange() chainable method to capture change events on components
FLATBOTTOM - REMOVED - BREAK
The flatBottom parameter has been removed as corner now accepts an array and Tabs use base for more flexible horizontal vertical arrangement
So the parameter order of Rectangle, Button and Loader from dashed on has been changed
IMPROVEMENT MOUSE POSITION ON TOUCHSCREEN
USE Mouse Event Object: e.stageX AND e.stageY - NOT stage.mouseX and stage.mouseY - these last two do not work with touch screen.
We have 100 places where we get mouse positon and almost all are working fine.
But we missed one for the initial point down for dragging with slide - this has been fixed
Went through docs and fixed all examples using stage.mouseX, etc.
Fixed minor places in Stepper and Parallax as well.
GENERAL FIXES
Added default particles to Emitter.
IMPROVEMENT - Squiggle and Blob when animating rotation of points now adjusts animation along path correctly - for animated paths (interactive was fine)
BREAK - Indicator parameters have changed to foregroundColor, backgroundColor (for not selected) and backdropColor for the backdrop (which is often left out)
The background property has been changed to backdrop. Pane and Tabs also have a backdrop - it is the background behind the background ;-)
So the layers are selectedColor (font), color (font), foregroundColor, selectedBackgroundColor, backgroundColor, backdropColor - sigh.
Added onTop and interactive properties to Squiggle and Blob
Added a getAngle parameter to Squiggle and Blob getCurvePoint() and the CODE module pointAlongCurve() function
These now return an angle at point property along with x, y, etc.
Fixed a bug in pos() when bounds set to negative x and y
Made align:"middle" work as well as align:"center" on label
Adjusted ColorPicker to accept borderWidth and borderColor styles - for color rectangles or circles
Added borderColor and borderWidth styles for Tabs
Fixed glitch in Swiper to work properly with stage as the swipeOn parameter.
Fixed glitch in MotionController introduced in 9.1.0 with accelerator (put brackets around ternary when used in calculation)
BREAK - changed mouseDownIncludes parameter and property of MotionController to mousedownIncludes.
Added target automatically to mousedownIncludes in MotionController - this can be removed from the property array if not desired
Fixed flip vertical problem with MotionController - now points the right way! We suspect hackers.
Added a clear() method to ZIM Dictionary()
BREAK - adjusted Label to not automatically center on a backing (by default there is no backing)
backing is added when you add a custom backing DisplayObject
The Label now will align and valign properly on a backing with padding - as opposed to automatically centering.
BREAK - changed CheckBox check property to indicator and color to indicatorColor
BREAK - changed RadioButton dots property to indicators
Adjusted margin on CheckBox to be closer to CheckBox when set to 0 (inline with RadioButtons and new Toggle)
Adjusted the right hand and bottom margin of RadioButtons a little.
BREAK for objects with outline(), changed toggle() and toggled to outlineToggle() and outlineToggled so as to not conflict with other toggle() and toggled methods and properties
Fixed talk() for Accessibility - talkTag.setAttribute("aria-hidden", !_aria); seemed to be making it not work anymore?
Added Toggle to Accessibility
Added wait time to sequenceWait call - was taken out during wait updates
Fixed a bug in running a Sprite backwards and not ending at 0 - thanks Alex Gopher for the find.
ZIM 9.1.2
SQUIGGLE AND BLOB UPDATES
Added an interactive parameter to Squiggle and Blob to quickly turn off controls, drags, selects, etc.
This leaves just the shape and should be set to false when not needing to interact with shape
Added pointControls and pointCircles properties to Squiggle and Blob to access these arrays directly
Before we had to go through pointObjects[0][0] to get to control container and pointObjects[0][1] to get to circles
Animation should be done on the pointControls but immediate placement should be done on the pointCircles
This is because when dragged, the circle is moved but the control is left in place until mouseup
Added a transformPoints() function in the Code module to scale, rotate or position points in a Squiggle or Blob format
Added a transformPoints() method to Squiggle and Blob that use the transformPoints function to change their points
This allows you to scale or rotate Squiggle or Blob points without affecting their control points or stroke thickness
https://zimjs.com/explore/scalepoints.html
EXAMPLE
// Transform the original points of a Blob
// If you rotate or scale, this affects the control points - the little rectangles rotate or they scale
// To avoid this, the points themselves can be transformed (scaleX, scaleY, scale, rotation, x, y)
// This makes a square and scales it bigger without affecting control size or stroke size (if there were a stroke)
// Note the default number of points is 4 but they are arranged at the top, bottom and sides - so would make a diamond with just controlType:"none"
new Blob({controlType:"none"}).transformPoints("rotation", 45).transformPoints("scale", 2).center();
END EXAMPLE
Fixed a glitch when unpausing a dragged object along a path
Made objects follow a Squiggle or Blob path as the path is being moved or manipulated IMPROVEMENT (although also patched in ZIM 9.1.0)
This results in a better experience when editing live animations
EMITTER
Adjusted Emitter to work if not added to stage or parent.
Changed Emitter pause() and paused to pauseEmitter() and emitterPaused - to not conflict with animate() pause() and paused
as sometimes we animate the Emitter. BREAK
SERIES
Made series() hold just regular parameters or a single parameter of an array.
series(red, green, blue) is now the same as series([red, green, blue])
LABEL IMPROVEMENT
Added a "baseline" value for valign parameter of Label that puts the registration of text at the baseline
Added labelWidth and labelHeight parameters to Label - use them both to override font size and fit text to dimensions provided.
https://zimjs.com/explore/text.html Thanks Ami Hanya for the prompting!
labelHeight on its own does nothing. labelWidth on its own is the same as lineWidth - it will wrap a the provided value.
ZIM 9.1.0
MULTIPLE SELECT SQUIGGLE AND BLOB POINTS WITH DRAG AND ARROW CONTROL
Try it out at https://zimjs.com/explore/multipleSelect.html
Added select and multiple select (with CTRL key) to Squiggle and Blob. IMPROVEMENT
Selected control point circle and handles can be dragged or moved with arrow keys.
Shift arrow key moves 10 pixels at a time.
Changed the CTRL click to SHIFT click for removing an existing point BREAK
Added a single undo (for now) for adding or removing control points
Added Squiggle and Blob to the KEYFOCUS
Added selectColor (string) and selectPoints (boolean) parameters before editPoint BREAK
Added SelectionSet and SelectionManager to the Controls Module
See https://zimjs.com/explore/selectionTest.html
Adjusted zog() and zta() to not show if zon (comments on) is set to false before ZIM is loaded. Thanks Ami for the prompting.
Fixed Sprite() run() so that call:function(target){} receives the target properly if no params are passed. Thanks Chris for the find!
Adjusted the MotionController to accept the container in the mouseDownIncludes - previously only children of the container were eligible. Thanks Alicia for the find!
Replaced all frame.color with just color as these are now stored on ZIM - this helps DISTILL run without Frame.
frame.color will still work.
Tidied up dblclick cycle colors in Squiggle - when adding new point was using Blob defaults. IMPROVEMENT
ZIM NIO (9) ~ added 11k
Mini-site: https://zimjs.com/nio/ that demonstrates new features - here is a summary:
animate() - convenience props: path, orient, flip, flipVertical, zoom, speed, layer, fade, extra
animate() - parameters: dynamic, drag, clamp, startPaused
animate() - properties added to target: percentSpeed, percentComplete
animate() - methods added to target: paused() - to support Accelerator()
Accelerator() - now accepts targets with dynamic animation
MotionController() - now accepts an Accelerator as a target
** more details below
PIZZAZZ 4 - Blob and Squiggle shapes and animation path shapes
https://zimjs.com/nio/paths.html
DOCS - CUSTOMIZE
Added a TOP link to the search area
Added a Customize link to a tool to make a list of items used in your ZIM code
https://zimjs.com/customize.html
These will make various sets of links that will feature these items
https://zimjs.com/docs.html?item=Circle - opens Circle docs.
https://zimjs.com/docs.html?items=Button,Dial,Emitter - shows Feautured Items.
DYNAMIC AND PATH ANIMATIONS - IMPROVEMENT - Thanks Andi Erni and others for the promptings!
The speed of animations can be controlled with the percentSpeed property on the target
Animations can be combined in an Accelerator to control all at once
(along with Dynamos (dynamic Sprites) and Scrollers)
Accelerators can be controlled with a MotionController (or techniques below)
percentSpeed also works with Slider, Dial, Stepper, Swiper and Parallax
percentSpeed also can be added to wiggle or animate
Animations can also be scrubbed with the percentComplete property on the target
percentComplete works with Slider, Dial, Stepper, Swiper and Parallax
percentComplete also can be added to wiggle or animate
Animation along a path (Blob or Squiggle) supports dynamic animation
Objects can now be dragged along a path - see DRAG below
PERCENTSPEED
Added dynamic parameter to animate().
Set dynamic to true to be able to change the speed of the animation
with the percentSpeed property of the target object.
See https://zimjs.com/nio/speed.html
Adjusted Accelerator so it accepts any object with a percentSpeed
including an object that is being dynamically animated.
Added a clamp parameter to animate() to limit dynamic animations to edges of their times
otherwise time can go well beyond and take just as long to reverse to active animation time range
See https://zimjs.com/nio/controls.html
Adjusted MotionController so if an Accelerator is passed in
the MotionController operates percentSpeed rather than x and y
in any of its types - mousemove, keydown, gamestick, etc.
PERCENTCOMPLETE
Added percentComplete property to any object being animated.
Setting this gives manual control for instance with a Slider, Dial, mouse position, Parallax, etc.
http://zimjs.com/nio/parallax.html
FLIP
In addition to orient, there is now flip and flipVertical convenience props for animate()
set these to true to flip the target with scaleX and scaleY depending on direction
http://zimjs.com/nio/flip.html
DRAG
Added a drag parameter to animate() that lets you drag path animations
Set startPaused to true to pause the animation and drag or drag a moving animation.
Added a redirect convenience property to the props object.
This defaults to true so that drag will alter the direction of the animation IF rewind is set
Set this to false to not alter the direction - you can still drag backwards
but when you let go, it will go in the direction the animation was going
http://zimjs.com/nio/drag.html
ZIM NIO EXTRA! - IMPROVEMENT
EXTRA! provides animation based on animation.
This allows for setting zoom, depth, speed, fade, etc. based on target y value while animating on a path
but EXTRA! also opens up endless possibilities as the input and output does not have to be the target.
This means that animation can also control properties of other objects
and other object properties can control the animation.
http://zimjs.com/nio/extra.html
There is a general and full format for EXTRA! but convenience properties are also provided.
These primarily help with depth while animating along a path (Squiggle or Blob) or just a straight line with x and y.
ZOOM, SPEED, LAYER, FADE
Added zoom, speed, layer and fade convenience properties to animate props
These accept an array of values - [inputMin, inputMax, outputMin(default 0), outputMax(defaunt stageH)]
zoom:[.5,1.5] will scale the target to .5 if its location is at 0 and 1.5 if at stageH and then proportionally in between
speed:[50,100] will make the animation play at a slower speed the higher the target is on the stage
layer:[0,10] will make the target change layers from the bottom to the top if animated along the y from y=0 to y=stageH
fade:[0.5,1] will make the alpha fade as the target recedes to the back (top of the stage)
This will help with depth animation to make things farther away animate more slowly
and give the ability to animate around an object depth-wise.
EXTRA
In addition to the convenience properties above, ZIM EXTRA! has a more general and complete format:
Pass in a single EXTRA! object or an array of EXTRA! objects: extra:{} or extra:[{},{},{}]
The object has the following properties - all are optional except the outputProp which is required:
|ZIM VEE| - each object below optionally accepts a ZIM VEE value for zik() to pick randomly from
inputObj - (default target) - the object with the input property - probably the animation target but could be any object
inputProperty - (default "y") - a string of the property name for the input - "x", "rotation", etc.
inputMin - (default 0) - the minimum input value for the calculation - also see constrain
inputMax - (default stageH) - the maximum input value for the calculation - also see constrain
outputObj - (default target) - the object whose output property is being changed - probably the animation target but could be any object
outputProp - (default "scale") - a string of the property name of the output - "scale", "layer", "rotation", etc.
outputMin - (default 0) - the minimum output value for the calculation - also see constrain
outputMax - (default 1) - the maximum output value for the calculation - also see constrain
factor - (default 1) setting factor to -1 will reverse the direction of the animation
outputRound - (default false) set to true to receive rounded output values
constrain - (default true) constrain the output value to outputMin and outputMax
set to false to let values go beyond provided mins and maxes
this is quite usual when a proportion is easily figured at a certain range
and continued increase or decrease is desired outside the range - just turn constrain to false.
EXAMPLES:
extra:{outputProp:"scaleX"} would animate the scaleX of the target from 0-1 over the stage height
extra:{outputObj:circle, outputProp:"alpha"} would animate the alpha of circle based on the animated target's y position
extra:{inputObj:circle, inputProp:"x", inputMax:stageW, outputProp:"level"} would animate the target's child index as the circle's x goes across the screen
** in the last two examples, circle is a different object than the target of the animation - circle might be animating independently or based on a Slider value, etc.
CORNER
Modified all corner properties to accept an Array [topLeft, topRight, bottomRight, bottomLeft]
new Button({corner:[20,20,20,0]}).center();
https://zimjs.com/nio/corners.html
TAP
An chainable tap(call, distance, time, once) method has been added to all DisplayObjects along with a noTap() method
This acts like a traditional click where you down up without moving the mouse (within the distance parameter)
This is handy too as the methods are chainable. The callback function will receive the traditional event object
HOV
Added a short chainable method hov(value, prop) to change the value of a hovered object
By default this is the alpha if a number is passed or the color if a string is passed
new Circle().center().cur().alp(.5).hov(.8).tap((e)=>{e.target.color = red; stage.update();});
GENERAL
Added interpolate and percentage parameters to closestPointAlongCurve()
That returns either a closest interpolated point
or the percent along a path such a point would be - used by drag parameter in animate.
Added damp parameter to Slider and Dial
use with Ticker rather than "change" event - eg:
Ticker.add(function () {circle.x = slider.currentValue;});
Fixed Stepper clone - was missing new color (for text color) parameter
Updated segmentPercents to segmentRatios
to keep all percents 0-100 and all ratios 0-1
Fixed pos() to position properly inside rotated and scaled bounds
had been using boundsToGlobal() should have been using getTransformedBounds()
Fixed thickness now being cloned properly in Squiggle
Removed labelColor and labelOffColor from Tabs as these were replaced by color and offColor - BREAKS parameter order after corner
Adjusted Tabs and Pad color and rollColor of "selected" tab to be colorOff rather than color when currentSlected is false
Adjusted Tabs and Pad so if currentSelected is false, the current selected button does not loose its rollover when pressed
All control objects now have a type property that gives the class name as a string - DisplayObjects already have this
Added pane and textArea properties to Blob and Squiggle to refer to the recordPoints Pane and its TextArea - helps to add interface to popup if desired
like to let user modify point details and submit back to app.
BREAK - changed Window titleBarColor to titleBarBackgroundColor and added a titleBarColor for the text color
Fixed glitch in title bar when not draggable - letting you click through to content - no longer does this
Added size property to Label to change font size after creation - thanks Ami Hanya for the prompting
Welcome to ZIM NIO - fresh on the heels of ZIM OCT - which brought STYLE and cool Tile updates and more!
TypeScript has been updated, code page, Examples page, front page logo, Distill, Bubbling videos, Templates are updated.
Blog to come, social media to come, etc.
ZIM 8.3.0
Added loc() chainable method
pos() no longer positions the registration point unless the reg parameter is set to true
So loc() will position the registration point at loc(x, y)
and default to add to stage, or choose some other container or add at index, etc.
BUT alternatively, loc can also accept any object with an x and y property as its first parameter
This could be another Display Object or a zim Point(100, 100) or an object literal {x:100, y:100}, etc.
When the first parameter is a Display Object, obj.loc() will put its obj at the same place (registration wise) as the Display Object.
This will default to set localToLocal true for exact match - there is a localToLocal parameter if this is not desired.
So... loc() acts just like the old pos() with the option to obj.loc(displyObject) to easily match positions
Currently there is no loc style - it is easier to use x and y styles
as in x:10, y:10 rather than loc:{x:10, y:10}
PATH IMPROVEMENT
https://zimjs.com/explore/squiggleAnimate.html
Added animation along the path with ZIM animate - the following props are added:
path - pass in a Blob or Squiggle to animate along path
this is dynamic so if the Blob or Squiggle changes, the animation will change
if Blob or Squiggle has lockControls = false, then it is not dynamic
if a set path is desired, then lockControls to save processing
https://zimjs.com/explore/blobAnimate.html
orient - an object to rotate the target towards
if path is being used, orient defaults to orient along the path
can set to false for no rotation
can set to any object with an x, y point such as a circle on the stage - or {x:0, y:0} or a new zim Point, etc.
the target will then rotate to face the specified location
https://zimjs.com/explore/blobAnimate2.html
BLOB and SQUIGGLE
IMPROVEMENT Added click blob to add control point and ctrl click point to remove a control point
https://zimjs.com/explore/blobAdd.html
Added an editPoints parameter that defaults to true for the above - or set to false to not add and remove control points
gave Blob and Squiggle controls a num property that matches their points array position
Fixed a glitch when setting points property that was introduced in 7.4.0 where we started using the Container's dispose
IMPROVEMENT Added proper color to handle rectangles when using Blob changeControl
Added segmentPoints and segmentPercents properties to Blob and Squiggle
Added getPointAngle(), getSegmentPoint(), getCurvePoint() methods to Blob and Squiggle
Added pointAlongCurve, distanceAlongCurve, closestPointAlongCurve functions to Code module
IMPROVEMENT Blob and Squiggle now persists even with a changed number of points
Added update event to blob and squiggle for when number of points change
All events on Blob will now be kept but any custom events on the shape or controls will need to be recreated
as the shape and controls are now different objects. So capture the update event and remake your events.
Any events on the shape or the controls will be removed before the objects are replaced with new ones.
Fixed width and height parameters of Bitmap - they were not working since style update in zim 8. Fixed now.
Adjusted centerReg() to add to different container than the current container when a different container provided
Adjusted Keyboard cursor to properly center if Label has background
ZIM 8.2.0
ZIM KIDS
A new section of ZIM has been added called KIDS https://zimjs.com/kids.html
It treats coding as magic and presents the docs as spells ;-)
There is a basic code writeup https://zimjs.com/magic.html
There are currently four workshops with three levels each
The workshops let you see the commented code and type live in the browser
Please spread the word! Obviously, ZIM is not just for kids - but it is a great way to start!
COLOR RANGES AND ANIMATED COLORS - IMPROVEMENT
Added a colorRange(color1, color2, ratio) function to Code module
Added setColoRange(color1, color2) method to ZIM Label and shapes (Circle, Rectangle, Triangle, Squiggle, Blob)
Passing one parameter will set range from current color to the color specified in the parameter
Added colorRange property to ZIM shapes with values from 0-1.
This value will set the color of the object
to the color in the range matching the ratio - this can be used to wiggle the color
Added a color convenience property to animate() that runs the colorRange system
This allows you to animate from one color to another - including rewind, loop, from, wait, etc.
new Circle(100, red).animate({color:blue}, 1000);
Note - does not work with an animation series - use animate() in a call for a series of color changes
Thanks Jade for the prompting! See example http://zimjs.com/explore/animatecolors.html
ZIM now overrides Bitmap.clone() to provide a chainable clone like for Container, etc.
This also will clone the bitmap width and height by default
Usually, Bitmaps do not need to be cloned but to apply a filter they do:
http://zimjs.com/explore/mask.html
And to grab the color at a point they do:
http://zimjs.com/explore/pixels.html
Made MotionController mousedown and pressmove types not trigger if mouse down on an object
Objects with mouseEnabled of false do not count.
Added "toRGB" as a toColorType value.
Added empty containers with 0 bounds to any null Tile() elements (actually patched 8.1.0)
Fixed a few "use strict" issues in ZIM - thanks Bjorn Brockschmidt for the finds
placeReg(obj) - now returns obj for chaining (as does place())
Fixed resetBounds() to return object - was returning this, when meant return obj.
Also, since the last setBounds() update, resetBounds was not resetting if no parameters were passed.
Added a stickColor parameter and property to Squiggle and Blob
ZIM 8.1.0
BREAK Changed the currentTarget parameter of drag() to all (default false)
container.drag() - will drag individual items in the container
container.drag({all:true}) - will drag the whole container
currentTarget has been added back to the end of the parameters
for backwards compatibility when using the ZIM DUO configuration objects.
Added a DRAGALL constant that defaults to false - set this to true to make drag() drag the whole container by default
Adjusted Window so titleBar is included in height - possible minor BREAK - thanks Ami Hanya for the find
Removed zim clone method from Stage and StageGL - also fixed copy() trying to clone stage
Added moon color = #ddd
BREAK Adjusted center() and centerReg() to not add to container if already in container (was bringing up to top - now will not)
POS - IMPROVEMENT / BREAK
Inserted right and bottom parameters before the container parameter
The container now automatically defaults to the default frame's stage (or existing parent)
** previously positioned only registration point
** now positions based on sides, top or bottom unless reg is set to true
By default, will position left and top of object - can also position right or bottom
Setting reg (or regX, regY) to true will position to the registration point
x - (default 0 or the current x) the x distance in the container to the left or right side of the object
which side, depends on the right parameter
if reg or regX is true then it is the distance to the registration point not the side
y - (default 0 or the current y) the y distance in the container to the top or bottom of the object
which one, depends on the bottom parameter
if reg or regY is true then it is the distance to the registration point not the top or bottom
right - (default false) set to true to postion the right side from the right of the container bounds
if reg or regX is true then it is the distance to the registration point not the side
bottom - (default false) set to true to postion the bottom of the object from the bottom of the container bounds
if reg or regY is true then it is the distance to the registration point not the bottom
container - (default current container or zimDefaultFrame stage) the Container to add the obj to and position
index, add are the same as before
reg - (default false) set to true to position to the registration point rather than sides, top or bottom
regX - (default reg) set to true to position x to the registration point rather than the sides
will override reg if provided
regY - (default reg) set to true to position y to the registration point rather than the top or bottom
will override reg if provided
Also added pos to STYLE:
STYLE = {
type:{
Rectangle:{
add:true,
// all rectangles will default to a right position of 100, 300 or 500 randomly
pos:{right:true, x:[100,300,500]}
// also corner convenience values: "left", "right", "top", "bottom", "rightbottom" or "bottomright", "center" and "centerReg"
// pos: "right", // send to right
}
}
}
Added a POSREG constant that defaults to false.
Set this to true to change pos() to default to positioning the registration
This will be handy in transition - and who know, maybe you like the old way better.
TILE - IMPROVEMENT - Layouts
See https://zimjs.com/tile.html
Added features to Tile to make it very versatile (haha) in laying out non-scaled content
So, moved Tile to above Layout in the Pages, Layout, Accessibility area
Added width, height, compressionH, compressionV parameters after spacingV in Tile() - BREAK
These handle spreading the tiles out over a width or height and various compressions
This is similar to Layout but does not scale the content so much simpler calculation ;-)
Added resize(w,h) and remake(items) methods
Added a bunch of properties (matching parameters) to make the Tile more dynamic
These can be changed and then resize() called.
Added items property (Array) that can be updated with new items or different items (less, more, etc.).
cols, rows, and items can be changed and then remake() run.
Thanks Ami Hanya for the prompting - this will be very handy
MOTION CONTROLLER - IMPROVEMENT
Added pressmove type to MotionController - good for dynamic drawing with easing - default damp is .2
Added a mousedown event for mousedown and pressmove types
Added moving, startmoving and stopmoving events
Added a mouseMoveOutside parameter that defaults to false
Set to true to let mouse motion outside the stage affect motion
BREAK Changed rect parameter to boundary
and added a boundary property for dynamic boundary adjustment - thanks Andi Erni for the suggestion
BREAK - moved the container parameter to near the end and made it default to the zimDefaultStage
Updated CDN, GitHub, Templates, Distill, Code page, Docs, TypeScript,
Todo: Slack, Facebook, Twitter, Blog
ZIM OCT (8) ~ added 16k
STYLE
Replaced DEFAULTFONT with a general STYLE system. IMPROVEMENT
STYLE can be used to set any parameter on a DisplayObject.
For instance: Circle, Blob, Button, Pane, Bitmap, Sprite, etc.
These are applied at the time the objects are made.
They are cascading with each level overriding the previous level:
1. GENERAL: any style can be specified in general
corner:30 will make all corners default to 30
2. TYPE: styles for object type can be set to override the general styles
Button:{corner:0} will make all button corners default to 0
3. GROUP: styles for a group can be set to override the type styles
homePage:{corner:20} will make all objects of that group default to 20
4. OBJECT: styles applied as parameters to the object override all other styles
new Button({corner:40}) will make this button have a corner of 40
STYLE = {
corner:20,
backgroundColor:pink,
type:{
Button:{width:{min:100, max:500}, corner:0, centerReg:true, move:{y:series([-150, -50, 50, 150])}},
Dial:{add:true, x:800, y:600, backgroundColor:red, scale:2, outline:true},
Pane:{corner:ignore, color:white, draggable:true, width:300, label:"HI!"},
ProgressBar:{add:true, x:200, y:600, barType:"rectangle", transform:true},
Tabs:{add:true, x:100, y:100}
},
group:{
homePage:{corner:30}
}
}
new Button(); // will have a corner of 0 and be pink
new Button({group:"homePage"}); // will have a corner of 30 and be pink
new Button({corner:10, group:"homePage"}); // will have a corner of 10 and be pink
new Button({corner:"ignore"}) // will have a corner of its default 20 and be pink
new Button({style:false}).pos(700,100,stage); // will have original default styles
new Dial(); // will be red and scaled twice as big and have an outline
new Tabs(); // will have a corner of 20 and selection will be pink
var p = new ProgressBar({corner:15}); // will be a bar with transform tools, corner 15
p.percent = 25;
new Pane().show(); // will ignore corner 30 and use its original 20 - it will say HI! in white and be draggable
STYLE = {
borderColor:dark,
borderWidth:5,
type:{
Rectangle:{
// color:red,
color:[red, pink, purple], // pick a random color from here
centerReg:true,
animate:{props:{rotation:360}, time:500, ease:"linear", loop:true},
move:{x:series([-200, 0, 200])}
}
}
}
// make three spinning rectangles
loop(3, function(){new Rectangle();});
See: https://zimjs.com/style.html for an example
TRANSFORM STYLES
Transformations can also be applied (all are numbers - visible is a Boolean):
x, y, rotation, alpha, scale, scaleX, scaleY, regX, regY, skewX, skewY, visible
a bounds style has a value of {x:Number, y:Number, width:Number, height:Number}
where x and y are optional
RANDOM, RANGES, SERIES, FUNCTIONS
Any property value can be a ZIM VEE value to make use of ZIM zik (pick)
color:[red, green, blue] will pick a random color for each object for which the style is applied
x:series([100,200,300]) will place subsequent objects at these locations
width:{min:100, max:500} will make objects with a width within this range
See Docs on ZIM zik() and ZIM series() for more information
FUNCTION STYLES
The following functions have been added:
addTo, center, centerReg, transform, drag, gesture, outline, mov, animate, wiggle
Values of true will give default functionality for all but mov, animate and wiggle
ZIM DUO configuration objects can be set as a value for any of these
example: drag:true; or drag:{onTop:false}
For animate and wiggle, [] can be put around multiple configuration objects
to wiggle in the x and y for instance or run multiple animate calls on the object
CONVENIENCE STYLES
add:true - has been provided to add to the stage (use addTo for other containers)
move:{x:value, y:value} or move:x - mirrors the mov Function style (just adding the e)
style:false - will turn off all styles for the selector
EXCLUSION
A value of ignore can be used to exclude any earlier styles and return to the original default.
ignore is a ZIM global variable - if zns is true then use zim.ignore or just "ignore".
Setting style:false will exclude the object from all styles
All DisplayObjects have a style parameter (default true). Set to false to ignore styles.
GROUPS
All DisplayObjects have a group parameter.
This parameter accepts a string or a comma delimited string of multiple groups.
The group of components can then be targeted in the Group section of STYLE.
A group can contain just one component and act like an ID in CSS.
COLORS
Colors have been reworked for the components (they stay the same for shapes)
Basically, color is now used for text and backgroundColor for the backgrounds - like CSS.
color - text (and rollColor)
backgroundColor - background of component (and rollBackgroundColor)
foregroundColor - foreground of component
borderColor - border on background and foreground
indicatorColor - indicator of component
SUMMARY OF PARAMETER CHANGES - BREAK
Most non-Label color and rollColor parameters and properties
have been changed to backgroundColor and rollBackgroundColor
color and rollColor have been kept when the component has text
and these now refer to the text - specifying a Label will override these.
Added backgroundColor to CheckBox and RadioButtons for the box and circle
The Tabs and Pad offColor is now the text color
and they get an offBackgroundColor to specify non-selected buttons
and they get backing and rollBacking parameters before the waitBacking
Exceptions:
Most components have their color parameter changed to backgroundColor.
The exceptions are those which shift to a foregroundColor parameter:
Waiter, ProgressBar, Indicator has its color parameter changed to foregroundColor.
The color parameter remains on the ProgressBar for its text color.
Waiter has its foregroundColor moved to before its backgroundColor - for consistency
Keyboard:
Changed Keyboard parameters so text gets color and backgrounds get backgroundColor
There are a bunch of these so here they are - old on the left and new on the right:
color to backgroundColor
textColor to color
shiftColor to shiftBackgroundColor
shiftHoldColor to shiftHoldBackgroundColor
placeColor to placeBackgroundColor
placeTextColor to placeColor
shiftBackgroundColor to shiftColor
// TOGGLE
There are objects that have control interfaces that can be shown or hidden:
Grid, Guide, Layout, Blob, Squiggle and objects with outline() or transform()
We have added a toggle(state) method to these
This has also been added to the Manager class which gives it to the GridManager, GuideManager, LayoutManager and TransformManager
Using toggle() will show the control (if hidden) or hide the control (if showing)
You can also use toggle(true) to specifically show and toggle(false) to specifically hide
A read-only toggled property has been added that is true if visible and false if not
BREAK - the transform(), Blob() and Squiggle() toggle parameter and property have been changed to allowToggle
Added the toggle system to Keyboard and ColorPicker, ProgressBar and Waiter (Pane already had one)
Many of these have hot keys to toggle or press on / press off to toggle and these still work
They also have show() and hide() and visible properties or showControls() and hideControls() and controls property
These will still work as well.
Added a show(), hide() to ColorPicker to allow it to act like a pop-up like Pane, Waiter, ProgressBar and Keyboard
Added an optional container parameter to ColorPicker - ColorPicker can still be added with addTo(), center(), etc.
but if it is being used as a pop-up, the show() and hide() or toggle() should be used.
// BACKINGS and BACKGROUNDS
The term backing is now consistently used for a custom DisplayObject added to a component
(such as a Pizzazz shape or pattern)
The term background is now consistently used for a built in background rectangle
These are specified with the backgroundColor parameter for Label, Indicator, etc. objects
In the past, both backingColor and backgroundColor were used which was inconsistent.
BREAK Changed Indicator, Tabs, ColorPicker and TextArea backingColor to backgroundColor
Renamed the backing properties of these to background to access the rectangle
// DOCS
Changed the order of the modules as they appear in the docs
FRAME, DISPLAY, METHODS, CONTROLS, CODE, WRAP, META
In the actual file, wrap and code come first and frame second last
This is needed as wrap and code do not require CreateJS
But from a user standpoint, the Frame, Display, Methods and Controls are most important
Hopefully you will get used to it - and it will be a good change
Changed the text docs as well and adjusted search to work with new changes
Added SubSection Markers and reorganized items within modules
// GENERAL
BREAK - changed drag parameters to draggable - as conflicts with drag function style
BREAK - changed the name of the Label backgroundCorner to just corner (easier to style)
BREAK - Added a corner property to Indicator after backgroundColor
BREAK - Added a borderColor and borderWidth to Keyboard - so changes parameter order
BREAK - added a borderWidth property to Stepper and Indicator - this is after borderColor so breaks parameter order
Also made border work on Indicator background
Adjusted copy() to not break when cloning a null value
IMPROVEMENT Fixed Button rollPersist to work if release outside of Button
Added indicatorColor property to CheckBox and RadioButtons that defaults to color
Adjusted ColorPicker so color text does not shift when picked (due to changes in centerReg() functionality)
PATCH - fixed bounds of cloned Container without initial bounds set - thanks Ami for the find.
PATCH - fixed ColorPicker when not with all colors, lastColor was set to blue and now it is not
This meant that the change event would not fire if the first color chosen is blue ;-).
IMPROVEMENT - clone() now clones the type property
so if you change the type of a Rectangle and clone it, the clone will have the changed type
Handy for passing an object with a custom type="Pattern" in for backings in STYLE
Adjusted Keyboard so selectedIndex starts at the end of the label text - also fixed backspace at 0 index with existing text bug
Fixed animate() when running a series with as a global function with no target
the last change for overriding by default only if x and y are animating - was expecting a target - fixed now...
IMPROVEMENT - updated Button so when it has a backing or icon,
it removes the rollover state when enabled is set to false
Adjusted backing on Label to mask backings of type="Pattern"
Adjusted Squiggle and Blob to drop properly when scaled or rotated
WELCOME TO ZIM OCT!
A kids section is also being added to ZIM Skool for workshops and secondary school lessons
Please let others know about ZIM and we'd love to hear from you at https://zimjs.com/slack - very productive!
---------
Updated TypeScript zip at http://zimjs.com/typescript/zim_ts.zip
Updated Distill at http://zimjs.com/distill
Updated Templates at http://zimjs.com/frame, Tips, CDN and Docs
Created Blog Post at https://zimjavascript.wordpress.com/2018/08/28/naked-objects-style-on-the-canvas-with-zim-and-createjs/
And CodePen at https://codepen.io/zimjs/post/naked_objects_style_on_the_canvas
Updated Tips page at https://zimjs.com/tips.html
and Code page at http://zimjs.com/code.html and About at http://zimjs.com/about.html
ZIM 7.3.2
IMPROVEMENT Added an optional titleBar on the top of Window like there is in Pane to drag and close and have a title...
also added properties to access titleBar and its parts and the close button - added a "close" event
IMPROVEMENT / BREAK changed the names of Window parameters for indicator to scrollBar - thanks Bracer Jack
IMPROVEMENT / BREAK inserted scrollBarH and scrollBarV parameters default true to show scrollBars if scrolling is needed
BREAK called Pane() bar parameters titleBar for consistency with new Window titleBar parameters
Window has scrollBar parameters too so needed to distinguish a titleBar rather than use bar.
BREAK Changed the Pane() name of the barTitle parameter to titleBarLabel
BREAK Adjusted ColorPicker to set greyPicker, alphaPicker, buttoBar to false by default if one row of colors
Added a read only colors property to the ColorPicker that returns the array of colors
IMPROVEMENT Added "rgba" option to convertColor()
and BREAK changed second parameter to be toColorType with default of "hex" and other values of "string" and "rgba"
added an alpha parameter for alpha of RGBA conversion
So convertColor(blue, "rgba", .1) would convert the ZIM blue to rgba(80,196,183,0.1)
IMPROVEMENT / BREAK animate() override now defaults to false instead of true
except if animating an x or y value and the object is currently animating in the matching x or y value
In this case, all earlier tweens will be overridden along with the x and y unless override is set to false
This forces the developer to use two separate tweens if the desired override settings are different.
Previously, all tweens on an object defaulted to override true - to solve almost exclusively an x and y animation issue
Adjusted Emitter() to centerReg() but not add as this was overriding the positioning of the emitter.
ZIM 7.3.1
IMPROVEMENT Added dispose() to all display objects
And adjusted dispose() on existing display objects to recursively remove listeners and remove from parents
The references to the objects on the outside must still be set to null to set object for garbage collection.
Updated docs for dispose() on all Display Objects
IMPROVEMENT outline() now remains on object when dragged or gestured.
outline() does not come up over Keyboard - thanks Bracer Jack
IMPROVEMENT Drag, Gesture and Transform objects do not come up over Keyboard even with onTop true (TBJ)
Added a controls property to the transformControls that references the controls container.
Updated TypeScript, etc.
ZIM 7.3.0
PATTERNS
Introduced ZIM Pizzazz 03 - custom patterns and animated patterns
These can be passed in to Button, Pane and ProgressBar objects
using the backing and rollBacking, toggleBacking and rollToggleBacking, waitBacking and rollWaitBacking parameters
at which point the pattern will be masked to the button, bar, etc. size.
The patterns can also be used on their own or masked by Pizzazz 01 shapes or your shapes, etc. using setMask()
http://zimjs.com/patterns.html
COLORS
Added Frame colors to zim namespace - and also global namespace with default zns set to false
This means to use zim colors just use black, pink, faint, blue, clear, etc. with no quotes
PROGRESS BAR AND PROGRESS PARAMETER
Added a ProgressBar() class with default "circle" barType - also "rectangle" for traditional bar
BREAK Added progress parameter to Frame and LoadAssets after the path parameter
This can receive a ProgressBar or a Waiter.
BREAK Due to the new Frame progress parameter, it is important to specify colors as Frame parameters
so that the colors show when the progress is running - so these have been moved to before the assets parameter
Loading now defaults to XHR as true if there is a ProgressBar - this gets load data from preloading
Adjusted Waiter to not require a stage so it can be made and passed in to progress parameter of Frame and loadAssets()
which may happen before there is a stage in the case of the Frame progress parameter.
SERIES
IMPROVEMENT Added a makeSeries() function to the Code module that returns a function which returns values in series
This can be used with ZIM VEE (zik) values to force sequential values from an array (passed to makeSeries)
TILE CHANGES - IMPROVEMENT / BREAK
Adjusted Tile() so registration and origin are at top left corner of bounds
Previously these were at the first element's registration point - which was odd for tiling centerReg objects like circles
Added optional colSize, rowSize, align and valign parameter after spacings
Moved count parameter to after cols and rows - really tired of adding null for count all the time
This was added to match the format of importing a SpriteSheet which often has a count that does not match the tile count
So SpriteSheet will remain as is with the count before spacing. And Tile will have the count after spacing.
Added a clone parameter (default true) to end of Tile
Set this to false avoid cloning a series unnecessarily
DEFAULTFONT UPDATE - thanks Bracer Jack for the prompting
IMPROVEMENT Applied DEFAULTFONT size and color properties to:
Button, RadioButton, CheckBox, Pane, Tabs, Pad, Stepper, ProgressBar, Keyboard
Initially, the font (family) and various other properties were applied but size and color were dictated by the component
Now, all the properties of the default font settings are applied which could BREAK the look of the app
if you were using DEFAULT FONT (only a few versions old). These properties include:
size, font, color, rollColor, shadowColor, shadowBlur, fontOptions, outlineWidth, outlineColor, padding, shiftHorizontal, shiftVertical
align, valign are available for the Pane
BUTTON UPDATES IMPROVEMENT / BREAK
The Button now has complete parameters and properties for
1. label (text), backing, rollBacking, icon, rollIcon
2. toggle (text), toggleBacking, rollToggleBacking, toggleIcon, rollToggleIcon
3. wait (text), waitBacking, rollWaitBacking, waitIcon, rollWaitIcon
The backing and icon parameters are read only references to current objects
Use the new setBacking(type, obj) and setIcon(type, obj) to manually adjust these at any time
This makes sure that old references are removed and any patterns are applied properly
Added a rolled property to Button that is true when button is rolled over
Added a wait() method to force the wait state of the button (similar to existing toggle() method for toggle state)
Adjusted Button so gradient and gloss work with custom backings
MISC
Added a series([]) function that is the same as makeSeries([]) but shorter in name for styles
Added a placeTextColor parameter to Keyboard BREAK
Fixed a problem with the icons - required cloning the icons as the board is remade during state changes
Added expand() to close button on Pane
Added chainable setBounds() method to Container and all extending container that overrides the CreateJS setBounds()
Also supports alternate parameters - (size) (width, height) or (x, y, width, height)
Updated TypeScript zip at http://zimjs.com/typescript/zim_ts.zip
Updated Distill at http://zimjs.com/distill
Updated Templates at http://zimjs.com/frame, Tips, CDN and Docs
ZIM 7.2.0
IMPROVEMENT / BREAK - changed Frame parameters to include assets and assetPath as the fourth and fifth parameters
This allows initial assets to load as part of the Frame's "ready" event - thanks Bracer Jack (TBJ) for recommendation
This solves the double event call that often confuses people new to coding.
While adjusting the parameter order, moved outerColor parameter to after color parameter.
Added a queueOnly parameter to loadAssets (default false) set to true to give asset events only to the queue and not to the frame
eg. var q = loadAssets(etc) // will give a complete event to q and to the frame
var q = loadAssets({etc., queueOnly:true}) // will only give a complete event to q - NOT to frame
BREAK - changed the addTo() method's new localToLocal parameter to default to true
This means that when an object is added from one container to the next, the x and y are adjusted so the object does not appear to move
If this behaviour is not desired then set the localToLocal parameter to false.
This only affects an object that has an existing parent. (TBJ)
IMPROVEMENT Adjusted the DEFAULTFONT constant to optionally receive a Label config object so defaults for any font property can be set
Added a resetBounds() method to the Methods module of ZIM to reset bounds if previously hard coded.
IMPROVEMENT Added an empty backing event to Keyboard to stop presses from slipping through. (TBJ)
Added shiftHorizontal and shiftVertical parameters to Label
Adjusted CheckBox and RadioButtons to work with valign center Labels for better alignment.
Adjusted outline() to clear itself if another outline is set so now, this can be called in a Ticker for instance.
and we don't have to keep saying it is a snapshot in time! Thanks Bracer Jack
Examples have been added to the docs.
BREAK - changed the default padding to Window to be 0 - set this with padding or paddingVertical and paddingHorizontal
Added a removeAll() method to Window to remove all current content from the content container and update indicators. (TBJ)
Also added a "replace" parameter to the Window's add() method to replace the current content with the new content (first parameter)
Updated TypeScript typings at http://zimjs.com/typescript/zim_ts.zip - updated Docs, Distill, Templates, ZIP and code page
ZIM 7.1.0
1. Updated animate() to use a props parameter rather than an obj parameter.
Changed the existing props parameter to cjsProps as that is for older transition values.
obj still works for backwards compatibility but has been depreciated.
This is a conceptual change - props better describes that these are the properties we are animating.
It will be a fairly wide-spread change so there will be many tutorials slightly out of date - oh well.
2. Added a Boundary() class to the code module to store x, y, width and height
This can be used in place of a createjs.Rectangle in most cases.
The createjs Rectangle is still available and has more features.
This is to avoid confusion between the ZIM Rectangle and the CreateJS Rectangle.
The ZIM Rectangle is a DisplayObject whereas the CreateJS Rectangle is a data class.
The Boundary class can be used to specify a boundary for drag(), gesture() and for a Physics world.
3. Depreciated the rect parameter for drag() and gesture() and replaced it with a boundary parameter.
The rect will still work for backwards compatibility
4. Changed dragRect() and gestureRect() to dragBoundary() and gestureBoundary()
the old method names are still available but are depreciated.
These methods are used to dynamically change the boundaries - which is fairly rare.
The change is to match the new Boundary class for specifying a data rectangle.
Thank you to Bracer Jack for the prompting and confirming our nagging concern over two Rectangle classes.
5. Added a Point() class to the code module to store simple x and y properties.
This can be used in place of a createjs.Point in most cases.
The createjs Point is still available and has more features.
6. Added a paused property to all DisplayObjects
This will be undefined if the object has not been animated
Once animated, paused will be false until the animation is paused at which point it will be set to true
If the animation ends or is stopped, the pause property will be set to null.
This will allow the animation to be toggled with obj.pauseAnimate(!obj.paused)
7. IMPROVEMENT - added circularBounds parameter to gesture to keep rotated circular objects within boundaries
8. Added a DEFAULTFONT constant to the controls module below ACTIONEVENT (thanks Bracer Jack for the idea)
This can be set to change the font across all components to whatever is specified
Fonts specified per component will override this default
DEFAULTFONT can be set to a custom font - frame.asset("myFont.ttf") for instance
9. IMPROVEMENT- fixed gesture to not move if move is false and are double pinching
This was a glitch when we introduced surround bounds
10. Fixed startBounds parameter for drag() when using DUO.
11. center() and centerReg() will default to the object's parent if there is a parent and no container is provided
Thanks Bracer Jack for the suggestion
12. Changed global variable zon to be true by default to show messages from ZIM
In CodePen the libraries are passed in separately, so zon is missing from the code
and people were not receiving ZIM messages like bad parameter warnings, etc.
So the default now is true and zon must be set to false to suppress messages.
13. Added an asset object to Frame's loadAssets() in format of {id:"string", scr:"file"}
The loaded file can be accessed by id such as frame.asset("string");
The path paramter works in the same way as usual.
Specifying just the filename is still available: frame.loadAsset("filename");
Then the file can be accessed frame.asset("filename");
but the optional asset object offers an abstracted solution if desired - thanks Bracer Jack for the prompting
14. Updated TypeScript Typings for Point, Boundaries, drag, dragBoundary, gesture, gestureBoundary, animate and StageGL
ZIM 7.0.2
IMPROVEMENT can now load Sprites with CORS (cross domain) when using JSON parameter
JSON was passing string version of URL to Sprite which voided the image crossdomain settings
Also, ZIM now pre-parses the images array in the JSON to match frame.asset() images
So the exact path is no longer needed in the JSON - just a matching filename will do
This is handy as TexturePacker, etc. often export with just the filename
and previously, this would not run if the SpriteSheet file were stored in an assets folder for instance
unless the JSON was modified to reflect the path - now, this is not necessary.
Adjusted gpu setting of Frame to properly make Bitmaps (broke in version 7) - patched 7 and 7.01
The change in 7 was to support IE as IE does not have an ImageData() constructor
so ZIM 7 was adjusted to use the createImageData() method of the context2D of the currentFrame.
Well... when gpu is true... there is no context2D for the currentFrame
so now a new temporary canvas is used to provide the createImageData method ;-)
Added hitTestGrid() to StageGL
BREAK added a currentSelected parameter after currentEnabled (before corner) for ZIM Tab
currentEnabled now only determines if tab can be clicked again when already selected
if true, this will call the change event even though the selectedIndex has not changed
The currentSelected defaults to true to highlight the selected tab after clicking
if set to false then the tab does not stay highlighted - good for button bars - IMPROVEMENT
Version 7 tried to not highlight when currentEnabled was true but this broke the Pad
so the functionality was split into two parameters
setting currentSelected to false will automatically set currentEnabled to true
IMPROVEMENT Added bounds transfer to when container is cached - apparently this is fixed in next CreateJS version
Adjusted Blob and Squiggle to store an internal mySet rather than set property
as this was conflicting with the CreateJS set method when animating the Circle or Rectangle objects in the control container
Swapped default for zon to be true - to automatically give messages from ZIM unless set to false
Was making CodePens and missing warning messages from ZIM about bad parameters, etc.
Updated TypeScript Typings for Tabs and StageGL
ZIM 7.0.1
IMPROVEMENT Changed stage.mouseX and stage.mouseY to e.stageX and e.stageY when applicable
to let desktop touch screens access value - affected Keyboard drag, Swiper and a few other components
Adjusted Emitter() to moveTo random position rather than lineTo for emitShape setting (fixing a glitch)
Added swiperpause event and pauseTime parameter to ZIM Swiper
Added hitTestGrid() to Stage and StageGL classes
BREAK - added a sensors parameter to Frame that defaults to false
set this to true to use the Frame's devicemotion and deviceorientation events
this was set to default to false to remove the "depreciated" warning in the Browser console
Added zta() global function that logs Arrays and Objects to the console as a table
this binds the console.table() method
IMPROVEMENT Fixed Dial continuous to dispatch change event only different than earlier value
Adjusted Pad to show tabs it has if passing in a tabs list of less than number for pad
Added zik to wiggle() for base, min and max amounts
so now these amounts can be adjusted by an outside function for dynamic ranges with one wiggle
Added Keyboard selectedLabel and selectedIndex properties and showPlace() and hidePlace() methods
Thanks James Barrett for the prompting and thanks again Frank Los for the Keyboard class.
Fixed TextArea clone() method to properly clone TextArea
Updated TypeScript files and added link to top of docs
// PATCH
Adjusted Sprite to be interactive with JSON file and image from remote sites with CORS settings to anonymous
Previously, had to make a custom CreateJS SpriteSheet and pass that in to Sprite
Fixed Container to keep non-hardcoded bounds after being cached
ZIM 7
Added a Keyboard() class to the Display Objects (thanks Frank Los for the design and code)
Keyboard works with Label() to provide single line editable text without needing the system keyboard
Added top() and bot() chainable methods to put object at top or bottom of container - thanks Ami Hanya for the recommendation.
IMPROVEMENT Added links to libraries at the top of the docs for SOCKET, GAME, PHYSICS, THREE, PIZZAZZ, PIZZAZZ 2
as well as made all these files consistent in introduction and documentation format (inside CDN files)
Launched Physics and Three as version 1.0 - Game and Socket were already version 1 and Pizzazz is different
IMPROVEMENT Added video links to Docs - a little button near view and bits at the bottom of each doc entry
IMPROVEMENT Added wheel event to Window for mousewheel scrolling - was using out-of-date events
Added a scrolling event to Window when it is scrolled
Added an HTML NodeList to ZIM loop() - see ZIM zet() to get a NodeList like $() in JQuery
Dedicated ZIM Portal to Stephen Hawkings - may he portal on!
Added Button borderColor property - thanks Chris Spolton!
Added an svgToBitmap() conversion function to META module to convert SVG to a ZIM Bitmap
Thanks Kenil Domadia for the recommendation
For Base64 Bitmap support made Bitmap update the stage after 50ms and then after another 50ms
this is because there is a delay in creating a Bitmap from data - thanks Ami Hanya for the prompting
All the changes are reflected in ZIM TypeScript Typings http://zimjs.com/typescript/zim_ts.zip
KEYFOCUS - IMPROVEMENT
Added a global KEYFOCUS constant to keep track of which component has keyboard focus
This is a system for all components with keyboard controls (set to active)
The first component made will set KEYFOCUS to itself
Anytime a component is used it sets KEYFOCUS to itself
Components have a keyFocus property that can be manually set
There is only one component with key focus
so setting removes key focus from the last key focused component
Added KEYFOCUS to TypeScript
If tabbing from one component to the next is needed, consider using ZIM Accessibility()
Made keydown change components only if component is on stage
POS()
BREAK inserted an index parameter to pos(x,y,container,index,add) - also now accepts DUO
Was going to make the default be adding to stage - but after some thought, decided not to
You must still explicitly specify the container
We had changed it but then were getting errors where things were showing up unexpectedly in score boards, etc
and it just seems a little too dangerous
ZIM GESTURE
Added onTop and surround parameters to ZIM gesture() - thanks Frank Los for the suggestions
surround currently does not work if rotate is true
Adjusted gesture() rect parameter to handle resized and rotated objects
This is an IMPROVEMENT but also slightly BREAKS code with old rect values
Here you specify the rectangle to contain the object - not the registration point of the object
So this is slightly different than the rect provided to ZIM drag
To accommodate this we have added an update parameter to the gestureRect
This defaults to true and Gesture will dynamically update the gestureRect as the object scales and rotates
Internally, it passes a false to the new update parameter.
GENERAL FIXES
Removed ColorPicker indicator if currentIndex is less than 0
Fixed grip on ColorPicker to be dragable by setting shape to mouseEnabled false so background is selectable
IMPROVEMENT - adjusted TextArea so readOnly parameter works
Fixed decimal values for Stepper - some values had micro additions - these have been rounded to the decimal number
Adjusted tabs so that if currentEnabled is true, clicking button leaves button on rollcolor - like a button would - good for button bars
Fixed stage property in waitModal for buttons, tabs, etc.
Fixed next mousedown and hold on Stepper when mouse not moved.
Made animate() return the target for chaining when ANIMATE is set to false.
Changed loop() docs for method to not include loop function functionality
but rather refer to the loop() function in CODE module
BREAK - changed the Squiggle borderDashedCommand to dashedCommand as the Squiggle has no border
Squiggle is no longer implements a ZIM Shape in TypeScript as it has no border
Adjusted outline of Label to show above backing and backgroundColor
Adjusted wiggle to not use animate with a Ticker if object does not have a stage
Adjusted Slider so inside setting properly centers the slider in bounds
Added JS document.Window and document.Blob references before overwriting with ZIM Window and Blob
ZIM 6.9.0
IMPROVEMENT Added TypeScript Typings for ZIM.
This led to some slight organizational changes but nothing serious
a few additions and a few parameter changes as outlined below.
The Typings are complete but relatively untested so there may be type typos to work through
as there were over 1000 lines of unique definitions and 2700 lines of full definitions
that were created with a custom parser.
The Typings ZIP can be found here http://zimjs.com/typescript/zim_ts.zip
Added ZIM Stage and StageGL class for TypeScript typings
ZIM Stage has type and read only width and height properties given to it by zim.Frame
If ZIM Frame is used, there should be no use for ZIM Stage.
Also gave the stages the loop() method so we can loop through children of the stage like we can a ZIM Container
BREAK The following were adjusted as we went through the typings:
added a fileID property to Bitmap as an alternative id to avoid conflict with CreateJS Bitmap id
removed second rect from MotionController - there already was a rect when we added another rect.
adjusted Stepper prev and next properties to containerPrev and containerNext so as not to conflict with prev and next methods
changed TextArea focus() to setFocus() and hasFocus property to focus - for better consistency with other focus properties
changed Pages setSwipe() to setSwipeArray() so as not to conflict with Container property setSwipe()
changed Stepper loop parameter and loop property to continuous (like Dial) so as not to conflict with Container property loop()
MORE METHODS CONVERTED TO CHAINABLE:
Blob and Squiggle setPoints(), changeControl()
Label showRollColor()
Button setBackings(), setIcons(), toggle(), clearWait(), stopWait()
CheckBox setChecked(), RadioButtons setSelected()
Pane hide(), Window resize(), Waiter hide()
Loader resize(), TextArea resize()
GENERAL UPDATES
Added a fileType parameter to loadAssets() so can override CreateJS PreloadJS parser
Note - it acts on all files loaded so might have to separate loading to get a specific type to load
For instance, laoding a .d.ts file was parsing as sound rather than text - so pass in fileType:"text" to override
but you would need to do this independently from any other assets unless the other assets were text too.
Added vertical parameter to tabs - set to true to make vertical tabs or vertical button menus
Tabs now as a backingColor parameter for in behind when corner is set
BREAK - changed the order of the smoothStep parameters to (num, min, max) to match order in constrain() and others
updated smoothStep example and Noise examples at http://zimjs.com/noise/
Moved ZIM Tile from the Display to the Controls module.
Tile takes an existing Display object and tiles it much like Layout, Scroller, Emitter, etc. operate on existing Display objects
Being a Container, Tile still receives all the ZIM Methods.
Also adjusted Tile's code when mirroring non-zero registration objects
Replaced the mousewheel event in zil() to wheel as mousewheel is depreciated
Also added wheel event to Window with scrollWheel true (default)
adjusted docs for Scroller to a paused property instead of the typo pause - note: there is a pause() method
Made Dictionary remove() return boolean success
Adjusted TextArea to not give error when Frame allowDefault is true (patch)
Adjusted tag mode canvasID to not have random number on end - thanks James Barrett
Added a allowDefault property to Frame to turn off and on zil for expanding and collapsing frames
see http://zimjs.com/expand/index.html - thanks Chris Spolton for the idea
ZIM removeFrom() - now removes from parent by default - makes sense ;-)
Changed ImageData() to createImageData() in Bitmap to support IE - thanks Chris Spolton
Adjusted spurtfizzed and spurtdecayed to lowercase instead of camelCase
Adjusted cloneProps to remake bounds - otherwise they were linked (patch)
ZIM 6.8.1
IMPROVEMENT Added immediate property to Parallax class layer object. So you can specify a starting value without damping to the starting value
IMPROVEMENT Added frame.visibleLeft, frame.visibleRight, frame.visibleTop and frame.visibleBottom properties to help position relative to window in "outside" mode
All other modes will have 0,0,stageW,stageH for these properties
This data changes for outside mode and can be used in a frame resize event to keep items like navigation in the window view
Added note about setting mouseEnabled of animation target before running animation as animate sets and resets to original after a small delay
So if you set the mouseEnabled to false right after an animate() call then it will be reset
IMPROVEMENT Added crossOrigin parameter to frame.loadAssets() with default of "anonymous" - this lets files be loaded from Amazon S3 for instance
if the right CORS set up is there - HEAD was added for fonts - see the Bucket Permissions and then CORS configuration
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>HEAD</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
ZIM 6.8.0
Added ZIM VR class in the Controls to do side-by-side VR like in Google Cardboard.
This is quite an exciting system so have a good look over the docs and examples.
http://zimjs.com/code/vr
Added a depth property to Display objects to be used with the VR class (only at this time)
Added a dep() chainable method to set the depth property
Added device orientation event to Frame:
"deviceorientation" - fired as device orientation changes
eventObject.alpha holds rotation about the z axis (if device is flat) relative 360 orientation like a compass
eventObject.beta holds rotation about the x axis between -180 and 180 (tipped forward or backward)
eventObject.gamma holds rotation about the y axis between -90 and 90 (tipped left or right)
eg. frame.on("deviceorientation", function(e) {zog(e.alpha, e.beta, e.gamma)});
Added multiple parameter to Frame makeCircles() method to make ZIM Circles rather than a single Shape
Adjusted centerReg() to only add to default stage if container is not provided AND obj is not already added to a container (no parent)
IMPROVEMENT Adjusted setMask() to not set the mask when not added to the stage only when the mask is dynamic
IMPROVEMENT Since adjusting the setMask in 6.7.1 masks could only be set when added to the stage
This has now been fixed so that masks can be set when not yet added to the stage.
Fixed a typo bug introduced in 6.7.2 that broke RadioButtons IMPROVEMENT
Adjusted zob() so it does not give an error if a single undefined parameter is passed in
IMPROVEMENT And... there was a glitch in making it chainable - it is now chainable
IMPROVEMENT Re-adjusted the Loader.save() method to avoid a Google change of policy:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/GbVcuwg_QjM%5B1-25%5D
Now saves directly to a file rather than showing image in new window.
Thanks Frank Los for the heads up.
ZIM 6.7.5
BREAK ZIM move() has been removed. Please use ZIM animate() instead with obj:{x:val, y:val}
ZIM move() was a convenience method that just took an x and y parameter and passed it through to animate().
Now with ZIM mov() it became too confusing to have both and move() was not really needed.
IMPROVEMENT Added an events parameter to animate (default false) set to true to dispatch "animation" events from the target
The "animation" event will be dispatched while the target is being animated. Thanks Ami Hanya for the recommendation.
Adjusted ZIM addTo(), center() and centerReg() to default to the adding to the first frame's stage if no parameters
So now circle.addTo(), circle.center() or circle.centerReg() will add to stage as long as there is one frame.
If there are two frames, it will get added to the first frame's stage so beware.
BREAK The centerReg() used to just center the registration and not add it to anything if there were no parameters.
Now, it centers and adds to the stage. To just center the reg, use centerReg(null, null, false);
It was quite rare to just center the reg and not add it to a container.
And it was important to keep the addTo(), center() and centerReg() defaults consistent.
Added container and add parameters to ZIM pos()
For now, the container property defaults to null.
We will consider defaulting to the first frame's stage (if not already added to a container) in the future.
The add parameter defaults to true and could be set to false to not add to the container.
Thanks Kate Xue for discussion.
ADDED TO LABEL: (thanks Daniel Loranz for the prompting)
backgroundColor - (default null) set to CSS color to add a rectangular color around the label
The background color will change size to match the text of the label
Note: the backgroundColor is different than a backing which can be any Display Object
and background parameters are ignored if a backing parameter is set
backgroundBorderColor - (default null) the background stroke color
backgroundBorderWidth - (default null) thickness of the background border
backgroundCorner - (default 0) the round of corner
backgroundDashed - (default null) set to true for dashed background border (if backgroundBorderColor or backgroundBorderWidth set)
padding - (default 10 if backgroundColor set) places the border this amount from text (see paddingHorizontal and paddingVertical)
padding parameters are ignored if there is no backgroundColor set (also ignored if a backing parameter is set)
paddingHorizontal - (default padding) places border out at top bottom
ALSO added background property for the label to access the ZIM Rectangle that is the background
ZIM 6.7.4
Adjusted slidestop to work in Swiper if there is no min and max.
Updated Dial, Swiper and MotionController enable property to use event variables when adding the events.
Updated the transform show and hide to use event variables when adding the events.
Eg. INITIAL SETTING:
var eventID = that.on("mousedown", eventFunction);
DISABLE:
that.off("mousedown", eventID);
ENABLE:
// was doing:
that.on("mousedown", eventID);
// should be:
eventID = that.on("mousedown", eventID);
This does not affect one enabled = false then one enabled = true.
But after that, the next enabled = false will not work.
If there is another enabled = true then there are two events, etc.
So this has IMPROVEMENT possibilities.
At some point, this concept was lost and now it has been found again.
ZIM 6.7.3
Updated gesture to fix bug when setting rotate or scale to false - thanks 王晓东 / Sheldon Wang for the find
Added a hasFocus property to TextArea to get or set focus with property - there is already a focus() method to set focus.
Made the default cursor for cur() be the "pointer" - set cur("default") to go back to normal cursor, etc.
ZIM 6.7.2
Updated Blob and Squiggle points and controls property.
Blob and Squiggle had their points parameter array set with Number positions
The points property was initially read only for an array of point objects - the control container, circle, and rectangles
This was fine until we introduced the TransformManager and added the Blob and Squiggle.
At this time, we needed to be able to recreate blobs and squiggles.
We made points settable with an array in the same format as the points parameter.
This left the points property with different formats for getting and setting - not ideal.
So this change has fixed the issue and makes point manipulation easier and more consistent.
BREAK - IMPROVEMENT the points property is now consistent in format for both getting and setting with x and y properties (and a control type):
points - [[controlX, controlY, circleX, circleY, rect1X, rect1Y, rect2X, rect2Y, controlType], [etc]]
A new property has been added to get access to the zim objects for each point:
pointObjects - [[control, circle, rect1, rect2, controlType], [etc.]]
Here, control is the container; circle, rect1 and rect2 are Circle and Rectangle objects
Note, the order is now the same for consistency
We were also using the term "set" to represent the controls of one point.
This starts getting confusing when we get and set values as we are using the word set again. (Thanks Kris Gardiner for the advice)
So we now use control to refer to the controls at the point - control is the container that holds the circle and the two squares
BREAK - the sets property has been changed to controls which provides access to the overall container that holds all the control containers
BREAK - controlsVisible is now the Boolean property to get or set the visibility of the controls - this was formerly controls.
Added an update parameter to Blob and Squiggle changeControl() - defaults to false to let multiple changes be batched with update() method
Fixed canvasID for tag mode - Thanks Alex for the report
Updated ZIM Label to be able to store a space and return text of a space.
Adjusted ZIM animate to use ZIM VEE values for sequences.
ZIM 6.7.1
Added chainable cache() method to Containers and Sprites - this overrides CreateJS cache to operate on bounds by default and return the object for chaining
so all Display Objects that extend a Container such as Circle, Rectangle, Triangle, Blob, Squiggle, Label, etc. all get the new cache()
eg. var circle = new Circle(100, frame.red, frame.dark, 5).cache().drag();
cache() will automatically cache the dimensions of the Circle, Rectangle, etc. and add the half borderWidth as well - NOTE that cache is chainable now!
You can still pass in dimensions and if you do, you can just pass the first two parameters as width and height to start x and y at 0.
Or you can pass all four parameters like CreateJS cache() - note, the fifth parameter is scale which can cache at a higher fidelity for later scaling
This is a convenience function for circle.cache(-circle.radius, -circle.radius, circle.radius*2, circle.radius*2);
Added a cur() chainable method for applying a cursor to a CSS cursor string value
eg. var circle = new Circle(100, frame.red, frame.dark, 5).cur("pointer");
This is a convenience function for circle.cursor = "pointer"
The function itself in ZIM is virtually nothing:
zim.cur = function(type) {
obj.cursor = type;
return obj;
}
But it allows us to chain and potentially avoid variable names - for example:
var circle = new Circle().center(stage);
circle.cursor = "pointer";
circle.on("click", function(){zgo("http://zimjs.com");});
// becomes 70% the code with:
new Circle().center(stage).cur("pointer").on("click", function(){zgo("http://zimjs.com");});
// remember that on() does not return the object for normal chaining but that is okay if no further reference to the object is needed
// albeit, risky if you change your mind...
Added a sha() chainable method for applying a createjs Shadow() that has defaults or params for color, shiftX, shiftY, blur or a single CreateJS Shadow
eg. var circle = new Circle(100, frame.red, frame.dark, 5).sha().drag();
This is a convenience function for : circle.shadow = new createjs.Shadow("rgba(0,0,0,.3)", 5, 5, 10); // etc.
Updated gesture() and transform() to work properly with masking as well as converted drag(), animate() and Blob() into new mask management
Added a dynamic parameter (default false) to setMask() that runs a Ticker to track and update mask movement.
The Blob and any ZIM Shape that has drag, animate, transform or gesture will set the dynamic property to true (unless it was explicitly set to false)
A Shape() that is used for a mask does not have to be dynamic as it is directly applied as the mask
If you are going to mask with a ZIM shape (Rectangle, Circle, Triangle) and then manually transform the mask for instance, mask.sca(2);
then either setMask with dynamic of true or setMask after the transformation
BREAK - IMPROVEMENT - made setMask() return object for chaining - now that dynamic is set no need really to return mask object instead use mask.zimMask
BREAK - Added count (total tiles) parameter to after cols and rows for ZIM Tile - in case you do not want all columns filled on last row.
Added factor parameter to Swiper (default 1) is going the same direction and -1 is going in opposite direction
Updated Swiper to recognize damp parameter
Added swipestop event to Swiper for when motion stops after swipeup
Adjusted added() method to clear longer interval if shorter interval detects stage
Adjusted Blob and Squiggle to not check for stage updates when not on stage due to removeFrom stage - was working fine for toggle but not if manually removed
Added slidestop event to drag() docs
ZIM 6.7.0
Added devicemotion event to Frame - eg. frame.on("devicemotion", function(e) {zog(e.acceleration.x, e.acceleration.y, e.acceleration.z)});
Added Portal(obj, lands) to controls module.
Portal lets you travel between lands (screens, etc.) by rolling over an object - the portal.
It handles masking the land through the portal and the land management - dispatches enter and exit events
Here is an example http://zimjs.com/code/portal
BREAK - changed "relative" parameters and properties in Dial to "continuous" for better clarity - and continuousMin and continuousMax
ZIM 6.6.4
IMPROVEMENT Adjusted Dial and Slider keypress to be independent of other keydown commands (like MotionController)
Added keyArrowsH and keyArrowsV to Dial and Slider that default to true - can now turn off left/right or up/down control
Fixed arrow control on limit=false to allow multiple revolutions
Fixed arrows on relative setting of Dial
Fixed ticks for slider with max that is smaller than min
ZIM 6.6.3
Adjusted docs to say Dial has default step of 1 (not 0 as docs had said).
Added multitouch to Dial - Slider and drag() already have multitouch.
Added relative, relativeMin and relativeMax parameters to Dial
Added relativeMin, relativeMax get set properties to Dial and made min and max writeable for when relative is true
This uses max-min as amount per revolution and continues to add or subtract accordingly
http://zimjs.com/code/etch/ for Etch A Sketch example
ZIM 6.6.2
IMPROVEMENT Added raw() method to zim.Ticker() that directly adds a function to a requestAnimationFrame
Also added a removeRaw() method to remove a raw function with an id made by var id = Ticker.raw(function)
This gives ultimate speed without calling the library system of Ticker.add()
Ticker.add() should still be used in general for multiple ticker calls or calls along with zim animate, etc.
But use raw() for dynamic art for instance where you have one butter smooth ticker.
You need to call stage.update() in the raw() function
We could have called stage.update() but it would run the risk of duplicating the update if the coder also put it in
Updated Scroller to add second object to the same layer as the original object
so no need to add Scroller objects to containers IMPROVEMENT
Added flip and flipVertical parameters to Dynamo to flip the Sprite if speed is negative and reversible is false.
This was done by the coder previously - so it might BREAK a project where it was already done... BREAK
Also changed reversable parameter to reversible for proper spelling ;-) BREAK
Added convertColor() to DISTILL
Adjusted DISTILL to properly access ZIM namespace without ZNS set to true
Adjusted Frame to create a random canvasID if the frame is not the default frame and no canvasID is provided
Added canvasID property to Frame to provide String of the canvasID - could also use frame.canvas.id
Fixed glitch in makeID() so default is indeed mixed
ZIM 6.6.1
Added isJSON function to test for JSON string.
IMPROVEMENT Adjusted ZIM gesture to rotate and scale around pinch point.
Added regControl parameter (default false) to gesture go back to rotating and scaling around registration point.
Fixed chaining of stopAnimate and pauseAnimate.
ZIM 6.6.0
DOCS:
Removed namespace from documentation titles and doc examples
Remember that the namespace can still be used. It can also be required by setting zns=true before importing ZIM
Tidied up the function listings to not include title = function(parameters) but rather title(parameters)
Added a text version of the docs for easy import into other viewing systems like PDF (thanks Vishwas Gagrani)
SQUIGGLE:
Added ZIM Squiggle - like a blob but only a line
Squiggle has pretty well all the blob features including TransformManager support
Squiggle does not have borderColor, borderWidth nor radius but rather has color, thickness and length
It also defaults to "mirror" as the type of control rather than "straight" which the Blob defaults to
BUTTON:
IMPROVEMENT - added wait, waitTime, waitColor, rollWaitColor, waitTextColor, rollWaitTextColor, waitModal, waitEnabled parameters to the end of the Button parameters.
Added clearWait() and removeWait() methods, a waiting property and a waited event which is dispatched if the waitTime is reached.
For wait backings and icons use the setBackings() and setIcons() methods along with the waited event to handle changes.
BREAK - inserted a borderRollColor parameter before borderWidth which is before corner.
Any existing buttons with traditional parameters up to corner will broken - an extra null will have to be inserted before borderWidth.
Also added a borderRollColor property to the zim Button.
Since the parameter order has changed, moved dashed to after flatBottom parameter - to match Rectangle.
Added wait parameters to Tabs and Pad as well and added gradient and gloss to Pad
PANE:
Added the following parameters to ZIM Pane()
bar - (default null - no bar) a String or ZIM Label title for the pane that will be presented on a bar across the top
barColor - (default "rgba(0,0,0,.2)") the background color of the bar if a bar is requested
barHeight - (default fit label) the height of the bar if a bar is requested
close - (default false) - a close X for the top right corner that closes the pane when pressed
closeColor - (default #555) - the color of the close X if close is requested
Also added bar, barColor, barBacking, and close properties to access these objects
Fixed TextArea and Loader inside Pane add/removal problem - was using Dictionary objects list rather than values list
Also for multiple TextAreas was not looping through container backwards when removing so was missing an item
BREAK changed the backingAlpha to backdropColor to offer more flexibility for the backdrop
use "rgba(0,0,0,.5)" etc. for dark and "rgba(256,256,256,.5)" for light - and of course colors as well.
You can use a solid color and then drop the alpha with pane.backdrop.alpha = .2 - not alp() as backing is CreateJS shape.
HITTESTCIRCLES:
IMPROVEMENT - added ZIM hitTestCircles() method to all display objects.
This tests if two circle shapes are hitting using an equation based on cirles made from bounds
If the bounds are not square, the circles are averaged - the radius is half the average of the lengths of its sides
(This is different than hitTestCircle() where the points around the "circle" actually stretch to an oval with the bounds)
obj.hitTestCircles(obj2) is a calculation based on intersecting circles so is faster than shape hitTests
It will be as fast as hitTestBounds and hitTestGrid.
hitTestCircles second parameter is a margin number value which can be positive or negative to tweak the hitTest
A margin parameter has been added to hitTestBounds as well before the boundsShape
OTHER:
IMPROVEMENT - added zim.previewAudioSprite() to the META module to create tabs with each sound in an AudioSprite for easy preview
Adjusted parseAudioSprite() to clarify that it returns a CreateJS AudioSprite object
BREAK - adjusted Blob to have a setData() method rather than a set() method so the general set() method is not obscured
BREAK - adjusted transform() transformObject to have a setData() method rather than a set() method to be consistent with Blob and Squiggle
NOTE: transform has a transformObject which is a custom object - not a Display object so set() is fine there but wanted to be consistent
BREAK - adjusted Blob and the transformObject to have recordData() methods rather than record() methods
These now match - recordData(), setData(), recordPoints(), setPoints() - sorry for the adjust but should be settled now.
Also adjusted the Docs on Blobs to update the single click edit.
Also adjusted the Docs on the Blob's points property to indicate a different format for setting and getting points.
Adjusted TextArea and Loader to use zim.added() to test for the stage and then on("added") to test for re-adding after
Fixed a glitch in Stepper so the downForward parameter works as expected
Added read only num property to Blob (to match Squiggle's num property) for number of points
Added error support for font loading so load completes if font is missing - takes the timeout though of 8 seconds
which is not ideal but could not seem to capture immediate bad URL error with error or fileerror events
Fixed Stepper to set correct selectedIndex when stepping through number list that does not start at 0 and make sure enabled has this number when set to true
Gave Pane and Indicator enabled properties like most other components
IMPROVEMENT - adjusted TextArea to have a background-color of rgba(0,0,0,.01) so cursor and selection highlight shows up (was at transparent - weird that would affect selection)
IMPROVEMENT - adjusted zim.drag() so the last drag added is the only drag on the object
IMPROVEMENT - added a dynamically created audio tag for the first audio loaded to jumpstart audio on some Apple devices
Thanks Bart Libert for reporting and testing the issue.
ZIM 6.5.0
AUDIOSPRITES:
IMPROVEMENT Added support for AudioSprites with frame.loadAssets() and frame.asset()
Added outputAudioSprite parameter to loadAssets() to show converted AudioSprite data when using ZIM AudioSprite format
Added parseAudioSprite() function to META section for parsing AudioSprite data from https://github.com/tonistiigi/audiosprite
TRANSFORM, BLOB and TRANSFORM MANAGER:
Added a transformType property to the transformed event object for transform()
This has values of "scale", "move", "rotate", "stretchX", "stretchY", "reg" "reset"
Added objects and persistID to the start of ZIM TransformManager() parameters
BREAK The unique parameter has been removed now that transform works with single click
Added currentObject and persistData properties to TransformManager
Added EVENTS to TransformManager:
1. transformed event when pressup on any of the controls or on click
transformed event object has transformObject and transformType properties
the transformType property has values of:
FOR TRANSFORM: "size", "move", "rotate", "stretch", "reg" "reset"
FOR BLOB: "move", "bezierPoint", "bezierHandle", "bezierSwitch"
2. transformshow and transformhide events for when click to hide or show controls
these have a transformObject property to indicate what was shown or hidden
Added a dispose(removePersist, removeControls) method to TransformManager
Added a dispose() to the transformControls for any transformed object to remove transform controls and events
Made Blob and transform / TransformManager only trigger change or transform events when a property value changes
Previously, a change would happen on mousedown and pressup but now there has to be a different x or y
Same with all handles, scaling, rotating, reg, etc.
SHAPE BITMAP and GRADIENT FILLS:
IMPROVEMENT - added colorCommand and borderColorCommand properties to ZIM shapes (Circle, Rectangle, Triangle, Blob)
These allow you to set Bitmap, linearGradient and radialGradient fills on the shapes (through CreateJS Graphic objects)
Thanks Samual Jacquinet for the prompting!
OTHER UPDATES:
Fixed Waiter.dispose() method when short wait times - thanks Ami Hanya
zim.hitTestPoint, hitTestReg, hitTestRect, hitTestCircle got a new last parameter - boundsCheck (default true)
Set this to false to not do a bound intersection check first
This would be slower but if the bounds are wrong (such as with blobs) the parameter should be set to true
to make sure that only the shape is used and not filtered by the faster bounds test.
Adjusted ZIM Blob to fix bounds issue due to above.
BREAK - no longer clone the cursor property when cloning an object - that can lead to unexpected results - but let us know if you disagree
ZIM 6.4.1
IMPROVEMENT fixed memory leak in transform() that was leaving mousemove events due to using wrong variable name
IMPROVEMENT BREAK removed dblclick parameter and replaced with toggle parameter for single click editing
This is much more intuitive and has been set to a default of true.
So click on shows controls and click off hides controls.
IMPROVEMENT BREAK changed dblclick parameter for zim.Blob() to toggle to match transform()
Also changed Blob to single click to show and hide controls.
IMPROVEMENT BREAK made blobs drag when controls are active to match transform() and most editing tools
and changed dblclickDrag parameter to move to match transform() and default move to true (set to false to turn off dragging)
IMPROVEMENT BREAK added a handleSize parameter to Blob just before the toggle parameter that sets the handle size like with transform
This defaults to 20 on mobile and 10 on not mobile ;-)
BREAK changed the record() method of Blob to recordPoints() which matches format when creating a Blob
IMPROVEMENT and then added new record() and set() methods that work together for updating already created Blobs
This was so that Blob objects can be added to the zim.TransformManager just objects with transforms
You will need to make a basic Blob with the correct number of points.
Also added a setPoints() method that sets the points of an existing Blob that match the recordPoints
Strategy - if you want to create Blobs from data use the recordPoints and pass that data into the points parameter.
If you want to adjust an existing Blob then use the setPoints() method
If you want to record more than just the point data - for instance, x, y, color, etc. then use record() and set()
Or let the TransformManager handle it - it uses the new record() and set() similar to the transformControls record() and set() methods.
Also adjusted zim.setMask() to help handle dragging of a Blob object as a mask and added an example to the setMask docs
as well as an update to the snake at http://zimjs.com/code/zoo.html
Updated the other animals too including adding clone() to lion assets for multiple lions, putting snake into a function for multiple snakes
IMPROVEMENT - made zim.TransformManager also handle Blob objects as mentioned above - including the saving of, resizing and handling show and hide
Added getQueryString() method to return the HTML query string ?var=val&var2=val2 as an object with matching properties
Thanks Ami Hanya for the suggestion.
IMPROVEMENT - added loadTimeout parameter to frame.loadAssets() with a default of 8000ms - this is how long to wait for assets
Thanks Jonghyun Kim for suggestion and to CreateJS for already having that in the LoadQueue
IMPROVEMENT - adjusted frame.asset() to have a default "Broken Image" object (ZIM Circles) when asset is not available.
This can be adjusted with the new loadFailObj parameter for zim.Frame() - the object will have a type property of "EmptyAsset"
Also made loadAssets() accept a ZIM DUO configuration object.
Made loadAssets() work with files without extensions.
ZIM 6.4.0
IMPROVEMENT Added font support to zim.loadAssets() - for urls to fonts and also Google fonts
Pass in font in format {font:name, src:url, type:string, weight:string, style:string}
Any number of fonts can be passed in along with images, sound, etc. to loadAssets()
The name is what you give it and you would use that name in a zim.Label({font:"name"})
If you use http at the start of the font src it ignores the path parameter for that font
This allows you to use your own fonts in a directory but also add google fonts in the same loadAssets.
This piggy backs on CreateJS FontLoader() but consolidates the format and combines with other assets to load
Added a backdropClose parameter to zim.Pane() - thanks Ami Hanya for the prompting
BREAK moved the container parameter to the end of zim.Pane as most panes are added to the stage.
In the past, ZIM did not know the stage but now it has a ZimDefaultFrame with its stage
ZIM 6.3.3
UPDATED all ZIM Bits to version 6.3.3 using chaining, no namespace and loop throughout.
Would recommend, this way of coding - see http://zimjs.com/code/tips.html
Note: The ZIM Capture video series has not been updated and probably will not be.
BREAK the scale() method has been depreciated and removed - use sca() which works the same way
The new CreateJS has a scale property so ball.scale = 3; will set both scaleX and scaleY.
It appears that scale will read the scaleX. So, no more scale() method in ZIM.
Instead you can use sca() for chaining and then scale, scaleX and scaleY for properties.
BREAK - changed parameter order for TextArea and Loader - sorry - moved frame parameter to end
We now have zimDefaultFrame which will do in most cases and if we are in a second frame then pass that in to the frame paremeter
Added focus() property to TextArea (thanks Armin for the prompting) before was textArea.tag.focus() piggy-backing on JS focus of HTML tag
Adjusted OPTIMIZE, ANIMATE and DISTILL constants to work without the zim namespace with zns false - accidentally made them work when zns was true (so swapped)
IMPROVEMENT Fixed a glitch in run() method of Sprite() to allow for replay of non-label Sprites
since the change to normalized playback supporting non-sequential frames in SpriteSheets animations
Adjusted zim.place() to return object for chaining
IMPROVEMENT Adjusted zim.Rectangle to draw a normal rectangle if the corner is 0 was drawing a rounded rectangle with corner 0
then realized the border was not mitred as expected - it had little rounded corners instead of 90 degrees.
Updated zim.Accessibility() to put a z-index back to -5 that was accidentally left at 5 for testing. Thanks Frank for the find.
ZIM 6.3.2
Added split property to Parallax object to center the input value (with mouseX this defaults to true - the others false)
Thanks Raman for the prompting! IMPROVEMENT
BREAK Adjusted Parallax parameter order to layers, damp, auto, stage and give the object the default frame's stage
With the scrollX, scrollY chrome fix, this is a good time to adjust the stage parameter - it is the last of the ZIM classes left requiring a stage since the default frame addition.
This was primarily due to parallax being its own module without Frame - but now ZIM has Distill, so it is not that big a deal to loose parity with the old stand-alone parallax module.
Fixed mouseY to use stageH as default inMax rather than stageW (bug)
Adjusted scrollX and scrollY to test for document.documentElement && document.documentElement["scroll"+side]) || document.body["scroll"+side]
Before was assuming Safari only used documentElement and Chrome, Edge, Firefox worked fine - then Chrome seems to have changed its mind...
The Chrome change will BREAK any previous Parallax scrolls with scrollbar (not mouse) so if you made one, upgrade to this ZIM and it will not be broken.
IMPROVEMENT And newer ZIM has a Frame parameter called allowDefault - set that to true to let mobile scroll on canvas.
Any old Sprite work with Parallax, will probably need to set {spriteSheet:spriteSheet} as that parameter position changed a while back.
ZIM 6.3.1
Added cache parameter to transform() and automatically cache the handles and cursors unless set to false
Added a outerColor property to ZIM Frame() to set the color of the HTML body (background-color style)
Added outerColor parameter to the end of the ZIM Frame() class
Adjusted tweek in Sprite.run() to handle non-label input - that got lost with a previous change. IMPROVEMENT
Added startType parameter to wiggle() defaults to both but can set to positive to start positive or negative to start negative
Added onTop parameter to Blob so dragging it when controls gone defaults to brining the shape on top but can set to false to avoid this
Added snapToPixel parameter to Tile that defaults to true - this helps moved Tiles not have tiny gap
And added Tile parameters to documentation ;-)
Fixed Blob() and transform() to work with dblclick on mobile to toggle edit mode. IMPROVEMENT
ZIM 6.3.0
Created a transform() method for display objects that makes resize and rotate with little square handles, etc.
Added a TransformManager() class to handle multiple transforms and save / load data.
This is quite spectacular and is heading towards visual editors - perhaps even for ZIM HEP (7).
Thanks Ami Hanya for the idea and the prompting - hope this helps!
Made centerReg and outline return obj even if bounds not set (logs a warning)
Added stage.preventSelection = false; if frame's allowDefault parameter is true IMPROVEMENT
This fully allows mobile swiping, etc. to scroll a page when on the canvas (thanks Jonghyun)
The Manager lost its resizing when moved to support the new ResizeManager - that is back.
Fixed remove for one object in Manager
Switched zimify() to require third parameter true for adding scale - will be depreciating scale() due to conflict with new CreateJS 1.1
Start using sca() instead.
ZIM 6.2.2
Added frame.red to colors (thanks Alexa!)
Fixed glitch in Sprite.run() with wait, waitedCall, waitedParams.
These were just being passed through to zim.animate() but were left all as wait property names - oopsy.
Added pauseAnimate() and stopAnimate() methods (and functions) to basically replace pauseZimAnimate and stopZimAnimate
This depreciates the last two - which were titled that early on as dynamic methods before ZIM 4TH methods
All dynamic methods and properties had ZIM in them to avoid conflict
but now that methods are common, there is no need for ZIM in the method name ;-).
Fixed scale() which was turned off for glitch with setMask
Traced it to a possible conflict with canvas scale() method only with new CreateJS 1.0 and if other interactivity! - weird.
So scale() is back - all is well.
ZIM 6.2.1
Updated defaults for mic with SoundWave for baseline (0) and magnify (1).
Also cut the value off at 0 as it was going negative due to changes in ZIM 6.1.1
Glitch in zimify() when applying scale() - might be conflicting with CreateJS Shape and Canvas scale() method?
So removed scale() from zimify() - use sca() instead.
Adjusted ZIM Pages to set pages to original alpha rather than 1 after a transition.
ZIM 6.2.0
Updated ZIM to work with createjs.min.js the new CreateJS 1.0.0. IMPROVEMENT
There were a few minor depreciations to take care of:
getStage() became stage, setPaused() became pause, getNumChildren() became numChildren
These were like that to support versions older than 2015 but there is no real use in that now.
Note the gpu parameter of Frame that defaults to false.
Set this to true to use StageGL which is the major part of the release.
See bubbling video when we were preparing for this: https://www.youtube.com/watch?v=fUjyUpYdsM8
Added zim.Noise() class that makes OpenSimplex noise for art, terrains, etc.
http://zimjs.com/code/noise/
This is part of the Code module along with Damp and Proportion, etc.
Added a zim.Tile() class to let you tile an object (or objects with a ZIM VEE value).
You can choose set col and row parameters, add optional spacing and mirror as you tile.
This extends a zim.Container() and is part of the Display module.
Added a zim.smoothStep(min, max, input) function to the code module.
This takes an input value and outputs a value between 0 and 1
that represents a transition between the min and max with easing at both ends.
If you want the easing to be more pronounced, then reduce difference between min and max.
If the value falls outside the min or max it is set to the min or max.
Remember the return value is between 0 and 1 so you can multiply by max-min and add it to min
to get a value at the original scale.
IMPROVEMENT added drawImageData() method and imageData property to zim.Bitmap().
This allows you to draw pixel data into a Bitmap as you can with raw Canvas.
There is also reference to the proxyCanvas and the proxyContext for the canvas the Bitmap uses as source.
BREAK - there are new width and height parameters for Bitmap that come before the id parameter (breaks order).
ZIM 6.1.1
IMPROVEMENT Made Sprite.run() work with non-sequential frames and nested labels and next calls
(see CreateJS SpriteSheet docs for format of animation data - which can be specified in a JSON file).
The Dynamo was already working with these and now the run() method does as well.
Adjusted cloned sprites to have different default ids - as pauseRun() was pausing all cloned sprites ;-)
Made pauseRun and stopRun chainable.
Added a flowthrough override for zik() by passing value as {noZik:value}
which allows arrays and functions to be passed through as a value rather than something for zik to process.
Updated SoundWave with the following IMPROVEMENTS to the parameters:
baseline - removes this amount of amplitude from each data point (after operation is applied)
magnify - multiplies the data point by this much (after the baseline is removed)
reduce - subtracts this amount from each data point (after magnified)
ZIM 6.1.0
IMPROVEMENT Made zim.Accessibility work on iOS and mostly on Android - Stepper, Slider, Dial and ColorPicker still need work
BREAK - changed applicationName to appName, and highlight to alwaysHighlight and the parameters following are prefixed with AH
This is a solid week of programming for iOS Voice Over - visit on Slack for learnings and advice
Still untested on stand-alone screen readers but good on Windows Narrator, and the mobile readers.
Added currentValueEvent properties to Slider, Dial to get or set value and dispatch event if set changes value
normally, if we are setting a value with code, we can do whatever we would do in the event at that time
but with accessibility, on mobile, the options are being set by HTML and we want to trigger the event
Added a text property to the RadioButton button containers
Added a zim.ResizeManager() that extends zim.Manager and handles resizing Accessibility, Layout, Pages, Grid, Guide, TextArea and Loader
This is just a small class - a few lines of code.
Note - the Accesibility resize() will call any loader or text areas inside it...
BREAK Added decimals parameter to Accessibility before frame parameter
BREAK for the following:
Adjusted Stepper type parameter to stepperType parameter to avoid conflict with new type property for all Display Objects
Adjusted CheckBox type parameter to indicatorType parameter to avoid conflict with new type property for all Display Objects
Adjusted Dial type parameter to indicatorType parameter to avoid conflict with new type property for all Display Objects
Adjusted Indicator type parameter to indicatorType parameter to avoid conflict with new type property for all Display Objects
BREAK - changed buttons property of RadioButtons to an array rather than container - to match buttons array in Tabs and Pad
Made points property of Blob read and write instead of just read
Added functionality for selectedIndex and stepperArray of Stepper to work with "number" stepperType
Changed currentIndex to selectedIndex for Stepper - BREAKS - matches property name with other components (sorry)
Updated docs for TextArea to include size parameter which was there all along...
Adjusted Dial docs to read default 1 for step.
ZIM 6
Made ZIM Accessible - IMPROVEMENT
Added zim.Accessibility() class to handle tabbing to any ZIM Display Object and send messages to Screen Readers
http://zimjs.com/code/screenreader has a detailed example
You basically pass zim.Accessibility() an array of objects (with optional titles)
These will be tabbed to if they are on the stage and the title or a default title sent to the Screen Reader
There is also a talk() method to be able to send a message to the Screen Reader at any time
Gave all ZIM Display objects a type property that matches the class name as a String (case sensitive)
BREAK - removed former (marked as temporary) work with tab order in Tabs, Stepper, and Frame - this is all replaced and updated in zim.Accessibility()
IMPROVEMENT Adjusted Window to handle removing of Window while being rolled over (thanks Frank Los for the bug report)
Added SLACK support discussions https://zimjs.slack.com
Removed clone override from Swipe, Frame, and a few others that did not need it - just an oversight
indicator.currentIndex is now constrained from -1 to num-1 where num is the number of lights
Added readerDecimals parameter to Slider and Dial with default 2 decimal places the screen reader will read
Added keyArrows parameter to Slider, Dial and ColorPicker for arrow key usage if in focus
Added keyArrowsStep parameters to Slider, Dial so Screen Reader does not read all the decimals
Adjusted bar of slider for positioning when pressed - was half a step off due to button registration change - IMPROVEMENT
Also expanded hitArea on bar - IMPROVEMENT
Added spellCheck parameter to TextArea - default true but can set to false
Added an allowDefault parameter to zim.Frame that passes value through to CreateJS Touch.enable() method's third parameter
Note: the third parameter does not seem to be working so an issue has been added to CreateJS GitHub - thanks Jonghyun Kim for working on this with us
https://github.com/CreateJS/EaselJS/issues/898
This will also prevent Frame from using zil to keep the canvas still
You can set allowDefault to false and then manually remove the zil events for specific key or scrollwheel functionality
Although the ZIM namespace was removed in 5.5.0, it will be handy to remember that from version 6 on, the ZIM namespace is not required
ZIM 5.5.0
Added zimplify() global function. Note - this is different than zimify()
zimplify() removes the requirement to use the zim namespace IMPROVEMENT
Made full, fit and outside Frame template automatically call zimplify()
You can control this with the new namespace parameter of zim.Frame()
So for instance once you make a new zim.Frame() inside, you no longer need the zim namespace
var circle = new Circle(rand(100,300), frame.green).center(stage); // will work
Note: there is no zim namespace before Circle - used to be new zim.Circle()
Note: do not call variables the same as zim functions:
var rand = rand(100); // as rand() will no longer work after this!
The zim namespace still works.
zimplify(exclude) has an exclude parameter that lets you pass in a string command or an array of string commands
and then these will require the zim namespace
zim.wiggle() now supports ZIM DUO configuration object parameter (Thanks Frank Los for prompting)
ZIM 5.4.0
Added zim.gesture() with pan, pinch and rotate multitouch gestures for position, scale and rotation
zim.gesture() features a bounding rect, min and max scales, rotational snapping and pan sliding.
IMPROVEMENT This is a new method under the Methods module for all ZIM Display objects
Also added associated zim.noGesture() and zim.gestureRect() Methods
for removing some or all of the gestures (and paradoxically, adding them back)
and dynamically setting the bounding rectangle for the gestures.
Works with the touch parameter set to true for zim.Frame() which is the default setting.
ZIM 5.3.2
Adjusted zim.decimals() so that addZeros is the number of 0 spaces after the decimal
addZeros is no longer a Boolean BREAKS
and a new parameter, addZerosBefore, is the number of 0 spaces before the decimal
Also added a time parameter that just turns the decimal dot into a colon to handle minutes and seconds
Added a total property to the ZIM intervalObject for the zim.interval() that is -1 for infinite
Added a "clear" transition type to Pages that fades out the old page then fades in the new page each at half the transition time
Added transitioning property to pages so can test if pages are in transition (as they are cached)
Adjusted docs - the radius of a zim.Circle is its real radius before scaling and setting the radius redraws the shape
as opposed to width and height which are not necessarily the bounds but can be a scaled value
Fixed multitouch with ZIM - was using: if (touch) createjs.Touch.enable(stage, true);
And yet unfortunately, the second parameter is true for singleTouch! Ouch.
IMPROVEMENT So now using: createjs.Touch.enable(stage);
Adjusted zim.drag() so that drag Ticker is not removed if any touches are still active
ZIM 5.3.1
Added simple array of pages to Pages class if you do not need swipe data for each page
Also, now use the default stage as the default for the holder of Pages and moved the holder parameter to the end
BREAKS - this breaks the parameter order of the Pages class
Since introducing the default stage, there are a few of these breaks.
Swapped zim.Ticker.has(function, stage) as stage will default to default stage BREAKS parameter order
BREAKS - moved the index to the second parameter of center and centerReg and the add to the last parameter
as more often than not, we are using centerReg and center to add the object to the stage and
the second most popular parameter is the level (index). Sorry, this breaks the parameter order for older apps
Added an optional index value for Pages go() so can use page object or an index matching the pages array order
ENHANCEMENT - added a check to zim.Ticker.add() so that it will not add the same function more than once
added blendMode property to all zim Display objects that is the same as compositeOperation
Fixed a glitch in Dial when min is greater than max - the ticks were not showing (used Math.abs() for tickNumber)
Adjusted ColorPicker to default to drag of false if there is no buttonBar.
ENHANCEMENT - fixed intermittent zim.interval() run-on after clear()
ENHANCEMENT - zim.Emitter() had a faulty assignment to "this" in the added function affecting dispose() on multiple emitters
Thanks Frank Los for reporting the bug
ZIM 5.3.0
Added ZIM SoundWave() to get frequencies from sounds or mic
Also adjusted the order of ZIM and the Documentation to the following:
WRAP - CODE - DISPLAY - METHODS - CONTROLS - FRAME - META
Display (formerly Build) has the basic display elements, shapes and components
Methods (formerly Create) have the methods that all display objects have like drag(), center(), etc.
Controls (formerly Pages) have objects for layout, swiping, pages, motion, parallax, etc.
Removed zim.addDisplayMembers() and fully replaced it with zimify() BREAK
ZIM 5.2.2
Adjusted interval doc description to include ZIM VEE and zik.
Added color parameter to Pane in the docs.
Adjusted glitch in Tabs when assigning widths to tabs without widths.
Added ZIM VEE and zik to control length of Blob so random blobs can be made
Added rotation, scaleX and scaleY read only properties to MotionController
and adjusted so no object is needed - now we can use MotionController as pure data
Adjusted zim.wiggle() to work on non display objects.
Added time property in the Docs for the zim.interval obj return value
ZIM 5.2.1
Adjusted zim.Emitter to properly set pool number when ZIM VEE values passed for num and interval
Now uses min of interval and max of num options - would recommend not pooling if using function values for either of these
Also fixed removing of particles if pooling is turned off
Adjusted the pause method of the zim.timeout return object - so unpausing plays the remaining time properly
Made zim.animate and zim.move apply zik before splitting scale into scaleX and scaleY so aspect ratio is kept
ZIM 5.2.0
IMPROVEMENT Added StageGL support to ZIM Frame - as a gpu parameter which defaults to false - so set to true for WebGL
CreateJS provides an isWebGL property of the stage you can use to get whether WebGL is being used
Added gpuObject parameter to specify extra stageGL parameters
Added refresh to resize for StageGL
IMPROVEMENT Added nextFrame parameter to frame to pass interaction to next stage (for regular Stage and StageGL)
Added zim.convertColor() to convert from string to hex or hex to string (StageGL color accepts hex only)
Added spriteSheet parameter to zim.Sprite to accept a CreateJS spriteSheet
Prior to this the Sprite would make a SpriteSheet from JSON or image and parameters input
This was added because of the cool CreateJS SpriteSheetBuilder to dynamically create SpriteSheets from Shapes, etc. at run time
Fixed the clone property of Sprite
Adjusted Grid and Guide to auto add to obj parameter or the default stage - and fixed interval bug since zim.added() was used (thanks malus on GitHub)
Fixed bug in zim.Frame where two full mode canvases were turning off Ticker stage updates on the first canvas when resized
Fixed bug in zim.Frame was referencing keyword frame in key events when it should have been a reference to the object (that)
ZIM 5.1.0
Added a zim.Blob class to make editable blobs - with bezier curves
This is added after zim.Triangle and is very similar to the other zim shapes but a blob ;-)
Blob has a number of types of bezier curves that can be accessed by double clicking the points
Edits to the Blob can be recorded with the record() method and then recreated by passing the recording into points parameter
Created a global variable zimDefaultFrame for the first frame made
zim.Ticker.add(function, stage) and other Ticker functions no longer require stage
The zimDefaultFrame's stage will be used if left out of add()
This is fine for the majority of times when there is only one stage
BUT - if more frames are used then the associated stage needs to be passed to update that stage
IMPROVEMENT Added a failed event to frame for when canvas is not supported (thanks Frank Los for the prompting)
Added a type parameter to wiggle() so it can wiggle negative, positive or both (default)
Adjusted zim.interval to unpause immediately as an option
Made outline() mouseEnabled = false;
Made ticks a zim.Shape rather than a createJS.shape so it has ZIM 4TH methods
IMPROVEMENT Adjusted zim Emitter pause for the freeze - for some reason not reading stored that.zimEmitter... used local variable instead
Added frame.altKey, frame.ctrlKey, frame.metaKey, frame.shiftKey properties to specify key states
IMPROVEMENT Made Pane close and drag automatically resize TextArea and Loader objects (due to HTML overlay)
IMPROVEMENT Adjusted Loader to save as png by default or can specify type parameter of "jpeg" for jpeg (png more widely accepted)
ZIM 5
ZIM VEE AND ZIK
Introduced ZIM VEE (Roman Numeral 5) values that let you submit options for parameters to be chosen later (uses the new zik() function)
Added zik() global function to pick randomly from an Array or a function result or a random number based on
an object with min, max, integer, negative properties like the params for zim.rand()
ZIM EMITTER AND WIGGLE
Added zim.Emitter() to emit particles for fireworks, smoke, flames, falling objects, hair, grass, etc.
This is a large class with 30 parameters some of which accept ZIM VEE values
Examples can be found here: http://zimjs.com/code/particles
Added zim.wiggle() to randomly go back and forth between the value passed to it - uses zik() and animate()
ZIM ANIMATE AND MOVE
Adjusted zim.move and zim.animate to accept ZIM VEE values for many of the parameters
Including obj, set and props properties and overall parameters except for params, loopParams, waitParams, sequenceParams
These will then be filtered through zik() to pick a random values
This allows for a delay before a random value is picked - handy for passing info as a parameter
Used by zim.Emitter() for instance to pass random properties and animate settings
Added feature to zim.animate and zim.move to animate relative to current property value
To do this the parameter value in the animation object is put in a string - can include negative sign
Also works with the set parameter to set relative starting values
Fixed rewind with set parameter active - hopefully that works - gets complicated
zim.move() and zim.animate() - added waitedCall, loopWaitCall and rewindWaitCall to call functions after waiting and before loopWait and rewindWait
zim.move() and zim.animate() - added waitedParams, loopWaitParams and rewindWaitParams to pass params to above (or callbacks receive the target)
This BREAK parameter order - sorry! Hopefully by this time you are using ZIM DUO configuration object technique
Adjusted rewindCall and loopCall to happen after rewindWait and loopWait - so this may BREAK as it was before the waits!
Fixed a glitch in stopZimAnimate(ids) when removing animation with ids with single animations across multiple targets - now works
GENERAL ADJUSTMENTS
Fixed zim.Label used Number.isNaN which is not supported on mobile so changed to older double test. IMPROVEMENT
Fixed a bug in zim.copy - an undeclared var was flattening nested objects
Adjusted zim.copy to ignore objects that are not an object literal - now will copy references to zim objects rather than breaking
Adjusted zim.Triangle() adjust parameter to move shape rather than registration - could BREAK location of triangles
as usually you are adjusting the centerReg and that just was negating the adjustment
Added rotation to cloning of props - this was an oversight BREAK - but in a good way
adjusted clone for shapes to clone latest color and border properties
(and width and height for Rectangle and radius for Circle) possible BREAK
Added read only framerate property to docs for zim.Ticker - use setFPS() to set framerate
Added a has(stage, function) static method to zim.Ticker to check if the Ticker has that function for that stage
Fixed a glitch in zim.interval where it was occasionally not pausing due to race condition
Adjusted obj.clear to before the next() function in zim.timeout to prevent errors on occasion
Added an zim.added() function and ZIM 4TH method to check if object has been added to the stage
CreateJS has an "added" event that triggers when an object is added to another container
but this container may not be on the stage.
added polls with a setInterval every 100ms to see if the object has a stage property
Once it does then it calls the callback and removes the interval
Adjust scaleTo to take into account current scale - this could BREAK code if you had accommodated this already
Adjusted zim.rand() with respect to a=0, b=0 explicit parameters
was returning Math.random() now returns 0. Only no parameters return Math.random() - might BREAK
ZIM 4.9.2
Added zim.angle(x1, y1, x2, y2) function to find angle between two points relative to positive x axis
part of the code module after the zim.dist() function - these are functions not methods.
Added zim.placeReg(obj, id) function and zim 4th method to place locate a registration point relative to the obj
this then gives an output in the console as you drag and drop a little cross indicator (like place())
Adjusted zim.place() to output x and y and pos() data
IMPROVEMENT Adjusted the zim.Label to be up one pixel in the y on a button
IMPROVEMENT Fixed a bug in the Window where multiple windows would scroll together - missed a var declaration - oops (thanks Frank Los)
IMPROVEMENT Adjusted zim.Pages to remove its children at the start - except for the currentPage (thanks Laura Warr)
IMPROVEMENT Adjusted zim.Pages to not accept swipes or button clicks to go() until transition is finished (thanks Meagan Peat)
The ZIM Pages example http://zimjs.com/code/pages has been updated to modern zim code showing Pages, Layouts, Grids, Guides, and MVC
Fixed bug in frame.makeCircles - we had removed the frame module colors in favor of frame.blue, etc. and not adjusted makeCircles
ZIM 4.9.1
Added a resize() method to the Window to resize the dimensions without scaling the content
This allows independent scaling of the content to fit the width for instance in a long vertical scroll
Added a minSize property to the indicator property of the Window - already had the size property
For example:
indicator.size = 6; // the width if vertical or the height if horizontal
indicator.minSize = 12; // for the height if vertical or the width if horizontal
Added scrollwheel support to Window
Firefox has a canvas redraw glitch where it flashes unscaled/unpositioned content on full template resize
Implemented a fix where over 40ms the ticker.update is set to false and at 20ms the resize happens
It seems the requestAnimationFrame is catching the stage in a null dimension state or something...
Anyway - only on Firefox with full mode and a Ticker running - and fixed now. IMPROVEMENT
Adjusted Pad to default to an array of keys that match the rows and cols (of course!)
Adjusted Label to properly valign bottom and center when text is more than one line CHANGE
Also adjusted Label so bounds change when the text changes
ZIM 4.9.0
Added Loader class to upload files from desktop to canvas zim.Bitmap object and also save to new window
Added TextArea class to create an editable text box - it uses the HTML textarea tag and CreateJS DOMElement
Added outlineColor and outlineWidth to Label IMPROVEMENT
Added selectedIndex to ColorPicker docs
Adjusted a few bugs with arrows in vertical steppers - hopeful that is all fixed - quite complex
Made alpha change dispatch change event as well from ColorPicker IMPROVEMENT
Added return object of the animation target for a series
Fixed doubleclick glitch in zim animate created when a delay in protect was placed for animation series IMPROVEMENT
Added dashed parameter to Rectangle, Circle, Triangle, and Button
and made either borderColor or borderWidth create a border and make the other parameter have a default
and made shapes be transparent if no color is specified AND a border is specified BREAK
otherwise passing null for the color will default to black (as it has all along)
This was a pain when you wanted a border without a fill - you had to set the fill to "rgba(0,0,0,0)"
Fixed Label clone when there is a backing - must clone the backing too ;-)
Rearranged vertical Slider to have min at bottom and max at top BREAK
ZIM 4.8.2
Added tab control in frame with tab highlight, highlight object and a number of parameters IMPROVEMENT
This is demonstrated in the LeaderBoard of http://zimjs.com/code/zong
Will be expanding tab control - currently steppers and tabs - although any display object
can be added manually to the tabOrder. So now tabbed to objects can receive an Indicator
Looking into screen reader support as well - although many things made in ZIM are visual.
Updated zim.fit() to take into account bound x and y when fitting.
ZIM Game 1.0.1
LeaderBoard has integrated key and gamePad controls for entering name IMPROVEMENT
An editing page has been set up to update five security options IMPROVEMENT
Automatic bad word filter has been added to the ZIM data mode IMPROVEMENT
ZIM 4.8.1
Stepper updates - added press, rightForward, downForward parameters to Stepper BREAK
changed arrows to represent visual arrows - so set to false to hide them
added arrowKeys parameter to use or not use arrow keys - default true
changed default vertical forward direction to down unless numbers and then it is up
can change these with rightForward and downForward parameters
made it so mousedown immediately advances stepper (unless press is false) IMPROVEMENT
this was an oversight - got missed when implementing hold parameters
or perhaps we did not want it to advance immediately if users are wanting to hold drag backwards...
Adjusted Label to accommodate backing in its bounds calculations - assumes if backing the bounds are that of the backing
Removed the default ZIM Wonder server parameter value as it runs the risk of being out of date IMPROVEMENT
Implemented a zimserver_url.js file that will always hold up-to-date domain:port urls for ZIM Socket, ZIM Wonder, ZIM Distill
In doing so swapped the server and notes parameters so this BREAKS previous signature - as server is required and notes is optional
ZIM 4.8.0
Added zim.GamePad() to handle game controller input for buttons and sticks IMPROVEMENT
Added zim.MotionController() to handle moving a target object with the following types: IMPROVEMENT
mousedown, mousemove, keydown, gamebutton, gamestick, swipe, manual
includes adjustable speed, damping, flipping or rotation, key/button mapping, firstPerson mode, etc.
Damp and ProportionDamp now return the object for chaining
ZIM 4.7.3
Changed zim.Ticker to use requestAnimationFrame with default no throttle IMPROVEMENT
Added setTimingMode() static method to Ticker to go back to synched or timeout modes
setFPS(mobile, desktop) is still available but can lead to less than smooth performance
(NOTE: the initial launch of 4.7.3 was not quite right so we patched it a few days after)
added zim.sign(num) to return -1, 0, 1
added zim.constrain(num, min, max, negative) to constrain number to within and including bounds
added zim.dist(x1, y1, x2, y2) to calculate the distance between two points
Adjusted Frame to stage.update() on full mode resize IMPROVEMENT
After canvas adjustment a few updates ago this was causing flicker
or things disappearing until next stage.update()
The stage will not update in full mode on resize if zim.OPTIMIZE is set to true
You will have to manually update the stage in your resize event function to see anything on the stage
Adjusted zim.Pane to not do anything to the text when you change it
If you want the text to be centered always, then start off with a zim.Label with align:center
ZIM 4.7.2
frame.loadAssets() now returns a zim.Queue object where we can capture events for a specific loading
Also there is an isLoading property on the Queue and reference to the createjs.LoadQueue with a preload property
The frame also captures these events for all queues as before and now has an overall isLoading property.
Thanks to Frank Los for prompting the changes and helping with the solution.
loadAssets() has a new time parameter to force the preload to wait at least this long in ms.
This can be used in testing and for when you want a minimum time to show a preload message
Added a showing property to zim.Waiter() and zim.Pane()
You can now loop an animation inside an animation series forever - it just will not proceed to the next animation
The set parameter for zim.move() and zim.animate() now lets you set scale (the convenience property for scaleX and scaleY)
Went back two updates to fix the loopCall parameter which was not calling when looping forever
since the change to the loopCall to not call on the last loop - use call for that (nice sentence!)
Added a zim.Dynamo() class to handle dynamic Sprite animation
You pass the Dynamo a Sprite, a base frames per second an optional label or start end frames
The Dynamo should be able to parse any type of CreateJS spritesheet data including nested animation labels
It turns these into an array of frames animates through the frames with percentSpeed available to adjust dynamically
The Dynamo also allows you to pause with a time delay or a on a frame number - and of course, unpause
Added a zim.Accelerator() class to handle dynamically changing speed and pausing of Dynamo and Scroller objects
This allows you to control the objects from one place to dynamically change the speed of a scene
Upddated the Scroller class to allow for pausing and percentSpeed
And the Scroller no longer has to be added to the stage to work
and in either case, the scroller backgrounds do not have to be on the stage to make a Scroller
See http://zimjs.com/code/zide/ for an example
ZIM 4.7.1
Added zim.interval(time, call, total, immediate), zim.timeout(time, call) that use requestAnimationFrame
Added zim.siz(width, height, only) for chainable size method
with either width or height, will scale the other to keep proportion unless only is set to true
Removed Dashed Lines - as CreateJS now does a dashed stroke. (BREAK)
Fixed Frame in full mode to resize canvas dimensions rather than create large canvas (IMPROVEMENT)
due to unexpected repositioning in apple devices (of course).
For instance, how can a canvas with no left and top be moved hundreds of pixels off the screen to the left
when switching orientations? Even when left and top are set to 0px; Get your act together Apple!
Problem is... it is a problem for ages.
Added a delay parameter to frame to make mobile devices redo a resize event to catch proper dimensions - default 500ms
made Pane and Waiter show() and toggle() chainable
adjusted zim.rand() to convert parameters that are NaN to 0
Adjusted zim.animate() and sprite.run() to let inner animation series loop forever
this will make the looping forever series the last animation to run in the series
added frame.clear (alpha 0), frame.white, frame.black, frame.faint to colors - faint is alpha .01 good for invisible interactivity
ZIM 4.7.0
major update to zim.animate() to run animation series
also better id control for pauseZimAnimate() and stopZimAnimate() IMPROVEMENT
now documented as proper methods and with optional global control on zim directly.
removed zimTween from move() and animate() and added reference to zimTweens (BREAK)
removed stopZimMove and pauseZimMove - use stopZimAnimate and pauseZimAnimate for all (BREAK)
adjusted loopCall to not run after the last loop - that is when call runs (BREAK)
changed rewind props to be set after initial wait
added set parameter to move() and animate() to set properties at start of animation
updated docs for move() and animate()
Sprite.run() uses new animation series and stopRun() and pauseRun() use animation id system.
Sprite has json parameter which replaces spriteSheet parameter BREAK
The SpriteSheet is now made internally from the json
can still pass in rows and cols as well instead of json
added makeID() method to code module
frame now gives the stage read only stage.width and stage.height properties
added single param (default false) to zim Dictionary
added reg() and sca() methods for consistent shortcuts to regX, regY, scaleX and scaleY
ZIM 4.6.0
added addTo() and removeFrom() functions / ZIM 4TH methods
these are wrappers for addChild() / addChildAt() and removeChild()
except they are consistent with center() and centerReg() where the obj comes first and the container is in the brackets
circle.addTo(stage); // rather than stage.addChild(circle);
circle.center(stage);
circle.centerReg(stage);
circle.removeChild(stage);
This also allows us to chain objects easier
var circle = new zim.Circle().addTo(stage);
var circle = new zim.Circle().addTo(stage).drag();
Added pos(x, y), mov(x, y), alp(alpha), rot(rotation), ske(skewX, skewY) functions / ZIM 4TH methods
chainable functions for common properties (a little shorter than set() method)
Note: pronounce mov() as "mawv" to differentiate from move()
mov() sets relative position in x and y - like circle.x += 100;
var circle = new zim.Circle().center(stage).mov(100); // shifts shifts to right 100
Added zim Swiper() class to Pages module to act like invisible slider with damping
Overhauled zim Sprite() to include the SpriteSheet and data creation
also added a run() method to animate the Sprite over time (see advanced ZIM Capture)
This gives two line Sprite animation with better control (BREAKS signature)
It still works with a CreateJS SpriteSheet if desired.
And optionally, you can pass in the JSON for the spritesheet.
Added keydown and keyup events to frame - wrappers for window events
Pages now dispatches a pagetransitioned event - not pageTransitioned (BREAKS)
removed secondary reference to colors in frame (BREAKS)
added frame.gray (already have frame.grey - these two are the same)
arrow keys for stepper now move secondary steps if in cross direction
also made stepper secondary arrows only show up for type of number
adjusted loop() to pass index, total, min, max, obj consistently as final params to call (BREAKS)
also added internal bounds to loop to handle out of bound step, start and end values
adjusted loop documentation to be more clear - should be the end of loop adjustments
corrected the zim Swipe docs to not include container properties
corrected frame variable (should have been this) to fix bug in strict mode
adjusted scaleTo() to scale to 100% in x and y when both are null - still default "fit"
so just using rect.scaleTo(stage) would fit the rect on the stage
previously, passing in no percentages would not scale at all.
adjusted typo in parallax Docs - scrolly should have been scrollY
rand() now has negative parameter to let you choose from a positive or negative range
ZIM Frame loadAssets() has been adjusted to include extra file types:
JSON, Text, XML, and SVG data can be loaded (as per CreateJS PreloadJS info)
ZIM 4.5.0
added a from parameter to zim.move and animate
you can set the from parameter to true to animate to current values from properties provided in obj
sequence in move and animate now works on a container as well as an array
added sequenceReverse parameter (BREAKS parameter order!!!) to handle sequencing through children (or elements) backwards
added a zim.ANIMATE global constant to prevent move and animate from running (eg. while testing)
added a check to move and animate for targets not on stage - to avoid the obtuse Ticker error message
IMPROVEMENT: updated Stepper with a bunch of new parameters:
hold, holdDelay, holdSpeed, drag, dragSensitivity, dragRange, type,
min, max, step, step2, arrows2, arrows2Scale, keyEnabled
also set keys work on Stepper only if they have focus or are first made
added focus property to Stepper
changed the strokeColor to borderColor - BREAKS old code... (sorry - now we consistently use border rather than stroke)
adjusted stepper to not return when setting currentIndex and index is same as currentIndex (might have changed the stepperArray)
also made setting the stepperArray update the currentIndex which will refresh the view
adjusted slider, dial, stepper currentValue to return if value set to undefined
zim.decimals(num, decimals, addZeros) will add zeros to decimal place if missing - for presentation
IMPROVEMENT: set drag to work if mouse is outside stage - on now by default - should have been on (oversight)
added a fadeTime parameter to Waiter and Pane to fade in and out for the provided milliseconds
added step, start and end parameters to zim.Loop took away total parameter (BREAKS)
added ZIM DUO to loop now that parameters are longer...
gave Circle a radius property get / set - that redraws the circle (not scales it like width and height)
Circle, Rectangle, Triangle parameter change - BREAKS zim DUO for the following:
color (not fill), borderColor (not stroke) and borderWidth (not strokeSize)
also the methods setFill(), setStroke() and setStrokeColor have been removed (BREAKS)
added borderColor and borderWidth properties - already have a color property
changed the borderThickness properties in Button and Window to borderWidth to match (and match css) - BREAKS zim DUO for these
added width, height, fullscreen parameters to zgo and shifted modal parameter to end (BREAKS)
made rand() set integer to false if a or b are not integers
added backing color to ColorPicker
fixed little glitch in animate() ticker paramater
Reordered EXAMPLES so ZIM 4TH versions come before the traditional zim functions
ZIM 4.4.0
IMPROVEMENT: hitTests improved by having mathematical hitTestBounds as filter
made it so can't add gradient or gloss if custom backing
fixed hitArea on indicator when square type is chosen
fixed indicator to update selectedIndex before dispatching change events
added swipe to window doc
made zim.loop() the name for all zim loops again and adjusted docs (BREAKS)
ZIM 4.3.1
Added read/write width, height, widthOnly, heightOnly properties to all zim displayObjects
Could BREAK old code where width and height were read directly from getBounds().width and getBounds().height
now they are getBounds().width*scaleX and getBounds().height*scaleY so they match the set width and height.
This is a fairly big change - now when you can set the width and this will adjust the scale to make the shape match the width inside the parent bounds
If you want to get the width of the bounds without scale - then use getBounds().width
It also means that the scale will probably be changed when you set width and height.
Hopefully this will not cause too many problems. We went through the 64 ZIM Bits and adjusted a couple places
In one case we had to go back to the getBounds() but in another case it helped the app be more intuitive and we removed a tricky scale call
Added prop(property, value) method to zet to get or set the a property (or properties) of the set.
Adjusted docs to more explicitly list CreateJS methods, properties and events for each Build Module class
Made RadioButtons have a default of A, B, C
Fixed zim.drag surround to handle bounds with x and y not equal to 0 (like for a circle)
Fixed rotated container origin marking for zim.outline
Removed bound requirement from center. Removed container bound requirement from centerReg
ZIM 4.3.0
introduced zim.extend(sub, super, override, prefix, prototype) which piggybacks on createjs.extend and createjs.promote
now all extends are done using this so that ZIM classes can be properly extended
this means that the createjs namespace must be loaded before ZIM - too bad, but that's okay
So if you load ZIM before CreateJS this BREAKS and gives a ZIM message followed by an error - most likely Frame is not a function
Just put the createjs script call above the zimjs script call.
all classes are now one function - had to add the scope parameter (this) to zob() for these.
IMPROVEMENT: fixed memory leak in Button - was not clearing mouseout event - off() sometimes does not work!
updated RadioButtons dot to default .7 alpha in color
fixed sequence to take into account the new loopCall and loopParams
had to adjust loop() so that a return is used to continue and a return with a value is used to break
return "continue" no longer continues it actually breaks - the function is only one version old so may as well fix it
moved loop() to code module and made loopChildren() in Create module for containers - may adjust this later
this BREAKS if you were using loop() on container
updated the Button description and added pizzazz to icon param description
IMPROVEMENT: added a rollPerSecond parameter to zim.Frame with a default of 20 checks per second (was set at 10)
ZIM 4.2.1
added a setBackings(newBacking, newRollBacking) to match the setIcons() in Buttons
also made toggle work for backings if there is no icon set and it is not a string (to toggle label)
adjusted the docs to wrap the signature of the function when you open a section
fixed clone of button to make sure all new paramters get cloned
adjusted hitArea of label to not be stored as the backing when no backing
as it caused clone problems - the clone then thought a backing was set when it was just the hitArea
ZIM 4.2.0
added icon and rollIcon parameters to button to accept display object like pizzazz2 icons
added setIcons(newIcon, newRollIcon) method to button to allow dynamically changing the icons
added toggle and rollToggle parameters to button to handle toggling the label or icons
added toggled property to button that returns true if in toggled stage and false if in original state
added toggle() method to button to force a toggle (or set state to true or false)
added 2px to height of text in labels to accommodate descenders
added loop() function to Create Module to loop or loop through children of container
tested with 1000 children and no speed difference
added isEmpty() function to test if object literal is empty
added loopCall and loopParams parameters to move() and animate()
and adjusted call to call after all loops and rewinds have finished
(always thought this was what it was doing but realized NOT)
this change BREAKS the signature - sorry - but hopefully you are using ZIM DUO config for this
added protect parameter to move and animate to ensure animation finishes
cancels any subsequent animation calls
added override parameter to move and animate to allow multiple animations on an object
without having to set props:{override:true} - does the same thing
updated ZIM 4TH version of move and animate to full parameter set
removed pauseZimMove, stopZimMove, pauseZimAnimate, stopZimAnimate when tween is done
added color property to stage to get or set background color (there already is a color parameter)
fixed dial setting currentValue if max is less than min
added read-only angles property [left, bottom right, top right] to Triangle
IMPROVEMENT:adjusted zim.Dial to record last angle when clicked to avoid wrapping when not supposed to
ZIM 4.1.3
added stage.update to colorPicker when indicator present (follows zim.OPTIMIZE)
made indicator #111 when color is #000
added copyMatrix function to Create Module and use it in move, animate, setMask, drag and clone
made move and animate work with setMask to animate the mask (like drag drags the mask)
ZIM 4.1.2
ColorPicker has circles property added for circle swatches
ColorPicker has buttonBar property added to be able to set to false and hide buttons
added indicator parameter defaulting to true that shows currentColor
added selectedIndex property to ColorPicker
recorded lastColor and lastAlpha when setting selectedColor, selectedIndex and selectedAlpha
added id parameter to place method
IMPROVEMENT: fixed Button to center custom label after label bound changes in 4.1.1
added specific clone methods to Rectangle, Circle and Triangle
added rollPersist parameter and property to Button to keep rollColor when button being pressed even if rolled off
made slider use rollPersist=true
added gapFix back to scroller - still getting very thin gap if changing speeds - gapFix:1 should do it - default 0
adjusted move and animate to not run another animation for properties that are currently looping or rewinding
when these are done or the tween removed with stopZimMove or stopZimAnimate then animating these properties is okay again
problem was the tweens if overwritten would start from their last stopping spot
ZIM 4.1.1
added backing to Label
added position:absolute to Frame (fit, full, outside) so no styles required up top now
removed depreciated stageW and stageH properties from Frame (use width and height) (BREAKS)
fixed up bounds of label (I hope) and adjusted button placement
added fontOptions to Label clone
this could affect making a custom cursor out of a label - now need to set the mouseEnabled of label false
ZIM 4.1.0
Added backing and rollBacking support to zim.Button and zim.Pane (not rollBacking)
IMPROVEMENT: Fixed hitArea on zim.Label when centered
changed Pane move cursor to pointer
changed Pane backing property to backDrop to avoid confusion with new backing parameter
added toggle() method to Pane
added pointer cursor to Pane display when displayClose is true
ZIM 4.0.1
Updated docs to have proper sentences for description.
Adjusted zim.Triangle() to make isosceles have a unique base number
(makes triangle symmetrical about the Y axis). This causes different behaviour.
Fixed glitch in dragRect() for when no previous rect specified and localBounds set to true
Refactored zim.Window - added paddingVertical and paddingHorizontal
and indicatorDrag - which BREAKS the signature - sorry.
ZIM 4TH - 4.0
added zim Container, Shape, Sprite, MovieClip display wrappers
these extend are made from CreateJS counterparts
but they all have the ZIM Create functions added as methods
and they also have read only width and height properties based on getBounds
all ZIM display objects now extend a zim.Container
fixed zim.Drag glitch with removing zimDragTicker
fixed label to center properly when text is updated
adjusted documentation on width and height of button read only
added reference to AbstractContainer methods in all display object docs
added reference to createjs docs in docs
added RETURN values in documentation for every function
added EXAMPLE for every command in the documentation
added PARAMETERS for every function in ZIM Create module (already in other modules)
added global function isDUO to test if parameters are in config object format
added clone to all objects including cloned basic properties
and recursive cloning for Container and Window
moved Parallax and Scroller to the end of the PAGES module
this gives clean break with all display, shapes and components in BUILD
Renamed ZIM DISTILL to ZIM META
and added zim.Wonder to META
added a check to see if objects are on stage for all hitTests
added zil to fit and outside scale modes too
added fontOptions to zim.Label - for ordered font-style font-variant font-weight
did not realize that these can't be put after the font-size... sigh
adjusted gloss and gradient to not go over the border of the buttons
added startBounds (true) to drag() set to false to ignore bounds on start
inserted color parameter into Frame after height - will BREAKS legacy code
added css parameter to animate - set to true to animate html tags with css
added PARAMETERS section to all documentation
made section titles different color in docs
made example for each and have that be boxed
added props to normal parameters for animate and move
ZIM 3.1.4
Removed fps from animate and move - signature change at end!
Handle fps via zim.Ticker
adjust Frame to recognize tag scaling inside DOMContentLoaded
added one, two and three properties giving points for corners of Triangle
adjusted cloneAsset() method of Frame to clone id
ZIM 3.1.3
Fixed Ticker default fps
ZIM 3.1.2
added id to asset property on assetloaded event object
added getStage method to sound instance of asset so can animate volume and pan
added stopZimAnimate, stopZimMove, pauseZimAnimate and pauseZimMove
for the target of animate and move functions
tab to flatbottom default
added scrollXMax and scrollYMax to window
added index to center and centerReg that works like addChildAt()
ZIM 3.1.1
added Window class to Build module
added slideSnap of vertical and horizontal in drag create module
added slidestop event to documentation for drag
added lineWidth and lineHeight properties to zim.Label
added cloneAsset() to zim Frame for copying images and keeping width and height props
ZIM 3.0.4
adjusted zim.Button to center the logo
todo - make hitTestRect and hitTestCircle have an offset parameter
todo - change tabs and grids to use hitTestGrid for rollovers and hits
add a backing color and padding parameters to label
ZIM 3.0.3
added zim.mask() to work with ZIM Rectangle, Circle and Triangle
adjusted zim.Frame to default to tagID + "Canvas" for canvas ID
no changes to zim.Frame if on any other scaling mode
ZIM 3.0.2
rotated zim.outline()
fixed bug in ZIM Dial so it properly takes into account custom start position in dragging calculations
adjusted buttons to have centered labels
ZIM 3.0.1
added valign to Label params
valign - defaults to "top". Options: "top", "middle / center", "bottom"
fixed DUO for center() (was pointing at centerReg)
fixed center() bug with rotated and scaled containers
adjusted outline() to show rotated origin
ZIM TRI - 3.0
added align and valign to frame
changed ZIM Frame to work on DOMContentLoaded and for delayed canvases, on document.readyState=="interactive" or "complete"
also made resize event trigger for all scale modes not just full
added sound parameters to asset().play(params) for {loop:-1, volume:.5}, etc.
drag default dragging cursor is pointer rather than resize
added swapHTML to swap innerHTML of two tag references
added zet(selector) function with on(), css() methods to apply events and properties to selectors
added a tag option for ZIM Frame scaling parameter to put Frame into an HTML tag
like a full setting with no scaling but in the dimensions set by the tag
added a scale property (read only) to ZIM Frame (will be 1 for full and none)
added an x and y property to frame position added by Frame (0 and 0 for full and none)
added a canvasID parameter to ZIM Frame to handle multiple canvases on one page
added a readyState check to ZIM Frame in case loading it after the window load event has triggered.
added add parameter to centerReg in DUO modes
added a zim.center() function that works like centerReg with a container but does not center the registration point
adjusted centerReg() and center() to move to center relative to container even if not adding to container
adjusted centerReg() to test for bounds on container
added multiple stage support for ZIM Ticker
adjusted ZIM move and animate to wait 200ms before removing Ticker function to let animation finish
added objects and values properties to ZIM Dictionary for easy traversal
added rotation support to zim.Outline
adjusted hitTestCircle() and hitTestRect() to check for a point in the middle too
made zim.Drag() automatically remove the tweens from dragged object
and then set a parameter called removeTweens which defaults to true
made ZIM drag add to Ticker queue only on mousedown and off on pressup
added displayClose parameter to zim Pane() to default to true
if display backing is pressed it closes unless drag set to true of displayClose set to false
set Pane's Label to mouseEnabled = false;
this is different behavior to original Pane settings where display press would not close Pane
ZIM 2.6.1
BUG FIXES
CREATE
fixed bug in zim.Ticker - was not storing stage when always was used alone
BUILD
added rounding to non-divisible steps in Slider
added inside parameter to Slider documentation
FRAME
added frame.tin for the #777777 color missing between silver and grey
added frame.purple for dark accent color
frame.lighter color needed an extra e.
ZIM 2.6.1 Updates - centerReg, labelColor, checks, makeCircles, etc.
CREATE:
added an add parameter (default true) to zim.centerReg()
which automatically adds object to the container if container is provided
so zim.centerReg(rect, stage); will center the rect on the stage and addChild to the stage
a touch of a risk as it may be better to always let people addChild - but I do this so often
that I thought I might bend a little. You can pass false as a third param to avoid the addChild
BUILD:
added labelColor to Tabs and Pad classes (BREAKS signature near end - sorry) BUILD
updated Pad documentation
adapted Stepper label to use new centered Label text
added optional type of checkbox for x and square checks
RadioButton, CheckBox, Stepper no longer dispatch change events when set with properties like selectedIndex
so only dispatches change on user input - this changes the behaviour of older zim
FRAME:
has a 250 and 500 ms refresh added to resize events due to mobile delay in changing dimensions
added zon error message to missing sound assets so play() will not break app
added zim.makeCircles() function which ZIM circles for logo
TODO - move last placed object with arrows - CREATE
ZIM 2.6
CREATE
Added id to zim.place()
BUILD
Added Pad component
Added Dial component
Added inside parameter to Slider to fit button inside bar
Added press on bar to move slider to position
Adjusted Tabs to alternately take an array of numbers or strings as tabs parameter
Changed Tabs font size to half height
Changed Tabs auto to currentEnabled (just the click on current tab is not enabled)
must now set color and selectedColor to same to be like button
Fixed Tabs dispose
Fixed Button dispose
Fixed 0 glitch in Label "" == 0 what do you know!
FRAME
added ZIM colors as properties
edit all links to https:for cdn
-> need to add pause property to scroller
ZIM 2.5
MOVE & ANIMATE
added support for moving and animating an array of objects
including a sequence parameter to set time delay of animations on array
this makes marquees, etc.
this means that zim.copy() has to be copied into the stand alone CREATE module
added loopDelay property to move and animate props parameter
this adds a delay after the animation happens (and before a looped animation)
DRAG
Added surround, slide, slideDamp, slideSnap and reg params to Drag in CREATE
added dragRect() to dynamically set the drag rect in Create
TICKER
added Ticker class to Create module - and any that use Tickers
need to add Ticker class to stand-alone BUILD module
removed ticker parameter from any zim functions
made zim.move and zim.animate use the zim Ticker
made zim.drag use the zim Ticker
made zim.Parallax and zim.Scroller use the zim Ticker
MISC
added Dictionary class to CODE module
adjusted zim.mobile() to return "android", "Apple", "blackberry", "windows", "other" or false
Scroller added startPos and endPos params in BUILD
Fixed globalToLocal issues in Scroller
added place() method to CREATE to position things and get location in console
Added text property set and get to CheckBox in BUILD
Added display parameter to stepper to show or hide the text display
Fixed small bug in stepper in setting currentValue and currentIndex
added tripple screen support to max canvas size (which also fixes android sizing bug) in FRAME
added registration support to zim.fit() - might change your code!
added a display parameter to zim Stepper to show (default) or hide the display
switched the arrow direction on vertical Stepper too - sorry up arrow activates arrow on top (BREAKS)
added align parameter to text for left (default), center and right
fixed alignment formula for Pane
fixed target in zgo() for WRAP - was always opening in _blank
return v==null; used for zot(); in WRAP
Fixed Proportion to work with larger number first
consider default container.addChild(obj) for zim.centerReg(obj, container)
ZIM 2.4
ColorPicker component
gave slider a width and height property
fixed Waiter default shadowColor to #000 with alpha
ZIM 2.3
CREATE
Added a hitTestGrid function
Added a paddingVertical to expand so can optionally provide different padding in horizontal and vertical
BUILD
added zim.OPTIMIZE and zim.ACTIONEVENT constants
OPTIMIZE defaults to false but if set to true, components will not stage.update for any presses or property sets (only for mouseover/out)
ACTIONEVENT defaults to "mousedown" and if set to something else then changes to click - can toggle this with zim.mobile() if desired
Added Tab component
added color and rollColor properties to set dynamically on button
fixed enabled bug on button (set mouseChildren false after re-enabling)
added color of label and roll dynamically
PAGES
exposed the regions object of the Layout class for dynamic alteration to Layouts - must call resize() after changing.
made HotSpots and HotSpot follow zim.ACTIONEVENT
Pages documentation should have read lastPages not oldPages
FRAME
made zim.Frame set default rollover to !zim.mobile() (a quick test for mobile)
ZIM 2.2
added fps and ticker properties to move and animate to create module
added fps and ticker properties to parallax and scroller in build module
added mobile function to code module
updated parallax module with fps and ticker
ZIM 2.1
Added always parameter to RadioButton
Fixed margin on Checkbox
Made checked always black but can set color with check.color
Made RadioButton selectedIndex property call a change event if set
Made CheckBox selected property call a change event if set
Made Stepper currentIndex property call a change event if set
Added enabled property to button, checkbox, radio, slider, stepper
ZIM DUO - 2.0
We now minify all the modules and the full zim code under just the zim and version number, i.e. zim_2.0.js.
So no more _min. The only file that is human readable has _doc after the version number, i.e. zim_2.0_doc.js.
Added zob() which allows us to provide a single configuration object for many of the zim functions
CREATE
animation loop fix
added count
added target return in call with no params
added scale convenience to animate
flipped the ease if doing rewind for move and animate
added expand() function to zim create module
BUILD
fixed Pane shadow to alpha
fixed bug in resets and documented as default true
pane center parameter now documented and adjusted to remove all centering if set to false
fixed Label with 0 value bug
fixed Stepper arrow loop bug
added Stepper to press on box
changed default Stepper to go from 0-9
Waiter does not dispatch a close event
made Slider class
fixed initial RadioButtons id bug