for i in range(TOTAL):
        row = i / COLS
        col = i % COLS

        actor = Group(
            255 * (1.0 * col / COLS),
            50,
            255 * (1.0 * row / ROWS),
            255
        )

        actor.set_position(320, 240)
        actor.set_reactive(True)

        effect = Clutter.DesaturateEffect()

        effect.set_factor(0.0)

        actor.add_effect_with_name("fade", effect)

        # "ACTIVE" state.
        layout_state.set_key(None, "active", actor, "x", Clutter.AnimationMode.LINEAR,
            ACTOR_WIDTH * int((TOTAL - 1 - i) % COLS),
            ((row * 1.0 / ROWS)) / 2,
            (1.0 - (row * 1.0 / ROWS)) / 2
        )
        
        layout_state.set_key(None, "active", actor, "y", Clutter.AnimationMode.LINEAR,
            ACTOR_HEIGHT * int((TOTAL - 1 - i) / COLS),
            ((row * 1.0 / ROWS)) / 2,
示例#2
0
def apply_desaturate_effect(actor):
    actor.clear_effects()
    effect = Clutter.DesaturateEffect()
    effect.set_factor(.5)
    actor.add_effect(effect)