Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            Application.Init();

            Stage stage = Stage.Default as Stage;

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

            // fixme: add constructor
            Clutter.Color stage_color = new Clutter.Color(0xcc, 0xcc, 0xcc, 0xff);
            stage.SetColor(stage_color);

            Clutter.Group group = new Group();
            stage.Add(group);
            group.Show();

            // Make a hand
            Clutter.Actor hand = new Texture("redhand.png");
            hand.SetPosition(0, 0);
            hand.Show();

            // Make a rect
            Clutter.Rectangle rect = new Clutter.Rectangle();
            rect.SetPosition(0, 0);
            rect.SetSize((int)hand.Width, (int)hand.Height);

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

            group.Add(rect);
            group.Add(hand);

            // Make a timeline
            Timeline timeline = new Timeline(100, 26);

            timeline.Loop = true;

            Alpha alpha = new Alpha(timeline, (a) => a.Value);

            Behaviour o_behave = new BehaviourOpacity(alpha, 0x33, 0xff);

            o_behave.Apply(group);

            // Make a path behaviour and apply that too
            Behaviour p_behave = new BehaviourPath(alpha, knots);             // fixme: add custom constructor?

            p_behave.Apply(group);

            // start timeline
            timeline.Start();

            stage.ShowAll();

            // launch
            Application.Run();
        }
Ejemplo 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();
    }
Ejemplo n.º 3
0
 protected Clutter.Color GetFontColor()
 {
     if (colors == null)
     {
         colors    = new Clutter.Color[4];
         colors[0] = new Clutter.Color(1.0f, 1.0f, 1.0f, 0.6f);
         colors[1] = new Clutter.Color(1.0f, 1.0f, 1.0f, 0.75f);
         colors[2] = new Clutter.Color(1.0f, 1.0f, 1.0f, 0.9f);
         colors[3] = new Clutter.Color(0.0f, 0.0f, 0.0f, 0.75f);
     }
     if (state >= 4)
     {
         return(colors[3]);
     }
     else if (state >= 2)
     {
         return(colors[2]);
     }
     else if (state == 1)
     {
         return(colors[1]);
     }
     else
     {
         return(colors[0]);
     }
 }
Ejemplo n.º 4
0
        public static void Main(string[] args)
        {
            Application.Init ();

            Stage stage = Stage.Default as Stage;
            (stage as Stage).KeyPressEvent += delegate {
                Clutter.Main.Quit();
            };

            // fixme: add constructor
            Clutter.Color stage_color = new Clutter.Color (0xcc, 0xcc, 0xcc, 0xff);
            stage.SetColor (stage_color);

            Clutter.Group group = new Group();
            stage.Add (group);
            group.Show ();

            // Make a hand
            Clutter.Actor hand = new Texture ("redhand.png");
            hand.SetPosition (0,0);
            hand.Show ();

            // Make a rect
            Clutter.Rectangle rect = new Clutter.Rectangle();
            rect.SetPosition (0,0);
            rect.SetSize ((int)hand.Width, (int)hand.Height);

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

            group.Add (rect);
            group.Add (hand);

            // Make a timeline
            Timeline timeline = new Timeline (100, 26);
            timeline.Loop = true;

            Alpha alpha = new Alpha (timeline, (a) => a.Value);

            Behaviour o_behave = new BehaviourOpacity (alpha, 0x33, 0xff);
            o_behave.Apply (group);

            // Make a path behaviour and apply that too
            Behaviour p_behave = new BehaviourPath(alpha, knots); // fixme: add custom constructor?
            p_behave.Apply (group);

            // start timeline
            timeline.Start ();

            stage.ShowAll();

            // launch
            Application.Run ();
        }
Ejemplo n.º 5
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 ();
    }
 protected Clutter.Color GetFontColor()
 {
     if (colors==null) {
         colors = new Clutter.Color[4];
         colors[0] = new Clutter.Color (1.0f, 1.0f, 1.0f, 0.6f);
         colors[1] = new Clutter.Color (1.0f, 1.0f, 1.0f, 0.75f);
         colors[2] = new Clutter.Color (1.0f, 1.0f, 1.0f, 0.9f);
         colors[3] = new Clutter.Color (0.0f, 0.0f, 0.0f, 0.75f);
     }
     if (state>=4)
         return colors[3];
     else if (state >= 2)
         return colors[2];
     else if (state == 1)
         return colors[1];
     else
         return colors[0];
 }
Ejemplo n.º 7
0
 public ScrollActor(Clutter.Color color)
     : this(color, 20)
 {
 }
Ejemplo n.º 8
0
 public ScrollActor(Clutter.Color color, int scroll_offset)
     : base(color)
 {
     this.scroll_offset = scroll_offset;
     Reactive           = true;
 }