On Tue, 2009-09-22 at 16:00 +0300, Aarto Matti wrote: > On Tue, Sep 22, 2009 at 2:32 PM, Aarto Matti <[email protected]> > wrote: > Hello, > > Can some one give an example of using effects with latest > Cluttermm? I receive "error: ‘Clutter::EffectTemplate’ has not > been declared" but it's there > > http://www.gtkmm.org/docs/cluttermm-0.9/docs/reference/html/classClutter_1_1EffectTemplate.html > > -- > Aarto > > I found out that since 0.9.4 effects are replaced with Animation, but > I cant get it how to use it anyway. > > In Clutter it would be: > > clutter_actor_animate (actor, CLUTTER_EASE_SINE_OUT, 500, > "x", 100, > "y", 100, > NULL); > > In Cluttermm animate is defined as: > Glib::RefPtr< Animation > animate (gulong mode, unsigned int duration, > const std::map< std::string, Glib::ValueBase > &properties) > > To be hones I have to idea how to fill const std::map< std::string, > Glib::ValueBase > &properties. Please some one help. > > -- > Aarto >
Probably something like this: std::map<std::string, Glib::ValueBase> props; std::pair<std::string, Glib::ValueBase> prop_pair; // Glib::Value<float> inherits from Glib::ValueBase. Glib::Value<float> x, y; x.set(100); y.set(100); prop_pair.first = "x"; prop_pair.second = x; props.insert(prop_pair); prop_pair.first = "y"; prop_pair.second = y; props.insert(prop_pair); my_animation->animate(my_mode, my_duration, props); Krzem > _______________________________________________ > gtkmm-list mailing list > [email protected] > http://mail.gnome.org/mailman/listinfo/gtkmm-list _______________________________________________ gtkmm-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtkmm-list
