Player
Player copied to clipboard
NewCommand 2052 - AnimateVariable
The idea is to generate and execute a sequence of variables command changes that goes from
a start
value to an end
value. Following Motion Easing, Time Duration and a pause between frames.
@raw 2052, "linear/bounceOut", 0, 1, 0, 0, 0, 240, 0, 640, 0, 0
@raw 2052, "easeTypeStart/easeTypeEnd", targetVariableIsVar, targetVariable, startIsVar, start, endIsVar, end, durationIsVar, duration, pauseIsVar, pause
You can also write only bounceInOut
instead of bounceIn/bounceOut
easeTypeStart
and easeTypeEnd
can be:
"linear"
"ease", "easeIn", "easeOut", "easeInOut"
"quadIn", "quadOut", "quadInOut" //quadratic easing
"cubicIn", "cubicOut", "cubicInOut"
"quartIn", "quartOut", "quartInOut"
"quintIn", "quintOut", "quintInOut"
"sineIn", "sineOut", "sineInOut" //sinusoidal easing
"ExpoIn", "expoOut", "expoInOut" //exponential easing
"circIn", "circOut", "circInOut" //circular easing
"backIn", "backOut", "backInOut"
"elasticIn", "elasticOut", "elasticInOut"
"bounceIn", "bounceOut", "bounceInOut"
bezier(x1, y1, x2, y2) //cubic Bezier(curveHandle1_x, curveHandle1_y, curveHandle2_x, curveHandle2_y,)
cubic bezier works!!!!!!!!!! References for getting bezier values: https://matthewlein.com/tools/ceaser https://cubic-bezier.com/
bezier(0.9, -0.3, 0.03, 1.3)
- Black dots position representx x1, y1
and x2, y2
.
I learned what I needed to know about setting up cubic bezier, clean interpolation and correct event event pushing. Everything is fully functional and a little cleaner to read.
This one is properly rebased and fully working.
any idea in which file that cubicBezir
function could be relocated? Is 150 lines so do not really want that much extra lines in this already far-too-complex cpp file :sweat_smile: .
Oh, and a camel walked through your code ;).
// this is a fix, again, with post-increment operators
<- Can you explain why this is needed?
Cubic bezier stuff could be realocated to a new file, maybe called: animation_helper. Since this could be ported for pictures, or whatever moves between points if needed.
Those comments I wrote while fighting some annoying bugs that I can't remember anymore xD I should delete them.
Changed the code, feel free to rename the newer files if "animation_helper" is not a good name convention.
btw, there's a minor issue that I wasn't able to fix but it's not a problem if this isn't fixed at all:
I failed to make the the InOut
interpolation work exactly as the In/Out
interpolation
The picture A above use linear/linear
, then ElasticIn/ElasticOut
The picture B above use linear
, then ElasticInOut
The issue may be related to the // use 2 interpolations: start and end.
area of the code.
Here's the map with this demo: Talk to the Dog to start it: Map0007.zip
Rebased.