On Wed, 2009-01-14 at 07:19 +0000, Dan Higham wrote:
> Hi clad, correct me if I am wrong but I think you have to use
> set_scale, I am sure this is the case after adding the texture to a
> group and trying to resize the group.
If you call set_size on the texture actor then it *should* squish the
texture to fit into the rectangle. This works for me in the attached
example.
However if you are putting all of the icons into a group and then trying
to size them all in one call by setting the size of the group then that
won't work. ClutterGroup doesn't do any layout so it will ignore the
size you set on it.
Regards,
- Neil
#include <clutter/clutter.h>
int
main (int argc, char **argv)
{
ClutterActor *stage = stage, *tex;
GError *error = NULL;
clutter_init (&argc, &argv);
stage = clutter_stage_get_default ();
tex = clutter_texture_new ();
if (!clutter_texture_set_from_file (CLUTTER_TEXTURE (tex),
"redhand.png", &error))
{
g_warning ("Failed to load redhand.png: %s", error->message);
g_clear_error (&error);
}
/* Squash the texture into a small size */
clutter_actor_set_size (tex, 60, 60);
clutter_container_add (CLUTTER_CONTAINER (stage), tex, NULL);
clutter_actor_show (stage);
clutter_main ();
return 0;
}