Beispiel #1
0
        static void Main()
        {
            if (!GLib.Thread.Supported)
            {
                GLib.Thread.Init();
            }

            Clutter.Threads.Init();
            Clutter.Threads.Enter();

            ClutterRun.Init();

            stage       = Stage.Default;
            stage.Color = stage_color;
            stage.SetSize(800, 600);

            count_label = new Label("Mono 16", "Counter");
            count_label.SetPosition(350, 50);
            count_label.Show();

            label = new Label("Mono 16", "Press 's' to start");
            label.SetPosition(50, 50);
            label.Show();

            rect = new Rectangle(rect_color);
            rect.SetPosition(150, 150);
            rect.SetSize(25, 25);
            rect.Show();

            timeline      = new Timeline(150, 50);
            timeline.Loop = true;

            alpha     = new Alpha(timeline, Sine.Func);
            behaviour = new BehaviourRotate(alpha,
                                            RotateAxis.ZAxis,
                                            RotateDirection.Cw,
                                            0.0,
                                            360.0);
            behaviour.Apply(rect);

            stage.AddActor(rect);
            stage.AddActor(count_label);
            stage.AddActor(label);

            stage.ButtonPressEvent += delegate { Clutter.Main.Quit(); };
            stage.KeyPressEvent    += HandleKeyPress;

            stage.ShowAll();

            ClutterRun.Main();
            Clutter.Threads.Leave();
        }