Skip to content

Code breaking changes

rynti edited this page Nov 11, 2012 · 7 revisions

Code breaking changes

This page is meant to support you if your code doesn't work anymore due to a recent update. It explains those "code-breaking" changes and includes advises on how to get your code working again.

1.3.0

  • The constructor of Game has been changed.
    Solution: Register your initial scene as you would with any scene and call useScene on your game to use it initially. If you'd like to change the pause scene use the pauseScene property of Game to change it. Besides that, you may want to use Game.create rather than the constructor itself, as the create-method will automatically add the game to the stage.
  • GameTime now uses floating point times.
    Solution: You should use floating point for every timing value you use. If you need to get an integer you may simply cast it using Std.int().

1.2.0

  • The class Spritesheet is now called TextureAtlas and the class Tileset is now called Spritesheet.
    Solution: Change the given class names as well as their usage in other places (For instance Animation.fromTileset() becomes Animation.fromSpritesheet()).

  • Canvas.fillRect() now also gets affected by the Canvas' translations.
    Solution: Subtract the translation for the rectangles' coordinates in order to achieve the previous behaviour.

  • Sprite has no method setTexture anymore.
    Solution: Directly access the texture property.

  • The attributes of GameTime can't be changed anymore.
    Solution: To change the speed of your game use the method applyTimeFactor of GameTime (Available since 1.3.0-dev). If you want to alter time completely different you'll have to create a new GameTime-object (Probably using GameTime.fromElapsed) and pass this object through an GameObjectContainer to all of your GameObjects.

1.1.6

  • Canvas' drawString now takes a 24-bit color value and an additional alpha value.
    Solution: Use the alpha parameter to specify the visibility of the text.

1.1.0

  • GameObjectContainers are now drawing children translated by the container's coordinates.
    Solution: Subtract the container's coordinates from the children's positions to draw them correctly. If you also want to handle mouse input from a GameObject, you may want to use .getAbsoluteX() and .getAbsoluteY() in order to obtain the absolute coordinates of your GameObject.

1.0.0

  • Changes package name from net.robertboehm.rygal to org.rygal.
    Solution: Change the import statements from net.robertboehm.rygal.??? to org.rygal.???.

  • Removes class prefix Ry.
    Solution: Remove the Ry prefixes on the Rygal classes you're using.

Clone this wiki locally