What’s new¶
Version 2.4.0¶
Features added¶
The
removeResourcefunction now has a suppressWarning optionImplemented the
collideRectCircleandcollideCircleRectfunctionsImplemented the
transformOrigin,transformOriginxandtransformOriginyfunctionsSome speed improvements when using lots of sprite groups
Incompatible changes¶
The
collidePointRectandcollidePointCirclefunctions have been deprecated, and renamed tocollideRectPointandcollideCirclePoint
Bugs fixed¶
Fixed a 1-frame glitch when calling
setAnimationon moving sprites
Version 2.3.0¶
Features added¶
Implemented the 2D Vector Math Plugin
Various speed and smoothness improvements
The
removeCallbackandremoveTweenfunctions now have a suppressWarning optionSprites and sprite groups now have a
getDrawIndexfunction, for knowing the sprite drawing position.
Incompatible changes¶
Now a warning or an error is shown on the console if some functions are used incorrectly, or if a sprite or resource name is overwritten
Bugs fixed¶
Fixed calling
removeCallbackandclearCallbacksinside a callbackThe
playgroundCallbackfunction can be called also when the playground has already been created
Version 2.2.0¶
Features added¶
Removed the jQuery dependency for all but the DOM backend
Implemented the frigame.domready.js plugin that provides the
friGame.readyfunctionA previuosly created HTML5 <canvas> element can be passed as the parentDOM to the
playgroundfunctionVarious speed improvements
Sprites and sprite groups now have a
getAbsRectfunction, that can be used to check for collisions for sprites that belong to different sprite groupsSprite groups can have a
border, and rounded cornersImplemented the frameset parameter for
animationsImplemented the
forceRedrawfunctionThe Sound Plugin now supports the Ogg/Opus and mp4/aac audio formats
Implemented the
friGame.delayfunction in the Tweening Plugin
Incompatible changes¶
The
playgroundCallbackno longer takes a jQuery object as a parameter, but a native DOM element insteadThe Sound Plugin now depends on the frigame.domready.js plugin
When removing a sprite using the
removefunction, if itsuserDatahas a remove() method, it will be called automatically
Bugs fixed¶
Fixed audio muting on some implementations
Fixed image preloading on some implementations
Version 2.1.1¶
Features added¶
Sprites and sprite groups now have a
removeTweenand aclearTweensfunction, in order to remove a specific tweening, or all the tweenings registered withtween.
Incompatible changes¶
The experimental absRect property for sprites and groups has been removed as it slowed down too much the rendering of the scene.
Bugs fixed¶
Fixed sloppy animation in the DOM renderer
Don’t retrigger the animation from the beginning when changing only the refresh rate in setAnimation
Reset the callback and paused state when changing animations
Calling the
startGameandstopGamefunctions from a callback registered withregisterCallbackdid not work properly.
Version 2.1.0¶
Features added¶
The sprites and sprite groups now have an experimental absRect property, that can be used to check for collisions for sprites that belong to different sprite groups
Sprites and sprite groups now have a
removeCallbackfunction, in order to remove a specific callback function registered withregisterCallback.Only the sprites and sprite groups that are within the playground boundaries are drawn. This should increase performance in large games.
friGame uses, and makes available the performance.now function even in older browsers.
The frigame.fx.js plugin has been refactored, and it now introduces a generic
tweenfunction in order to implement tweening for all the properties of sprites and sounds.The Sound Plugin now uses the Web Audio API where available, with fallback to HTML5 Audio and Flash, as usual
When using the Tweening Plugin in conjunction with the Sound Plugin, it is possible to fade the audio volume, by using the generic
tweenfunction.
Incompatible changes¶
Removed the rate argument from the
startGamefunction. Changing the refresh rate had always been buggy, and it was never really used in any of the games that I’m aware of.The target refresh rate has been changed from 30 FPS to 60 FPS. Its value, expressed in milliseconds, can be found in the constant
friGame.REFRESH_RATE, and it is recommended to use this constant, instead of assuming that the target refresh rate will always be 60 FPS.
Because of these changes, declaring a callback function, for example using registerCallback, without specifying the
rate argument, results in the callback function being called twice as fast as before.
The
userDataattribute of sprites is now initialized to null instead of an empty object. Any code that assumed this attribute to be a valid object, must explicitly initialize it first.
Bugs fixed¶
Accept a scaling value of 0 for sprites
When returning true from a callback registered with
registerCallbackin order to stop it, the wrong callback was removed from the queue.Allow calling the
startGamefunction recursively, and allow callingstopGamefrom the callback