libseed-list Clutter.Animator.set_key - g_value_set_float: assertion `G_VALUE_HOLDS_FLOAT (value)' failed
- From: tomw <tomw ubilix com>
- To: libseed-list <libseed-list gnome org>
- Subject: libseed-list Clutter.Animator.set_key - g_value_set_float: assertion `G_VALUE_HOLDS_FLOAT (value)' failed
- Date: Fri, 10 Dec 2010 09:01:55 +0100
Hi,
trying to pass the variable to a Clutter.Animator.set_key method I'm
getting the following error messages:
(seed:2219): GLib-GObject-CRITICAL **: g_value_set_float: assertion
`G_VALUE_HOLDS_FLOAT (value)' failed
(seed:2219): Clutter-CRITICAL **: clutter_interval_set_initial_value:
assertion `G_VALUE_TYPE (value) == priv->value_type' failed
from my limited knowledge it seems that the values are not properly
passed to the method
Any idea how to fix this?
br, tomw
the code is as follows:
#!/usr/bin/env seed
const Clutter = imports.gi.Clutter;
const GObject = imports.gi.GObject;
Clutter.init(Seed.argv);
var stage = Clutter.Stage.get_default ();
stage.set_size(640, 480);
var rec = new Clutter.Rectangle();
var col = new Clutter.Color();
col.from_string("light blue");
rec.set_color(col);
rec.set_anchor_point_from_gravity(Clutter.Gravity.CENTER);
rec.set_size(100,100);
var start_value = new GObject.Value(imports.gi.GObject.TYPE_FLOAT);
var end_value = new GObject.Value(imports.gi.GObject.TYPE_FLOAT);
start_value = 200;
end_value = 300;
a = 0.5;
b = 0.8;
var animator = new Clutter.Animator();
var tl = new Clutter.Timeline({duration: 10000});
animator.set_timeline(tl);
animator.set_duration(3000);
animator.set_key(rec, "x", 2, a, start_value);
animator.set_key(rec, "x", 2, b, end_value);
stage.add_actor(rec);
stage.show();
animator.start();
Clutter.main();
stage.destroy();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]