[Behavior] LiteTween

Post your completed addons to share with the community

Post » Sat Jun 22, 2013 7:12 am

Posted a fix for problem that only got caught just now...
1. It ignores enforce mode and always stays in compromise mode.
2. Restarting and setting initial problem fixed.
B
33
S
6
G
1
Posts: 180
Reputation: 3,630

Post » Sat Jun 22, 2013 9:30 am

You might want to offer in the tips how to set the target data.

ie
position "100,100" or "" & self.x + 100 & "," & self.y -1 00

Also I tried changing the name for set target to "all". This caused a javascript error. You probably want to catch invalid tween names and give a console log report. rather than letting a crash go through.jayderyu2013-06-22 11:48:40
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Sat Jun 22, 2013 7:04 pm

@jayderyu

Thanks for trying it out. I was planning to fix it all at once and make a proper demo (kinda like a documentation in form of a demo), but i got distracted with things irl...

As for initial or target string, it currently accept these types:

"current": The current object's opacity, angle, or position depends on the context. This is replaced by the said value when the tween is created, not when the tween is played. Example: tween got created when the object is at (120, 30), current will be replaced with (120,30) when it is first created.

"relative(x,y)": where x, y is relative to the current position, angle or opacity. It can accept negative value. Also, this one got replaced with the said value when the tween is created.
example: "relative(-10,100)"

"x,y": the x,y coordinate of the target or initial string. Depends on the context of the tween, it can also accept single value as in "100" for opacity etc.

About tween name, it accepts "all" just fine here, even for the set target too. Could you provide a capx for it?

The special tween name would be "default", "all", "earliest" and "furthest". It depends on the context.

"default" is the default tween which property is changed in the IDE. It is not really a special one though. It's just a tween that got named "default" and got created when we include the behavior.

"all" means that you target all the tween in the behavior at once. It works in almost all of the action (except set parameter/create tween for kinda apparent reason :(, will fix that up later).

"earliest" and "furthest" are captured only on progress checking, because it didn't make sense in other context.

PS: There are some bug fixes happening when I made this post, please update it to the latest behavior. Thanks :>lunarray2013-06-22 19:14:08
B
33
S
6
G
1
Posts: 180
Reputation: 3,630

Post » Sun Jun 23, 2013 7:55 am

Is 0.8 on the first page the newest? There seems to be something wrong.

I've got a sprite, set it's initial to "current". Then set its target to a specific X and Y position, then every second play the tween...but it seems like it's moving its target every time the tween plays.

Also a sprite that goes from opacity 100 to 0, only does that once. No matter if I try to play the tween again.
B
21
S
2
G
1
Posts: 90
Reputation: 2,146

Post » Sun Jun 23, 2013 8:51 am

This is what I did
https://docs.google.com/file/d/0B0V2EvCXNzYUbXY1Z1dmSm9jNGc/edit?usp=sharing

Now I know I used it wrong, but this causes an error on my computer.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Sun Jun 23, 2013 9:27 am

@jayderyu

I see, that was a very terrible bug on my side, I was looping the tweens with a wrong iteration variable... and copying the wrong litetween on the wrong directory.

But this one should be fixed, I even attached a copy of setting "all" on every action with this capx.

Fixed capx

@Kenney
I think it is not a bug and has something to do with Enforce and Compromise mode. I will try to make a post about compromise vs. enforce after this.
Try setting it to Enforce. If you could provide me with capx, I might be able to look more into it...
I set the newest litetween (just uploaded one), now it is set with enforce mode defaulting to Enforce instead of Compromise.lunarray2013-06-24 06:13:48
B
33
S
6
G
1
Posts: 180
Reputation: 3,630

Post » Sun Jun 23, 2013 9:42 am

Hm, from what I read in the description of the fields "target" is always relative? That should explain my confusion, it doesn't matter if I set enforce or compromise. Always uses target as relative, can it somehow be made static and not relative to the sprite?
B
21
S
2
G
1
Posts: 90
Reputation: 2,146

Post » Sun Jun 23, 2013 10:56 am

I love your plugin and personally think with some tinkering that your tween should be standard.

However, I find that working with strings to be annoying. Often I work calling variables from other sources. So using strings is inconvenient as I need to embed the var into a string.

If your are going to stick with strings may I suggest splitting Set Target to

Set Target
Tween Name:
Target Is: (drop down box for angle, opacity, X, Y....)
Is Relative(true/false)
value:

Set Target position
Tween Name:
Is Relative(true/false)
X:
Y:

as it is now. Using it is peculiar and not very inline with how C2 works naturally. LiteTween practically uses it's own little mini language. Which could be removed and made more natural with other C2 plugins.

Also, I'm not a big fan of the naming system. As A thought. Wouldn't just adding additional LiteTween's and renaming them in the behaviour list be more "natural" to the C2 system. I know that by adding string names for tween can reduce the number of behaviours to just 1, but only Ease/LiteTween do this that I have used.

I know it seems I'm complaining. I'm not really. I'm just offering some thought to have it feel more intuitive and simpler to use. Other than that. Loving lunaray tween mods :) top notch and one of the best :)
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Sun Jun 23, 2013 12:42 pm

@jayderyu

I think I see your point there, the string parsing and all are unintuitive. I think I'll try going with your suggestion for set target, and properly hide the "current" and "relative" etc from it. It is not very nice for newcomers to C2. I'll put that here after I finished it today, hopefully tomorrow it will be ready.

About the tween naming system. I also agree that removing the naming system and go with C2 way of naming the behavior in the IDE is more eventsheet friendly. So yeah, maybe for litetween I should keep it small and should not trying to input too many features in it. Let's see what I can do with it.

Going back to the reason I created LiteTween, is because with easetween I inputted too many features in it till it became so big (old habit dies hard). So simplifying the interface and removing features to the absolute essential is still very relevant to litetween.

Thanks for the suggestion, I'll go with that route now.

@Kenney
Can you please show it in a small capx? Because it works for me here with enforce and target (100,100). But maybe you would want to wait till I do redux like what jayderyu suggested.
B
33
S
6
G
1
Posts: 180
Reputation: 3,630

Post » Sun Jun 23, 2013 2:43 pm

@jayderyu
Could you try this one? I modified alot and removed "Set Initial" too.

LiteTween 0.9

@Kenney
I found the problem in the old lite tween, but i'm not going to maintain two version of litetween :(, so eventhough I fixed those bugs, you might want to try the v0.9.

PS: I also made a simple demo for it...
Demo CAPXlunarray2013-06-24 06:12:14
B
33
S
6
G
1
Posts: 180
Reputation: 3,630

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 3 guests