Created
May 28, 2011 09:22
-
-
Save yurenju/996736 to your computer and use it in GitHub Desktop.
delay, onComplete
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Clutter = imports.gi.Clutter; | |
const Tweener = imports.tweener.tweener; | |
function click(actor, ev) { | |
if (ev.get_button() == 1) { | |
Tweener.addTween(t, {time: 1.0, x: t.x+100}); | |
Tweener.addTween(t, {time: 1.0, y: t.y+100, delay: 1.0}); | |
Tweener.addTween(t, {time: 1.0, scale_x:t.scale_x*0.5, delay: 2.0}); | |
} | |
else { | |
Tweener.addTween(t, { time: 1.0, x: t.x+100, | |
onComplete: function() { | |
print("onComplete"); | |
} | |
}); | |
} | |
print('Clicked!'); | |
return true; | |
} | |
function quit(actor) { | |
Clutter.main_quit(); | |
} | |
Clutter.init(0, null); | |
let stage = new Clutter.Stage(); | |
let t= new Clutter.Texture({ filename: 'test.jpg', | |
reactive: true }); | |
t.connect('button-press-event', click); | |
stage.connect('destroy', quit); | |
stage.add_actor(t); | |
stage.show(); | |
Clutter.main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment