Skip to content
onaluf edited this page Mar 6, 2012 · 7 revisions

No more moving around sprite/group/tilemap with .css()

This is a very important change!!! From now on you CANNOT use .css(“left”, posx) anymore because there isn’t any css set hook anymore. You have to use the .xyz() .xy() .x() .y() .z() function instead. The same goes on for .css(“width”) and .css(“height”) that are now replaced by .wh() .w() .h()

Function description

  • .xyz(x,y,z,relative), .xy(x,y,relative), .x(value, relative), .y(value, relative), .z(value, relative) : sets the coordinates of the sprite/group/tilemap. If relative is set to true then the arguments are increments to the current position.
  • .xyz(), .xy(): return an object containing the coordinate of the sprite/group/tilemap
  • .x(), .y(), .z(): return the value of the coordinate of the sprite/group/tilemap
  • .wh(w,h,relative), .w(value, relative), .h(value, relative): sets the width and height of the sprite/group/tilemap. If relative is set to true then the arguments are increments to the current dimensions.
  • .wh(): return an object containing the dimensions of the sprite/group/tilemap
  • .w(), .h(): return the value of the dimension of the sprite/group/tilemap

no more setLoadbar()

.setLoadbar() was deprecated in 0.5 it’s now gone for good. you should use .loadCallback() instead. For example:


$.loadCallback(function(percent){
	$("#loadingBar").width(400*percent);
});

Pause Animation

You can now stop and resume the playing of the animation of a sprite:

  • .pauseAnimation(): the animation of this sprite will remain at the given frame.
  • .resumeAnimation(): resume the animation of a given sprite (if it has been paused)

Horizontal and vertical flip

The are now function that allows to flip a sprite vertically or horizontally.

  • .fliph(value): if value is true or no value is specified the sprite will be flipped horizontally. If value is false the sprite will return to it’s normal state.
  • .flipv(value): if value is true or no value is specified the sprite will be flipped vertically. If value is false the sprite will return to it’s normal state.

Ping-pong animation

There is now a $.gameQuery.ANIMATION_PINGPONG property for animation that enable the looping to go 1,2,3,2,1 instead of 1,2,3,1,2,3