Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Clutter;
- private bool moved = false;
- private Actor rect;
- private int main(string[] args) {
- if (Clutter.init(ref args) != InitError.SUCCESS) return 1;
- var stage = new Stage();
- stage.destroy.connect(() => {
- Clutter.main_quit();
- });
- stage.key_press_event.connect((key) => {
- if(key.keyval == Key.Escape) Clutter.main_quit();
- return false;
- });
- stage.width = 1360;
- stage.height = 768;
- stage.visible = true;
- rect = new Actor();
- rect.background_color = {255, 0, 0, 255};
- rect.width = 100;
- rect.height = 768;
- rect.transitions_completed.connect(() => {
- move();
- });
- stage.add_child(rect);
- move();
- Clutter.main();
- return 0;
- }
- private void move() {
- rect.save_easing_state();
- rect.x = moved ? 1260 : 0;
- rect.restore_easing_state();
- moved = !moved;
- }
Advertisement
Add Comment
Please, Sign In to add comment