Change Log
v1.4.0 "XXXX"
New Features
- Much faster rendering! Render pipeline caches the results of matrix concatenation, overcoming a significant bottleneck. Also uses cached data objects during rendering, rather than recreating assets on the fly. Depending on scene composition, this may yield a 10-50% performance improvement. Hint: Objects that don't transform are more performant.
Geom.Transform.ignoreChildproperty added. Defaultsfalse. If set totrueon aGrouporState, its children will not inherit transforms. They will be positioned from (0, 0). This can save a matrix concatenation operation for every object in a group that doesn't move, resulting in significant performance gains. It's also faster to implement thanGeom.Transform.ignoreParentfrom v1.3.0 if you have several children.- Added
Geom.Intersect.rayToCircle()intersection check. This completes the geometry intersections. (#170) Geom.Raynow inherits fromGeom.Line. This gives it a more robust feature set. (#170)Kiwi.Geom.Matrix.equals()method added.- Add
stateproperty toComponent. Kiwi.Pluginsis now a TypeScript module, allowing TypeScript developers to make plugins natively. (#208)Fileparamtimeoutadded; file timeouts now default to null. This allows the user to set loading tolerances. By default, files will attempt to load forever. This can prevent crashes on slow connections.State.destroynow explicitly destroys members; destruction of tracking list is more robust. This overcomes some issues which might occur when switching states.- File load checks status code and response for greater robustness.
- Optimised
GameObjects.Tilemap.getOverlappingTiles(). - Nicer layout in preloader template.
- Check out http://examples.kiwijs.org/ for examples covering every facet of KiwiJS development.
Deprecations
glMatrixlibrary removed. This was used for a single call during WebGL rendering. Our own matrix code seems to perform just as well. In addition, glMatrix will load itself into a different namespace if certain other frameworks are in use, which results in a crash. Rather than fork or work around glMatrix, we decided to remove it entirely, reducing the size of KiwiJS. If you need glMatrix functionality, you may obtain the stand-alone library from http://glmatrix.net/. Thanks to the team at Cerebral Fix for bringing this to our attention! (#136)
Bug Fixes
Stage.rgbColornow correctly interprets all values in range 0-255. (#198)- Audio now loops and stops correctly. Previously, it might loop indefinitely without making sound after the first loop, which is neither a proper loop nor a proper stop. (#199, #207)
- Console error will be reported when a texture atlas JSON could not be loaded (#200)
Camera.transformPoint,Camera.transformPointToScreen,Box._rotateRect, andBox._rotateHitboxnow copy concatenated matrices, rather than operating directly on the matrix. (#201)Sound.AudioManager._unlockedSourcenow passes a required parameter under iOS Safari. (#203)- Eliminated flickering at high frame rates on some devices in CocoonJS. (#204)
- Prevent renderer crash when creating a shader after at least one frame has been rendered. (#210)
- Touch events fixed in Internet Explorer 11. Thanks to @benliddicott for the fix! (#212, #213)
Geom.Transform.anchorPointYnow updates correctly. (#216)- Stage visibility changes are more robust.
Kiwi.Files.Filenow supports proper parsing of Data files.- Data files now succeed properly when dealing with null variables.
- Remove
versionproperty frombower.json(contributed by Kevin Kirsche). - Correct documentation of
Kiwi.Input.Keyboard_keyPressedand_keyReleasedmethods - FileStore.removeFile now destroys properly
- @radarhere fixed typos in the documentation.
- You can now stop the RAF from executing. (#211)
v1.3.0 "Moriarty"
New Features
- Window focus/blur events added to the Stage allowing users to easily pause/resume their game. (#23)
- The Animation Component will now look for sequences on their given texture atlas if one told to play could not be found. (#83)
TileMapLayershave been separated into Orthogonal and Isometric classes to keep code more maintainable as well as more succinct. (#85)- Additional file management methods added to the
FileStoreclass. (#103) - You can now pass parameters to a states
preloadmethod when switching states. (#104) - You can now filter out messages to be logged out when using the
Kiwi.Log. (#151) - Much better consistency for passing file types. (#156)
- @rydairegames added a method to get a tile when you know its index. (#160)
- ArcadePhysics now contains a
rotateToVelocitymethod. (#179) - Clocks now contains deltas. (#183)
- You can now assign floating point values when changing an Animations frame. (#186)
- Audio now contains an
onCompletesignal. (#189) - Context menu events have been added to the Mouse Input Manager. (#191)
- HUDWidgets can have the origin the position is based of changed. (#193)
- New get children by tag methods added to groups. (#195)
Bug Fixes
- Animation employs more rigorous methods which ensure the frameIndex is correct. (#184)
- Timer no longer hangs when the interval is set to 0ms. (#187)
setIntervalandsetTimeoutnow deal with clock units. (#188)- IconBar positioning fixed. (#192)
- Minor fix with the image loading when using the xhr + arraybuffer methods of loading.
- ArcadePhysics tile collision boxes made smaller to give better collisions.
v1.2.3 "Williams"
Bug Fixes
Clock.elapsed()now resets to 0 afterstart()is called. (#177)Geom.Intersect.lineToLineSegmentandlineSegmentToLineSegmentnow work correctly. (#172)
Deprecations
Entity.inputEnabledwasn't used by anything, and is now officially deprecated.
More details can be found on the Kiwi.JS repo under the 1.2.3 milestone
v1.2.2 "Williams"
Bug Fixes
Animationnow correctly plays non-looping animations. (#164)Animation.onPlay,.onStop,.onupdate,.onLoop, and.onCompletenow correctly documented in API.Geom.Intersect.circleToRectangle()andGeom.Intersect.lineToRawSegment()now work correctly in all cases. (#163, #166)Geom.Intersect.lineSegmentToRectangle()is now named correctly in API docs. (#165)Geom.Line.perp()can now deal with points at (0,0) and other edge cases. (#167)- Added method
Geom.Intersect.lineSegmentToRawSegment()to allowlineSegmentToRectangle()to function correctly. Animationnow correctly plays 1 frame animations and dispatches signals appropriately. (#174)Utils.GameMath.nearestAngleBetween()now returns normalized angles so results are truly nearest. (#175)
v1.2.1 "Williams"
Bug Fixes
Animationcould, under certain circumstances, freeze for a few seconds before playing. This was due to accidentally starting in 1970 and scrambling to catch up. This is no longer possible. (#150)Clock.ratewill now equal 0 if the clock is paused or stopped. (#152)- Correct documentation for
TextFieldandKiwi.HUD.Widget.MenuItemto show proper constructor information. (#155, #154) - Non-looping animations now refer to the correct cells when played a second time. (#149)
State.createnow fires after file loading is complete. Logs no longer overlap between loading and creating. (#157)MasterClocknow starts today, rather than 1970, avoiding anomalous results on first frame. (#158)
More details can be found on the Kiwi.JS repo under the 1.2.1 milestone
v1.2.0 "Williams"
New Features
- Pro architecture tools out the wazoo
- All
Componentobjects on a Group or Entity will automatically update when the State updates. This permits a full Entity Component System. (#122) Clockgreatly improved (#143)- Time can run at any rate, in any direction
rateproperty available on clocks- Animation, Tween, and TweenManager can now use any Clock
- Timer Helpers implemented. You can now call
Clock.setIntervalandClock.setTimeout, rather than mess around with three or more calls to get the same effect. These helpers run on game clocks, and will respect clock manipulation and pausing. (#44) Kiwi.Logadded. This replaces and upgradesconsole.logfunctionality, with recording, tagging, and selective muting. It's a big step up for debug! (#117)Kiwi.Utils.Colorobject can record and output color values in a very wide range of formats, including RGB, RGBA, HSL, HSV, CSS color functions, and normalized or integer values. (#135)- TextField, State, and Kiwi.Utils.Canvas now use Color objects.
- File system is more flexible
- Parallel loading option for lightning-fast downloads
- Load files with easy-to-use parameters
- Easily manage state-specific files
Transformoptimisations (#141)- Improved performance
- Transform may be set
lock = trueto prevent updates and increase performance - Transform may be set
ignoreParents = trueto save performance with objects whose parents don't update
Animationhas aSignalcalledonCompletewhich fires after finishing (#143)TextFieldnow has a hitbox (#137)- Game
domParentparameter can now use CSS selectors (#131) Kiwi.Utils.Common.between( x, a, b )method added. It's much faster to check if something is between two numbers now. (#118)Input.Pointersnow haspressedandreleasedgetters, allowing you to see if a mouse or finger was pressed or released in the last frame only. (#115)Camera.transformPointToScreenadded, allowing you to translate world points to screen coordinates. This is the opposite ofCamera.transformPoint. (#112)- You may now reassign
Tween.object, transferring a Tween from one object to another. (#109) State.loadProgress()can now estimate bytes loaded (#66)
Bug Fixes
scaleType: Kiwi.Stage.SCALE_FITnow scales correctly when browser window is manually resized to be smaller than the canvas. (#147)- XHR loading works with Nodewebkit where status codes are unavailable (#144)
Kiwi.Utils.Common.defaultToStringis now in camelCase (#140)TileMapLayer.getOverlappingTilesnow works correctly with negative coordinates (#139)Kiwi.Time.Clock.removeTimerworks correctly (#138)- Audio objects now loop correctly after being paused and resumed (#132)
PluginManagernow correctly allows requirements that match or exceed requested version number, rather than those that match or precede it. (#130)- Game prints the correct error message when no stage was specified, or an incorrect stage was specified. (#129)
- Mouse events now include button data. (#126)
AnimationManagernow callsonUpdateafter changingcellIndex, ensuring that callbacks have more accurate data regarding cells. (#125)StaticImage.objType()now reports "StaticImage" instead of "Sprite" (#119)- Spritesheet texture atlas correctly enumerates number of cells. (#116)
Timerresumes where it left off after being paused (#113)- File loader now correctly interprets files without extensions in CocoonJS (#106)
Deprecations and Removals
Textfieldis deprecated in favour ofTextFieldalias (#134)Kiwi.Utils.Common.defaultToStringis now in camelCase (#140)
Project Architecture
- Switched to Typescript 1.4. Run
npm updateto upgrade your packages.
More details can be found on the Kiwi.JS repo under the 1.2.0 milestone
Release Notes for Previous Versions
v1.1.1
Bug Fixes
- Blend modes now work correctly in CocoonJS when
deviceTarget: Kiwi.TARGET_COCOONis set, fixing a number of bugs. This allows CocoonJS deployment to a wider range of devices with more reliable quality. - Methods on a number of Geometric Objects (such as the
angleTomethod onPoint) have been fixed. - Mouse events (down, up, scrollwheel and move) now prevent the default action from escaping to the rest of the page.
- For CocoonJS the default stage colour is now '#000000'. Even if your game doesn't fill the entire screen, the WebGL renderer will use this colour to fill all parts outside of the game area.
More details on the problems solved can be found on the Kiwi.JS repo under the 1.1.1 milestone
v1.1.0 "Iwutani"
New Features
- So much good stuff.
- Numerous aliases added to transformable objects. Transform sprites, groups, etc using these handy properties:
- x, y
- rotation
- anchorPointX, anchorPointY (offset the point about which the object rotates and scales)
- rotPointX, rotPointY (identical to anchorPoint)
- scale, scaleX, scaleY (scale sets both scaleX and scaleY, but cannot be read back)
- worldX, worldY (read-only; useful for objects inside groups)
scaleToWidth( value )orscaleToHeight( value )methods set the scale to fit Sprites, StaticImages, TextFields and TileMapLayers into a set width or height.centerAnchorPoint()method moves the anchor point to the middle of a Sprite, StaticImage, TextField and TileMapLayers.- Because camera transformation is a more advanced topic, these aliases have not been applied to the camera.
- WebGL is now selected as default renderer. Go to full speed without wasting time on configs.
- Rectangle.copyTo method will now return a new Rectangle if called without a parameter.
- Tagging system for game objects (Groups, Sprites, StaticImages, TextFields, and TileMapLayers):
addTag()andremoveTag()methods accept any number of Strings as parametershasTag()method checks for tagsGroup.getChildrenByTagmethod available
- Group member selections enhanced:
getAllChildren()method availablegetChildByName()andgetChildByID()have the option to examine sub-groups
- Substantial revision of the WebGL rendering engine to support future features.
- Game objects can now safely perform canvas texturing operations during
renderGL(). - GLBlendMode object added. Now you can set blend modes in WebGL quickly and safely.
- Texture management revised to support multi-texture shaders.
- Runtime GPU memory management uses a new algorithm, although we do need to do more work on this.
- Vast profusion of new shader options opens up.
- Game objects can now safely perform canvas texturing operations during
- When switching States, all cameras are reset to default.
- CameraManager now has functions
zeroCamera( camera )andzeroAllCameras().
- CameraManager now has functions
- New time-related properties on Kiwi.Game objects for your convenience:
game.frametells you how many frames have been rendered since the game launched.game.idealFrametells you how many frames should have rendered since the game launched. Use this to drive smooth cyclic animations.game.time.ratetells you how long the last frame took to render, relative to how long it should have taken at the current framerate. For example, this should ideally always be 1.0, but if your 60fps game is running at 30fps, it will be 2.0. Use this to create smooth movement, multiplying distances by game.time.rate.game.frameratenow cannot be 0.- MasterClock drives several of these properties behind the scenes.
Stage.colornow accepts RGBA input (as well as RGB values). This allows you to make a transparent game over other page content.
Bug fixes
- TileMapLayer objects now render correctly with scaled and rotated cameras. Technically you can also scale and rotate TileMapLayers, but this does not yet update physics, so you should only use it for cosmetic objects.
- Touch input no longer assumes 11 fingers, preventing a bug where touch was always down. Thanks to @ic5y for the catch.
- TextField now aligns text correctly in all situations, including a bug where Group scaling in Canvas mode would incorrectly position text; and updates properly in CocoonJS.
- WebGL now properly clears video memory when swapping states, preventing eventual instability. Garbage collection was optimised during State transitions.
- Fixed bug where some Geom objects accidentally swapped x and y while doing geometry. Note:
Math.atan2takes arguments in the ordery, x. Yes, it's silly. Yes, you have to do it. - MasterClock now reports a correct delta, rather than always returning 0.1ms.
- CocoonJS input now works properly. You are required to have no DOM elements in your HTML body for this to work.
- Touch input now no longer reports two
onUpevents per touch. Issue may still persist on default Android browser. - Prevent switching a State while another State is loading.
Group.getRandom()now returns proper results.- Groups now correctly respect child position when the group has a non-zero anchor point.
- Stage offset is correctly calculated, allowing for correct input positions.
- Numerous small corrections to documentation: API reference is much more accurate.
Deprecations and Removals
- Examples have been moved to a new repo, reducing the size of Kiwi.js repo downloads.
- Deprecated
willRenderflag on all objects. It now maps tovisible, which serves the same purpose. - Deprecated
dirtyflag on Box and Camera objects. It didn't do anything and at worst was an unnecessary check. - Deprecated
removeFirstAlive,getFirstAlive, andgetFirstDeadmethods on Group objects. They still function, but are of extremely limited use.
v1.0.1
Bug Fixes and Changes
- Thanks to @zzarcon the Grunt file now has more clarity.
- @tjwudi has pushed up numerous fixes to the Documentation!
- Bug fix where multiple debug canvases could be generated from subsequent 'createDebugCanvas' calls.
- The debug canvas now responds to the "scaleType" property on the 'Stage'.
- Tilemap layers no longer return error messages about the cellIndex.
- Groups now use correct rotation point, as does the Camera and the State.
- Fixed a bug where the HUDIcon would not work with Textures use a Canvas.
- Canvas renderer now behaves more like the WebGL renderer.
- Fixed a WebGL bug where alphas between 0 and 1 made the page background color bleed through.
- The WebGL renderer now clears every frame which solves the bug where nothing would appear.
- Textures that are set to 'dirty' are now re-uploaded to video memory. This fixes other bugs, such as the Textfield not working in WebGL.
- Visibility flag now works correctly with groups: no children are rendered.
- Visibility flag now works correctly under WebGL renderer.
- Upgraded Kiwi.js to use Typescript version 1.0.0.