Created
May 28, 2011 12:48
-
-
Save yurenju/996839 to your computer and use it in GitHub Desktop.
transition
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; | |
/* | |
easeInQuad, easeOutQuad, easeInOutQuad | |
easeInCubic, easeOutCubic, easeInOutCubic | |
easeInQuart, easeOutQuart, easeInOutQuart | |
easeInQuint, easeOutQuint, easeInOutQuint | |
easeInSine, easeOutSine, easeInOutSine | |
easeInExpo, easeOutExpo, easeInOutExpo | |
easeInCirc, easeOutCirc, easeInOutCirc | |
easeInElastic, easeOutElastic, easeInOutElastic | |
easeInBack, easeOutBack, easeInOutBack | |
easeInBounce, easeOutBounce, easeInOutBounce | |
*/ | |
function click(actor, ev) { | |
Tweener.addTween(t, { time: 1.0, | |
x: t.x+100, | |
y: t.y+100, | |
transition: 'easeInBounce'}); | |
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