2.15 Potentially Breaking Changes
-
Thought it would be useful to have a list of changes in 21.5 that potentially break existing programs.
Here is a starter:
- PROBLEM: Nothing drawn to screen
REASON: update() no longer sets the draw target back to the framebuffer after setDrawTarget( image )
FIX: Add setDrawTarget( framebuffer ) after the update() statement if it is not there
- PROBLEM: Nothing drawn to screen
-
- PROBLEM: Error: Invalid Type
REASON: With the addition of the Var keyword and the check for invalid types, users who have used "bool" or other invalid types will be getting errors.
FIX: Change their invalid types to valid ones. As a catch-all,var
can be used instead.
- PROBLEM: Error: Invalid Type
-
- PROBLEM: Variables not being set after calls to functions
REASON: Variables are now passed to functions by value by default
FIX: Add the ref keyword in front of the parameter declaration
- PROBLEM: Variables not being set after calls to functions
-
- PROBLEM: Sprite collision misbehaving
REASON: shape_box type sprite collision was being incorrectly calculated as being too small - fixed in 2.15.0
FIX: IfsetSpriteCollisionShape()
is being used, adjust the width and height parameters to be slightly smaller. If only default collision shapes are being used, addsetSpriteCollisionShape()
with parameters to get the desired shape dimensions.
- PROBLEM: Sprite collision misbehaving
-
- PROBLEM: blend mode strangeness
REASON: Similar to the draw target issue, the update() command used to reset the blend mode back to default. This is no longer the case and blend mode must be
reset manually
FIX: Make sure that you change the blend mode back to default using setBlend(blend_mix) after changing it.
- PROBLEM: blend mode strangeness
-
One thing that has changed that I haven't seen mentioned is that in 2.14, you could call
print()
(and I think alsoprintAt()
) and have text printed to the screen without doing update().So this would work:
print("Hej hopp") sleep(100)
In 2.15, this no longer produces any output unless you call
update()
afterwards.FIX: Add a call to
update()
after usingprint()
.