[clutter] change color of actor on button press event
- From: "Patrick Shirkey" <pshirkey boosthardware com>
- To: clutter-list gnome org
- Subject: [clutter] change color of actor on button press event
- Date: Tue, 23 Oct 2012 20:34:32 +1100 (EST)
Hi,
What is the best method to change the color of an actor dynamically?
In the code I posted yesterday there is a set_color() function. It works
when the actor is created and initially displayed.
I tried adding a call to queue_redraw() in the set_color() function but
that only kicks in after button-release-event. I would like to change the
color of the actor on button-press-event.
def set_color(self, color):
"""Fill the shape with the color given in parameter.
color may be a Clutter.Color object or a string representing
the color name.
"""
if isinstance(color, Clutter.Color):
self._color = color
else:
self._color = Clutter.Color()
self._color.from_string(color)
--
Patrick Shirkey
Boost Hardware Ltd
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]