CCActionFrameEasing.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /****************************************************************************
  2. Copyright (c) 2013-2017 Chukong Technologies Inc.
  3. http://www.cocos2d-x.org
  4. Permission is hereby granted, free of charge, to any person obtaining a copy
  5. of this software and associated documentation files (the "Software"), to deal
  6. in the Software without restriction, including without limitation the rights
  7. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. copies of the Software, and to permit persons to whom the Software is
  9. furnished to do so, subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in
  11. all copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18. THE SOFTWARE.
  19. ****************************************************************************/
  20. #ifndef __ActionFrameEasing_H__
  21. #define __ActionFrameEasing_H__
  22. #include "base/CCRef.h"
  23. #include "editor-support/cocostudio/CocosStudioExport.h"
  24. namespace cocostudio {
  25. enum FrameEasingType
  26. {
  27. kframeEasingInstant,
  28. kframeEasingLinear,
  29. kframeEasingCubicIn,
  30. kframeEasingCubicOut,
  31. kframeEasingCubicInOut,
  32. kframeEasingElasticIn,
  33. kframeEasingElasticOut,
  34. kframeEasingElasticInOut,
  35. kframeEasingBounceIn,
  36. kframeEasingBounceOut,
  37. kframeEasingBounceInOut,
  38. kframeEasingBackIn,
  39. kframeEasingBackOut,
  40. kframeEasingBackInOut,
  41. };
  42. /**
  43. * @js NA
  44. * @lua NA
  45. */
  46. class CC_STUDIO_DLL ActionFrameEasing:public cocos2d::Ref
  47. {
  48. protected:
  49. FrameEasingType _type;
  50. float _fValue;
  51. public:
  52. ActionFrameEasing();
  53. virtual ~ActionFrameEasing();
  54. float bounceTime(float t);
  55. float easeValue(float t);
  56. };
  57. }
  58. #endif