[!! Breaking Changes !!]
#1
GameMaker Studio 2.3.7 is now required.
#2
Please be aware that target handling for tween callbacks has been modified.
Methods used as a callback script will now use the specified callback target, overriding its calling environment/self.
Previously, the callback target would not affect methods with a defined 'self'.
To maintain a method's existing 'self', please use the keyword [undefined] as the callback target.
You can find more information about this in the log below or under TweenAddCallback() in the Script Reference.
If upgrading an existing project, please validate that your tween callbacks still work as intended.
[Version 1.11]
- Added TPStruct() for easing struct properties
* Note: This will not make use of optimised/custom property functions for easing struct values
* e.g.
some_struct = {value: 0}
TweenFire(id, EaseInSine, 0, true, 0, 1, TPStruct(some_struct, "value"), 0, 100);
- Added TPInst() for easing values belonging to other specific instances
* Note: Normalized properties are not supported -- "image_blend" will not work with this function
* e.g.
TweenFire(self, EaseInSine, 0, true, 0, 1, "x", 0, 10, TPInst(obj_Enemy, "x"), 0, 100);
- TweenAddCallback() now supports struct targets
* e.g.
some_struct = {value: 0}
t = TweenFire(id, EaseInSine, 0, true, 0, 1, "x", 0, 100);
TweenAddCallback(t, TWEEN_EV_FINISH, some_struct, func_PrintValue);
- Callback methods now use assigned targets as the calling environment
* Methods were previously always using their 'self' environment
* The use of function/script ids are not affected by this change
* Mentioned below, the 'undefined' keyword can be used to keep the method's existing instance/struct environment
* e.g.
// Set up struct with method and fire a tween
some_struct = { my_method: function(){ show_message(self); } }
t = TweenFire(id, EaseInSine, 0, true, 0, 1, "x", 0, 100);
// Add callback method, using obj_Player as calling environment instead of method's "self"
TweenAddCallback(t, TWEEN_EV_FINISH, obj_Player, some_struct.my_method);
- Added the keyword 'undefined' as a valid callback target
* This will use a function's or method's existing instance/struct 'self' as the callback target environment
* If the method's 'self' is undefined, then the current environment's self will be used as the target
* e.g.
// Create a new struct with a value and method
some_struct = {value: 100, my_method: function(){ show_message(value); }}
// Fire a tween
t = TweenFire(id, EaseInSine, 0, true, 0, 1, "x", 0, 100);
// Add a callback but retain the method's 'self' as the calling target environment
TweenAddCallback(t, TWEEN_EV_FINISH, undefined, some_struct.my_method
// Omitting the target argument will do the same thing
TweenAddCallback(t, TWEEN_EV_FINISH, , some_struct.my_method
// With a function id, undefined will simply be the same as using 'self'
TweenAddCallback(t, TWEEN_EV_FINISH, undefined, show_message, "Done!");
- Added "z" as a default optimised property
- Fixed various state checks returning 'undefined' instead of 'false'
- Changed internal naming of some properties to prevent chance of naming conflicts