Esempio n. 1
0
        public static void Main()
        {
            ClutterRun.Init();

            Stage stage = Stage.Default;

            stage.SetSize(800, 600);
            stage.Color = stage_color;
            stage.Title = "ClutterEntry Test";

            entry = new Entry("Sans 14",
                              "Type something, be sure to use the " +
                              "left/right arrow keys to move the " +
                              "cursor position.");

            entry.Color = entry_color;
            entry.SetSize(600, 50);
            entry.SetPosition(100, 100);

            stage.KeyFocus = entry;
            stage.AddActor(entry);
            stage.ShowAll();

            ClutterRun.Main();
        }
Esempio n. 2
0
    static void Main()
    {
        ClutterRun.Init();
        Stage stage = Stage.Default;

        stage.SetSize(200, 200);

        template = new EffectTemplate(new Timeline(90, 120), Sine.Func);

        rect = new Rectangle();
        Clutter.Color rect_bg_color = new Clutter.Color(0x33, 0x22, 0x22, 0xff);
        rect.Color       = rect_bg_color;
        rect.BorderWidth = 10;

        rect.Reactive = true;
        rect.SetSize(100, 100);
        rect.AnchorPointFromGravity = Gravity.Center;
        rect.SetPosition(100, 100);
        rect.ButtonPressEvent += delegate { ScaleRect(); };

        stage.AddActor(rect);
        stage.ShowAll();

        ClutterRun.Main();
    }
Esempio n. 3
0
    public static void Main()
    {
        random = new Random();

        ClutterRun.Init();

        Stage stage = Stage.Default;

        stage.Fullscreen = true;

        stage.Color = new Clutter.Color(0x10, 0x10, 0x10, 0xff);
        flowers     = new Flower[N_FLOWERS];


        for (int i = 0; i < N_FLOWERS; i++)
        {
            flowers[i]    = new Flower();
            flowers[i].x  = (int)(rand() % stage.Width - (PETAL_MIN + PETAL_VAR) * 2);
            flowers[i].y  = (int)(rand() % stage.Height);
            flowers[i].rv = rand() % 5 + 1;
            flowers[i].v  = rand() % 10 + 2;

            stage.AddActor(flowers[i].ctex);
            flowers[i].ctex.SetPosition(flowers[i].x, flowers[i].y);
        }

        GLib.Timeout.Add(50, new GLib.TimeoutHandler(Tick));

        stage.ShowAll();
        stage.KeyPressEvent += HandleKeyPress;

        ClutterRun.Main();
    }
Esempio n. 4
0
    public static void Main(string[] args)
    {
        int arg;

        Clutter.GstGlobal.GstInit(out arg, string.Empty);

        VideoApp app = new VideoApp(args[0]);

        ClutterRun.Main();
    }
Esempio n. 5
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();
        }
Esempio n. 6
0
        public static void Main()
        {
            ClutterRun.Init();

            Stage stage = Stage.Default;

            stage.SetSize(200, 200);
            stage.Color = stage_color;
            stage.Title = "Override Test";

            actor = new ScrollActor(actor_color, 20);
            actor.SetSize(100, 100);
            actor.AnchorPointFromGravity = Gravity.Center;
            actor.SetPosition(100, 100);
            stage.AddActor(actor);

            stage.ShowAll();
            ClutterRun.Main();
        }
Esempio n. 7
0
    public static void Main()
    {
        ClutterRun.Init();

        script = new Script();
        script.LoadFromData(test_behaviour);
        script.LoadFromFile("test-script.json");
        merge_id = script.LoadFromData(test_unmerge);

        Stage stage       = script.GetObject <Stage>("main-stage");
        Actor blue_button = script.GetObject <Actor>("blue-button");
        Actor red_button  = script.GetObject <Actor>("red-button");

        blue_button.ButtonPressEvent += delegate
        {
            Console.WriteLine("Unmerging");
            script.UnmergeObjects(merge_id);
        };

        red_button.ButtonPressEvent += delegate
        {
            Console.WriteLine("Changing timeline state");
            Timeline timeline = script.GetObject <Timeline> ("main-timeline");

            if (!timeline.IsPlaying)
            {
                timeline.Start();
            }
            else
            {
                timeline.Pause();
            }
        };

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

        stage.ShowAll();

        ClutterRun.Main();
    }
Esempio n. 8
0
    public static void Main()
    {
        ClutterRun.Init();

        Stage stage = Stage.Default;

        stage.SetSize(512, 384);

        Shader shader = new Shader();

        shader.FragmentSource = shader_sources[current_shader];
        shader.Compile();

        stage.Title = "Shader Test";
        stage.Color = new Clutter.Color(0x61, 0x64, 0x8c, 0xff);

        Timeline timeline = new Timeline(360, 60);

        timeline.Loop = true;

        stage.AddActor(new Label("Mono 16", "Press the Hand"));

        Texture actor = new Texture("redhand.png");

        actor.SetShader(shader);
        actor.Reactive          = true;
        actor.ButtonPressEvent += HandleActorButtonPress;
        stage.AddActor(actor);
        actor.SetShaderParam("brightness", 0.4f);
        actor.SetShaderParam("contrast", -1.9f);
        actor.SetPosition(0, 20);

        stage.ShowAll();
        timeline.Start();

        ClutterRun.Main();
    }