Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Some tweening questions by a tween noob

Author
Message
n00bstar
20
Years of Service
User Offline
Joined: 9th Feb 2004
Location: Montreal, Canada.
Posted: 28th Aug 2021 20:42
I've never really played with tweens befoer and got around to noodling around with them this week and I can definitely see a million fun applications for them. I've toyed with them a bit, read the documentation and I think I got most of it. I've got two questions that I didn't find a hint for in the help file:

1) Are tween coordinates always absolute or is there a way to make them dynamic? For example: SetTweenSpriteX(tweenID, 0,200,0), 0 and 200 are absolute values. This would move my sprite from 0 to 200. But if my sprite was at 150, it wouldn't move it 150 > 350, it would still move it 0 > 200. I haven't found any way to make tweens dynamic. Well I mean.. I can just create a tween on the fly when I need it I guess, then all my Get commands would return current data.. but any way to pre-define such tweens?

2) Is there a way to loop a tween? or a chain? Seems to me it would be useful.
-----------------------------------------------------------------------------
We all got a chicken duck woman thing waiting for us
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 28th Aug 2021 21:08
1. I am pretty sure Tween coords are world coords, you can make them dynamic or local with :



^^ from UCF project: https://forum.thegamecreators.com/outbound?url=https%3A%2F%2Fforumfiles.thegamecreators.com%2Fdownload%2F2334782

2. not sure, I will be looking at soon, I think it might be a case of checking if the tween has finished and play it again

Am going to use this in my CodeJam project but knee deep in GIMP at mo... and being a man I cant multitask...LOL
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 29th Aug 2021 14:07
1. Tweens are absolute you would have to make it on the fly. You could create a function that would do it for you based on the current values though.
2. There's no auto loop (shame really - it would be useful) but you can check to see if a tween has stopped playing and restart it if it has.
n00bstar
20
Years of Service
User Offline
Joined: 9th Feb 2004
Location: Montreal, Canada.
Posted: 2nd Sep 2021 23:41
Aye that's what I ended up doing, I just gather all the info I need for my tween and create it right before using it. Feels a bit counter intuitive to me, but it's easy to work around it at least. Still though, it seems to me that dynamic tweens could be super useful.

Quote: "Am going to use this in my CodeJam project but knee deep in GIMP at mo... and being a man I cant multitask...LOL"

Sure you can. You can multitask, just....one task at a time, that's all. I call it sequential multitasking.
-----------------------------------------------------------------------------
We all got a chicken duck woman thing waiting for us
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 3rd Sep 2021 00:18
LMAFO, like consecutively concurrent

... That's to much like "Double Speak" for my liking ... just got a shiver down my spine!

Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 3rd Sep 2021 06:17

Login to post a reply

Server time is: 2024-04-26 18:22:09
Your offset time is: 2024-04-26 18:22:09