Пример #1
0
 public ScrollbarArrow(Game game, Sprite arrow, int drawOrder)
     : base(game)
 {
     Arrow = arrow;
     Arrow.XRelative = 0;
     Arrow.YRelative = 0;
                 
     this.StackOrder = drawOrder;
     AddChild(Arrow);
 }
        public MessagePanelOKButton(Game game)
            : base(game) 
        {
            
            btnSprite = new Sprite(game, GraphicsCollection.GetPack("ok_button"));
            btnSprite.XRelative = 0;
            btnSprite.YRelative = 0;
            btnSprite.StackOrder = 0;

            AddChild(btnSprite);
        }
        public CommandCenterGeneralButton(Game game, Sprite sprite, int drawOrder)
            : base(game)
        {
            ButtonSprite = sprite;

            ButtonSprite.XRelative = 0;
            ButtonSprite.YRelative = 0;

            this.StackOrder = drawOrder;

            AddChild(ButtonSprite);
        }
Пример #4
0
        public TimeGateUpgrade(Game game, Sprite sprite, int drawOrder)
            : base(game)
        {
            ButtonSprite = sprite;

            ButtonSprite.XRelative = 0;
            ButtonSprite.YRelative = 0;

            this.StackOrder = drawOrder;

            AddChild(ButtonSprite);
        }
Пример #5
0
        /// <summary>
        /// RadioButton Constructor
        /// </summary>
        /// <param name="ButtonSprite">A two frames Sprite which will act as a button for checking/unchecking the Radio Box</param>
        /// <param name="Box">A two frames Sprite which will be the Radio Box</param>
        /// <param name="positions">A 4 size int vector containing the coordinates btnSprite.X, btnSprite.Y, box.X, box.Y</param>
        public RadioButton(Game game, Sprite btnSprite, Sprite box, int DrawOrder, int[] positions)
            : base(game)
        {
            ButtonSprite = btnSprite;
            ButtonSprite.StackOrder = DrawOrder;
            ButtonSprite.XRelative = positions[0];
            ButtonSprite.YRelative = positions[1];
            AddChild(ButtonSprite);

            Box = box;
            Box.StackOrder = DrawOrder;
            Box.XRelative = positions[2];
            Box.YRelative = positions[3];
            AddChild(Box);
        }
        public TimeGateUpgradeLevel(Game game, Sprite boughtSprite, int drawOrder)
            : base(game)
        {
            graphicsCollection = (GraphicsCollection)Game.Services.GetService(typeof(GraphicsCollection));

            StatusSprite = new Sprite(game, graphicsCollection.GetPack("LevelStatus"));
            StatusSprite.XRelative = 0;
            StatusSprite.YRelative = 0;

            BoughtSprite = boughtSprite;
            BoughtSprite.XRelative = 0;
            BoughtSprite.YRelative = 0;

            this.StackOrder = drawOrder;

            AddChild(StatusSprite);
            AddChild(BoughtSprite);
        }
        public CommandCenterZoneButton(Game game, Sprite sprite, Sprite effect, int drawOrder)
            : base(game)
        {
            ButtonSprite = sprite;

            ButtonSprite.XRelative = 0;
            ButtonSprite.YRelative = 0;

            EffectSprite = effect;
            EffectSprite.AnimationSpeed = 0;
            EffectSprite.Visible = false;
            EffectSprite.XRelative = 0;
            EffectSprite.YRelative = 0;

            this.StackOrder = drawOrder;

            locked = true; //the zone is initially locked

            AddChild(ButtonSprite);
            AddChild(EffectSprite);           
        }
Пример #8
0
        /// <summary>
        /// Scrollbar 2 Sprites constructor (without Scrollbar bar sprite)
        /// </summary>
        /// <param name="game"></param>
        /// <param name="UpArrow">The scrollbar up arrow 2frames-sprite</param>
        /// <param name="DownArrow">The scrollbar down arrow 2frames-sprite</param>
        /// <param name="drawOrder">The Scrollbar draw order</param>
        /// <param name="positions">A size 4 int vector for UpArrow(X,Y), DownArrow(X,Y)</param>
        public Scrollbar(Game game, Sprite upArrow, Sprite downArrow,int drawOrder ,int[] positions)
            : base(game)
        {
            UpArrow  = new ScrollbarArrow(game, upArrow, drawOrder);
            UpArrow.Position = new Point(positions[0],positions[1]);
            UpArrow.OnPress+= new EventHandler<ButtonEventArgs>(Do_ScrollUp);

            DownArrow  = new ScrollbarArrow(game, downArrow, drawOrder);
            DownArrow.Position = new Point(positions[2],positions[3]);
            DownArrow.OnPress+= new EventHandler<ButtonEventArgs>(Do_ScrollDown);

            UseBar = false;

            this.StackOrder = drawOrder;
			
			AddChild(UpArrow);
			AddChild(DownArrow);
        }
Пример #9
0
        /// <summary>
        /// Scrollbar 3 Sprites constructor
        /// </summary>
        /// <param name="game"></param>
        /// <param name="Bar">The scrollbar bar 1frame-sprite</param>
        /// <param name="UpArrow">The scrollbar up arrow 2frames-sprite</param>
        /// <param name="DownArrow">The scrollbar down arrow 2frames-sprite</param>
        /// <param name="drawOrder">The Scrollbar draw order</param>
        /// <param name="positions">A size 6 int vector for Bar(X,Y), UpArrow(X,Y), DownArrow(X,Y)</param>
        public Scrollbar(Game game, Sprite Bar, Sprite upArrow, Sprite downArrow,int drawOrder ,int[] positions)
            : base(game)
        {
            BarSprite = Bar;
            BarSprite.XRelative = positions[0];
            BarSprite.YRelative = positions[1];
            this.StackOrder = drawOrder;

            UpArrow  = new ScrollbarArrow(game, upArrow, drawOrder);
            UpArrow.Position = new Point(positions[2],positions[3]);
            UpArrow.OnPress+= new EventHandler<ButtonEventArgs>(Do_ScrollUp);

            DownArrow  = new ScrollbarArrow(game, downArrow, drawOrder);
            DownArrow.Position = new Point(positions[4],positions[5]);
            DownArrow.OnPress+= new EventHandler<ButtonEventArgs>(Do_ScrollDown);

            UseBar = true;

             AddChild(BarSprite);
			 AddChild(UpArrow);
			 AddChild(DownArrow);
        }