Hi guys, im sure there is an easy way to do this but what i am wanting to do is use a string inside my ofxTween call to switch between the various easings that comes shipped with it.
The line below is what I am trying to manipulate.
ofxTween::map(float value, float inputMin, float inputMax, float outputMin, float outputMax, bool clamp, ofxEasing & easing, ofxEasingType type);
the part that says ofxEasing & easing I would like to put a string variable in there so I can switch between the various easing functions with the below code.
switch (key) {
case '1':
easeType = "easeLinear";
break;
case '2':
easeType = "easeQuad";
break;
case '3':
easeType = "easeCubic";
break;
case '4':
easeType = "easeQuart";
break;
case '5':
easeType = "easeQuint";
break;
case '6':
easeType = "easeExpo";
break;
case '7':
easeType = "easeSine";
break;
case '8':
easeType = "easeCirc";
break;
case '9':
easeType = "easeBack";
break;
case '0':
easeType = "easeBounce";
break;
case '-':
easeType = "easeElastic";
break;
default:
break;
}
I know that the function in expecting a ofxEasing input and I am giving it a string but I was wondering how I would convert my string somehow so I could give it the correct input. Any ideas would be super appreciated.
Thanks.