-
Notifications
You must be signed in to change notification settings - Fork 0
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.
- The constructor of Game has been changed.
Solution: Register your initial scene as you would with any scene and calluseScene
on your game to use it initially. If you'd like to change the pause scene use thepauseScene
property of Game to change it. Besides that, you may want to useGame.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 usingStd.int()
.
-
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 instanceAnimation.fromTileset()
becomesAnimation.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 thetexture
property. -
The attributes of GameTime can't be changed anymore.
Solution: To change the speed of your game use the methodapplyTimeFactor
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 usingGameTime.fromElapsed
) and pass this object through an GameObjectContainer to all of your GameObjects.
-
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.
-
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.
-
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.