Tween Module, Help (Manual is not working online!)

Started by Olleh19, Wed 09/09/2020 01:36:04

Previous topic - Next topic

Olleh19

Just got this module, and could not find a manual Online for it (Does not work on Github). What i'm trying to do is fade an object in or out. If anybody would be so kind. He or she could upload the Manual somewhere?

I've guessed my way half way to this
Code: ags
oRub.TweenFadeOut(0.8, eTweenSeconds, 20);



It's fading out the right speed, the problem is the actual object that it is fading is moving and should begin to fade out while it's moving.

Now the object does it's thing and then stands waiting for the fade out, and eventually it fades. Got the right fade out speed.

It just needs to happen faster, so what's the syntax i'm looking for?

Solution: This is the beginners forum so i didn't do a ENoBlock in the actual Object animation before the Tween. It was that easy! Thanks to Privateer Puddin' that got me on the right path, and for Khris for at least trying to understand what i'm doing! It's hard to explain sometimes. I feel coding is difficult to translate in text sometimes, what you want to achieve.


Code: ags
cGhost.Walk(140, 545, eBlock, eAnywhere);
object[0].SetView(43, 0);
object[0].Animate(1, 0, eRepeat, eNoBlock); //The ENoBlock here made the difference. Without it the TweenFadeout Waits for the full animation to finish.
oRub.TweenFadeOut(1.0);



Khris

Try calling the tween command first, then calling .Move on the object.
But post more of the relevant code, just to be sure. This doesn't sound necessarily like an issue the tween manual will solve.

Olleh19

#3
Maybe i should have explained better. The object is most definately moving. It's animated before hand in the actual animation.
The code is all there is. Nothing more! The object is supposed to move to an end (which it does thru Photoshop's actual animation). But while it's moving it should began it's fading process. If that makes any sense? Now it just moves, and when it's been moved. The fade process starts shortly after which is "wrong". However the actual fade i've managed to get right with the code that is posted. It just needs some additional parameter (if possible) where the Tween just starts the process of fading earlier.

Privateer Puddin'

What's your code for animating the object? Is it blocking, and thus only running the tween once it's finished?

Olleh19

#5
Edit: SOLVED!

Khris

Can you tell us what the issue was, so this thread might help others in the future?

Olleh19

Quote from: Khris on Wed 09/09/2020 08:22:28
Can you tell us what the issue was, so this thread might help others in the future?

Edited, now can you tell me how i define a object in script so Tween recognise it? Trying to create a custom function out of it. But Tween is not letting me do that.

Code: ags
function Rub() //Effects, Ambient Animation
{

object[0].SetView(43, 0);
object[0].Animate(1, 0, eRepeat, eNoBlock);
oRub.TweenFadeOut(1.0); //this does not recognise oRub, cause it's not global i suppose.

}

Khris


Olleh19

Quote from: Khris on Wed 09/09/2020 08:48:59
Just use  object[0].Tween...


Not working gives an error Animations.asc(18): Error (line 18): '.TweenFadeOut' is not a public member of 'Object'. Are you sure you spelt it correctly (remember, capital letters are important)?

It was actually the first thing i tried before. I'm guessing i need to define oRub someway in the globalscript then?

Code: ags
{

object[0].SetView(43, 0);
object[0].Animate(1, 0, eRepeat, eNoBlock);
object[0].TweenFadeOut(1.0);

}

Khris

You need to move the Tween module further up the Script tree, so it is above your Animations script. Right click either one and select "Move up/down".

Olleh19

Quote from: Khris on Wed 09/09/2020 09:39:45
You need to move the Tween module further up the Script tree, so it is above your Animations script. Right click either one and select "Move up/down".

Thank you ever so much Khris!! AGS forums MVP, no doubt about it!    :)

SMF spam blocked by CleanTalk