Exemple #1
0
        public Button(ContentManager content, Colors borderbrush, int x, int y, int width, int height)
        {
            Border = content.Load<Texture2D>("Images/Laser/" + borderbrush.ToString());

            rec1 = new Rectangle(x, y, width, 6);
            rec2 = new Rectangle(x, y + height - 6, width, 6);
            rec3 = new Rectangle(x + 6, y + 3, height - 6, 6);
            rec4 = new Rectangle(x + width, y + 3, height - 6, 6);
            Rec = new Rectangle(x, y, width, height);
        }
Exemple #2
0
        public Emitter(ContentManager content, Colors color, int x, int y, float angle)
            : base(x,y,60,60)
        {
            this.Foreground = content.Load<Texture2D>(@"Images/Emitter/" + color.ToString());
            this.Origin = new Vector2(Width / 2, Height / 2);

            //0向上/90向右/180向下/270向左
            this.Angle = angle;

            this.Laser = new Laser(this, content, color, this.X, this.Y - 10, angle - 90);
        }
Exemple #3
0
 public Wall(ContentManager content, Colors color, int x,int y)
     : base(x,y,60,60,color)
 {
     Foreground = content.Load<Texture2D>(@"Images/Wall/" + color.ToString());
     sourceRectangle = new Rectangle(5, 5, 60, 60);
 }
Exemple #4
0
 public Switch(ContentManager content, Colors color, int x,int y)
     : base(x,y,60,60,color)
 {
     this.Foreground = content.Load<Texture2D>(@"Images/Switch/" + color.ToString() + "_off");
     this.Background = content.Load<Texture2D>(@"Images/Switch/" + color.ToString() + "_on");
 }
Exemple #5
0
 public Receiver(ContentManager content , Colors color, int x ,int y)
     : base(x,y,60,60,color)
 {
     this.Foreground = content.Load<Texture2D>(@"Images/Receiver/" + color.ToString());
     this.Background = content.Load<Texture2D>(@"Images/Receiver/selected_" + color.ToString());
 }