Beispiel #1
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);
        }
Beispiel #2
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);
        }
Beispiel #3
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);
        }
Beispiel #4
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);
        }