Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Tween and timeline -- create ease animation in C++ (cpgf library version 1.5.5)

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
No replies to this topic

#1 wqking   Members   

761

Posted 04 May 2013 - 09:41 PM

I'm glad to announce cpgf library version 1.5.5 is release.

 

cpgf library -- free C++ open source library for reflection, serialization, Lua, Google V8 JavaScript and Python script binding, callbacks

 

Changes log:

  • Added tweening and timeline library.
  • Added generic property accessors, getter and setter.
  • Refactored meta property to reuse generic property accessors.
  • Fixed a bug that using function (not pointer) as property accessor may cause wrong address crash in VC.
  • Fixed a bug that using policy GMetaRuleExplicitThis on property setter may cause wrong argument being selected.
  • Fixed a compile error in gstdint.h in VC 2012.

Sample code to create tween animation

// Define a sprite somewhere.
FooSprite mySprite;
 
// Setup the tween
GTween & tween = GTweenList::getInstance()->createTween()
  .duration(2.0f)
  .ease(ElasticEase::easeIn())
 
  // We can use getter/setter functions
  .target(createAccessor(&mySprite, &FooSprite::getX, &FooSprite::setX), 100)
 
  // We can also use property address directly, as long as the property is public.
  .target(createAccessor(&mySprite, &FooSprite::y, &FooSprite::y), 200)
;
 
// The main tick function
void gameLoop(float frameDuration)
{
  GTweenList::getInstance()->tick(frameDuration);
}

The library web site:
http://www.cpgf.org/

 

Tween library documentation

http://www.cpgf.org/document/cpgf-tween-library.html

 


http://www.cpgf.org/
cpgf library -- free C++ open source library for reflection, serialization, script binding, callbacks, and meta data for OpenGL Box2D, SFML and Irrlicht.
v1.5.5 was released. Now supports tween and timeline for ease animation.





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.