MODULE: Tween 1.5.1

Started by edmundito, Sun 14/06/2009 04:42:24

Previous topic - Next topic

edmundito

Guess what, boys and girls? Tween is almost a year old and to celebrate I've updated it to 1.2! Here's the changes:

- New: You can now change the defaults for TweenTiming and TweenStyle.
 (GUIs have their own defaults, and NOTE that as of this version GUIs are blocking by default.)
- New: You can now set how tweens stop, whether they pause, finish, or reset (thanks to Dualnames for the inspiration!)
- New: WaitSeconds(seconds), very handy for timing things instead of guessing number of loops with regular Wait()
- General code cleanup, removed some redundancies
- Better code documentation

For stopping Tweens, you can now do things like the following...

Code: ags


// All tweens are now blocking for consistency, but you can change it at the top of the module file
gIconbar.TweenTransparency(2.0, 100, eLinearTween, eNoBlockTween); // Fade out in 2 seconds

WaitSeconds(1.0); // new handy-dandy function

gIconbar.StopAllTweens(eResetTween); // Puts it back to its original transparency
//gIconbar.StopAllTweens(eFinishTween); // Or finish it immediately!
//gIconbar.StopAllTweens(); // Or leave it as is.




There isn't tween support for the newer features of AGS 3.2 yet. I know there's some new features that could probably be tweenable but I haven't had a chance to look at it. Let me know if you'd like to see any of these features available in 1.3.

The Tween Module now supports AGS 3.6.0!

Dualnames

Great job Edmundo!! Thanks for implementing this! :D
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Codex


ddq

I honestly don't have any idea what I would do without this module. You deserve massive props.

edmundito

Hey guys, quick update: I realized that I may have introduced a little bug in the system with the new stop tween stuff, so I went ahead and did a minor correction to it and still labeled it 1.2 (instead of 1.21, but only this time around)...

So, please download it again if you did it this weekend! Sorry about the trouble...
The Tween Module now supports AGS 3.6.0!

Sslaxx

Quote from: Edmundito on Sat 05/06/2010 19:26:19
There isn't tween support for the newer features of AGS 3.2 yet. I know there's some new features that could probably be tweenable but I haven't had a chance to look at it. Let me know if you'd like to see any of these features available in 1.3.
3.2's changed music system also results in an error message when I imported Tween 1.2 into an AGS 3.2 project.

Quote from: AGS 3.2.0 Final 5Tween.asc(282): Error (line 282): Undefined token 'SetMusicMasterVolume'
Quote from: Tween.asc line 282SetMusicMasterVolume(Lerp(this.fromX, this.toX, amount));

Doesn't seem hard to fix it up, just onerous (if you don't want to change the relevant backwards compatibility option).
Stuart "Sslaxx" Moore.

edmundito

#46
Duly noted, so here's version 1.21, which is compatible with AGS 3.2, including the demo game. :)

Most audio support gets turned off in 3.2 unless you change the setting Enforce new-style audio scripting to False in the General Settings.

Looks like overall support for audio tweening needs some more care, so the new system support will come in a later version of the module.
The Tween Module now supports AGS 3.6.0!

edmundito

New revision to celebrate the return of the forums! woohoo! This one is not too exciting, I've basically gone back and made sure that our current code is compatible with AGS 2.72 and AGS 3.0 because it looks like we lost some of that when we released version 1.1.

Feel free to leave problems/suggestions here or report stuff to our google code site at:
http://code.google.com/p/ags-tween/issues/list

I've also started a list of games using the tween module:
http://code.google.com/p/ags-tween/wiki/GamesUsingTheTweenModule

Now that the forums are back I will update with with the ones I've been credited with. If you have any games that are released that used the module, feel free to PM me and I'll add it!
The Tween Module now supports AGS 3.6.0!

Pinback


RedTalon

A truly wonderful mod. Helps with animations dealing with teleportation and wheeled robots.  :D
Website:
www.redtalongames.com
Twitter:
www.twitter.com/redtalongames

tzachs

Quote from: RedTalon on Sun 12/09/2010 21:59:34
A truly wonderful mod. Helps with animations dealing with teleportation and wheeled robots.  :D

Indeed  :)
Just in case it wasn't clear before, this is my favorite module in all times!

Iliya

Great job Edmundito! I just found the tween module. I have great ideas for improving my games. Especially the objects moving!

Thank you very much!

ThreeOhFour

I finally downloaded this and tried using it today!

Two things I'd like to see but can't seem to find in here - could tweening support for individual variables (ints and floats) be added? And also for drawingsurface functions, such as DrawImage?

Ta!  :-*

edmundito

Ben, can you give me an example of how you would like to tween a variable? Would it be something along the lines of:

Code: ags

int amount = 0;
TweenInt(amount, 100, eEaseOut);


?

Drawing surfaces is something I could add, too. It could take some time... mostly testing it and making sure that it works. Let me know if you want to be my guinea pig for that. :P
The Tween Module now supports AGS 3.6.0!

ThreeOhFour

Yes, tweening a variable was mostly to make use of the easing in styles, and also for plugging in tweened variables so that we can try tweening things that are not yet supported ourselves  :=

Always willing to be a guinea pig (although do keep in mind I'm a pretty basic coder in terms of skill level (pretty extreme coder in terms of ambition sometimes  :D))

edmundito

Hmm, actually I'm not sure if we can tween variables in AGS, because with the scripting language limitations I cannot get a reference of the same variable I think. I'd have to look into it (don't have access to a Windows PC right now ¬¬) but can one of the more technical people get back to me on whether AGS  supports pointers for int and float?

I could maybe add tween to the old global ints as such, but it would be messy:

Code: ags

boolean fooIsTweening;

function TweenFoo() {
    fooIsTweening = true;
    TweenGlobalInt(5, 100);
    fooIsTweening = false;
}

function repeatedly_execute_always() {
    if (fooIsTweening) {
       foo.x = GetGlobalInt(5);
    }
}
The Tween Module now supports AGS 3.6.0!

Icey

Just wondering would it ever be possible to tween music? Like cross fading but with more control.

WHAM

My Gods! It is beautiful! I am so using this in the future!
Wrongthinker and anticitizen one. Pending removal to memory hole. | WHAMGAMES proudly presents: The Night Falls, a community roleplaying game

David Ostman

I'm using object.TweenPosition, and when I invoke PauseGame() or pause the game when a GUI is visible, the tween animation continues to play.

So I have the player freezing as I bring up the inventory, but all the objects in the background keeps animating, which looks really weird.

Is this regular behaviour, or have I screwed something up?

I'm on 3.2.1 and this is the code snippet I use in room_AfterFadeIn():

Code: ags
oBGShip1.TweenPosition(9.0, 509, oBGShip1.Y, eLinearTween, eRepeatTween);

tzachs

AGS scripts has "repeatedly_execute_always" and "repeatedly_execute" functions.
Whatever is in "repeatedly_execute_always" will happen even when the game is paused, as opposed to "repeatedly_execute" that will only happen when the game is not paused.

So you have two options: if you want the tweens to pause then just go to the tween script file and replace "repeatedly_execute_always" with "repeatedly_execute".
If you want your other animations to not pause, then you have to switch all your animations to "repeatedly_execute_always" instead of "repeatedly_execute".

SMF spam blocked by CleanTalk