Ejemplo n.º 1
0
        private void Setup_Controls()
        {
            Controls = new TouchInputCollection();

            Touch Up = new Touch("Up",
                                 new Rectangle(0, 0, Bounds.Width, Bounds.Height / 4),
                                 new Action(Control_Up));

            Controls.AddArea("Up", Up);

            Touch Down = new Touch("Down",
                                   new Rectangle(0, Bounds.Bottom - Bounds.Height / 4, Bounds.Width, Bounds.Height / 4),
                                   new Action(Control_Down));

            Controls.AddArea("Down", Down);

            Touch Left = new Touch("Left",
                                   new Rectangle(0, Bounds.Height / 4, Bounds.Width / 4, Bounds.Height / 2),
                                   new Action(Control_Left));

            Controls.AddArea("Left", Left);

            Touch Right = new Touch("Right",
                                    new Rectangle(Bounds.Right - Bounds.Width / 4, Bounds.Height / 4, Bounds.Width / 4, Bounds.Height / 2),
                                    new Action(Control_Right));

            Controls.AddArea("Right", Right);
        }
Ejemplo n.º 2
0
 public User(Texture2D texture, string name, Rectangle bounds)
 {
     _ = new TouchInputCollection();
     Setup_Controls();
     _Sprite = new Sprite(texture, name, bounds);
 }