What’s new¶
Version 2.4.0¶
Features added¶
The
removeResource
function now has a suppressWarning optionImplemented the
collideRectCircle
andcollideCircleRect
functionsImplemented the
transformOrigin
,transformOriginx
andtransformOriginy
functionsSome speed improvements when using lots of sprite groups
Incompatible changes¶
The
collidePointRect
andcollidePointCircle
functions have been deprecated, and renamed tocollideRectPoint
andcollideCirclePoint
Bugs fixed¶
Fixed a 1-frame glitch when calling
setAnimation
on moving sprites
Version 2.3.0¶
Features added¶
Implemented the 2D Vector Math Plugin
Various speed and smoothness improvements
The
removeCallback
andremoveTween
functions now have a suppressWarning optionSprites and sprite groups now have a
getDrawIndex
function, 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
removeCallback
andclearCallbacks
inside a callbackThe
playgroundCallback
function 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.ready
functionA previuosly created HTML5 <canvas> element can be passed as the parentDOM to the
playground
functionVarious speed improvements
Sprites and sprite groups now have a
getAbsRect
function, 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
animations
Implemented the
forceRedraw
functionThe Sound Plugin now supports the Ogg/Opus and mp4/aac audio formats
Implemented the
friGame.delay
function in the Tweening Plugin
Incompatible changes¶
The
playgroundCallback
no 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
remove
function, if itsuserData
has 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
removeTween
and aclearTweens
function, 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
startGame
andstopGame
functions from a callback registered withregisterCallback
did 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
removeCallback
function, 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
tween
function 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
tween
function.
Incompatible changes¶
Removed the rate argument from the
startGame
function. 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
userData
attribute 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
registerCallback
in order to stop it, the wrong callback was removed from the queue.Allow calling the
startGame
function recursively, and allow callingstopGame
from the callback