Ejemplo n.º 1
0
        public Scroll(Game game, Texture2D texture, Vector2 position, ScrollableRenderTarget scrollContainer)
            : base(game)
        {
            Texture         = texture;
            Position        = position;
            ScrollContainer = scrollContainer;
            if (scrollContainer != null)
            {
                Width  = scrollContainer.Width;
                Height = scrollContainer.Height;
            }
            Effects    = SpriteEffects.None;
            Alpha      = 1;
            Color      = Color.White;
            Horizontal = true;
            Vertical   = false;

            _rec = new Rectangle((int)_position.X, (int)_position.Y, BarWidth, BarHeight);
        }
Ejemplo n.º 2
0
        public override void Initialize()
        {
            SpriteBatch = Game.Services.GetService(typeof(SpriteBatch)) as SpriteBatch;

            _scrollableRenderTarget = new ScrollableRenderTarget(Game, Width - SpacingX, MaxHeight, _scrollerItems,
                                                                 new ScrollableRenderTargetScroll(Game, _textureUp, _textureDown));

            _scrollerItems.Initialize();

            UpdateSelectedItemPos();

            _scrollableRenderTarget.Initialize();

            _speechBubble.Initialize();

            _selectedItem = null;

            _oldHasFocus = HasFocus;

            base.Initialize();
        }
Ejemplo n.º 3
0
 public Scroll(Game game, Texture2D texture, ScrollableRenderTarget scrollContainer)
     : this(game, texture, Vector2.Zero, scrollContainer)
 {
 }