TweenGMS Pro is a feature-rich tweening engine for GameMaker Studio 2 which is both flexible and easy-to-use.

With years of development, it offers essential and advanced features powered by an optimised codebase.

Boost the look of your games by tweening movement, rotation, scale, views, paths, and much more!

Not familiar with tweening? See this video.
You can also check out some video tutorials.

[Features]

  • Fire-and-forget tweening
  • Step and seconds(delta) timing
  • Time scale control (global and per-tween)
  • Play modes (once,bounce,patrol,loop,repeat)
  • State control (pause,resume,stop,finish,reverse)
  • Automatic memory and persistence management
  • Advanced callback system
  • Custom variable easing
  • Path resource tweening
  • Data structure support
  • Delayed tweens
  • Control groups
  • Heavily optimised
  • Supports all platforms
  • And more...
Updated 22 hours ago
StatusReleased
CategoryTool
PlatformsHTML5
Author8BitWarrior
Made withGameMaker: Studio
TagsGameMaker
Average sessionDays or more
LinksYouTube, Community

Download

Download
TweenGMS Pro v106 [GameMaker Studio 2] 179 kB
Download
TweenGMS Pro v103 [GameMaker Studio 1.4] 87 kB
Download
Demo Projects [GameMaker Studio 2] 1,012 kB
Download
Demo Projects [GameMaker Studio 1.4] 780 kB
Download
Starter Guide 42 kB
Download
Script Reference 88 kB

Development log

Comments

Log in with itch.io to leave a comment.

 Is there any way to change the beginning and end reference values of a tween while still compensating for its current value


so for instance, say I have a EaseInOutSine patrol tween and it's going from 25 - 35, and I want to smoothly change it so that it is going from 15-40,  BUT, at the particular frame where I want it to change, the value is at 27 and on its way up. Is there some way to have it stay at '27', and progress to the other min/max values of the new tween without 'teleporting' at the moment of the swap?

I know what you are describing.  I will need to give this some thought. I might have a solution in mind, but I want to try it out before suggesting it.

Let me get back to you. :)

Great, thank you so much!

(1 edit)

So! I'm not sure if this is going to work for you or not, but I have found one possible solution. It involves firing 2 tweens at the same time and effectively switching between them by lerping to the value of the desired tween. It's a bit funky, but it might do what you need it to. Do note though, that both tweens should use the same duration for this trick to work best. Here is a link to an example project. The code is in obj_Example.  When running the example, click the left mouse button to toggle between the 2 tweens.
Let me know if this helps at all.

http://www.stephenloney.com/_/Share/LerpingTweens.yyz

Ah this is super cool but unfortunately doesn't solve my issue. As the tweens in question woud have different durations... 

I might know of a solution for differing durations. I may have something later this week to throw past you if it works out.

Hi 8BitWarior. I noticed a possible issue. I would like to run two tweens on the same object at the same time. The mode of a first is TWEEN_MODE_BOUNCE and the mode of the second is TWEEN_MODE_ONCE. So basically what I want is to rotate the object and also scale it up at the beginning and scale it back down at the end. The bounce one is not working, it uses the once mode. Following is my code:

TweenFire(
self, // Target
EaseLinear, // Ease function
TWEEN_MODE_BOUNCE, // Tween mode
true, // Use delta time?
0.0, // Delay
0.3, // Duration

"image_scale", // Property
image_xscale, // From value
image_xscale * 0.9 // To value
);

TweenFire(
self, // Target
EaseLinear, // Ease function
TWEEN_MODE_ONCE, // Tween mode
true, // Use delta time?
0.0, // Delay
0.3, // Duration

"image_angle", // Property
image_angle, // From value
image_angle + _angle // To value
);


I'll need to see if I can reproduce this issue. To confirm, are you using the latest version of TweenGMS?

I have tested out the supplied code.
In version 1.0.3 of TweenGMS in GameMaker Studio 2, it appears to be working as it should be.
Which version of GameMaker and which version of TGMS are you using?

Hi 8BitWarrior. Thank you for sharing this library. May I ask you a question. Is there a way how to tween a group of tweens and then invoke a callback when all of them finished tweening? So far I managed to achieve that by having a count of individual tweens then calling a finished callback on each tween and then when the count of callback invokations reaches the total count, then execute the final finished code. But to me it doesn't look very elegant. Please advice. Thank you.

Hmm. Out-of-the-box, there is no function for this. I would need to know what you are doing to better help build a simpler solution.

I will give it some thought.

I want to click an object and then move couple of other objects and when all of them finished moving, I want to set some flag. Each and every object moves and rotates to different position.

Depending on how things are timed, you could add a callback to just the last-to-finish tween. Callbacks might be the best solution for now. There might be easier ways to help achieve this in the future.

(1 edit)

First I would like to thank for the asset. I have a question though. Would it be possible to control the change of the variable on each step? So basically I would like to give to the tweener the time/steps and ease control but keep the changing of the variable, for example in a tween step callback script. That script would accept start and end position, duration and progress of a particular tween execution and would set/return the tweening variable value for the particular step (similarly like the To method in DOTween library for unity, if you are familiar).

Thank you

Darius

Hey! I am having some trouble understanding exactly what you need. Would it be possible to show an example of code from Unity and the DOTween library, and I could try to translate it to GameMaker and TweenGMS :)

Hi 8BitWarrior. I want to achieve the following. I have an object with triangle shape sprite and I need to rotate an instance of it around any of the vertices depending on the user action. I can not use sprite origin to do that, by dynamically changing the sprite origin and then rotating the sprite, for it will affect the origins of all other instances of the object. But I want to animate that rotation and this means that I need to calculate the instance position and rotation for each step of the move. For that I want the tweener to call my script 30 or 60 times and I will move the instance in code rather than allowing it to lerp between start and end value and move the instance automatically. This i because my trajectory is not  a line, but a curve. My script would accept the instance id, start and end value and the progress value, from them I can calculate the exact position and rotation.

This is easily achievable by DOTWeen library in Unity (http://dotween.demigiant.com/getstarted.php):

Please see the following script (C#):

public static Tween Rotate(Transform target, Vector3 rotationPoint, float angle, float duration)
        {
            var angleRotated = 0f;
            return DOTween.To(
                () => angleRotated,
                newAngle =>
                {
                    // This is a custom function which calculates the position and then moves the object to it
                    GameObjectHelpers.RotateAroundLocal(target, rotationPoint, newAngle - angleRotated);
                    angleRotated = newAngle;
                },
                angle,
                duration
            );

        }

Thanks in advance       

Hey, Darius.

Sorry for the SUPER late reply! Did you ever find a solution to this, or can I still be of any help?

Let me know :)

-Stephen

Deleted 212 days ago
Deleted 212 days ago
Deleted 107 days ago

It's actually possible to restart a tween by using TweenPlay(tween), even if the tween was created with TweenFire() or TweenEasy*().

Let me know if that helps or if you need a more involved solution!

-Stephen

Hmm, I have it in a room start event and it works when you first pause. The main problem is that TweenPlay() doesn't get called again even when the pause screen room starts, meaning that the pause screen text is being held at it's starting position.

Thank you for help by the way, I appreciate so much when developers go out of their way like this. It's a rare thing <3

Hmm. I will try to replicate this later today and let you know what I find :)

Are you playing tweens in both the CREATE event and ROOM START event, or just in the ROOM START event? That could possibly be an issue.

Would it be possible for you to send me an example of your problem as a gamemaker project? You could contact me at StephenLoney86 at gmail.

Just in room start, I'll create an example for you

Prepare to receive an email in the coming hours

Hm, after recreating it all, it seems to work absolutely fine. My pause screen uses room persistence so it might be issue with the way that's implemented

Welp, playing the tween in the create event seems to fix it. Thanks for your help though man, I really appreciate it ^^;

Glad you got it working!

Let me know if you come across any other issues. Feedback greatly helps the asset improve. :)

hello my asset will be sold, as I understand it, I can’t use your twin system as part of an asset or can I remove most of the code leaving only the piece I need so that it works?

You can include it.

I have deemed TweenGMS open source, so use it as you like! ^.^

Thanks you! However, I will definitely buy it for money when I can afford it!

hey, how do you change the fps of the tween?

(1 edit)

Hi! I am not 100% sure what you are wanting, but I have a couple of things to try. First you could change the time scale of a tween by using TweenSet()...

TweenSet(tweenID, "time_scale", 0.5);

You could also change the time scale for the whole tweening system like such...

TweenSystemSet("time_scale", 0.5);

Lastly, you can change the update interval of of the tweening system...

TweenSystemSet("update_interval", 2);

The default interval is 1 which updates the system every step. But if you set it to 2, it would update every 2 steps. This means that if your game ran at 60fps, then the tweening engine would run at roughly 30fps.

I hope this helps. Follow up and let me know if any of this works for your needs :)

-Stephen