Exemplo n.º 1
0
 public override void Draw(SpriteBatchUI spriteBatch, Point position)
 {
     if (m_GumpSliderBackground != null)
     {
         spriteBatch.Draw2D(m_GumpSliderBackground[0], new Vector3(position.X, position.Y, 0), Vector3.Zero);
         spriteBatch.Draw2DTiled(m_GumpSliderBackground[1], new Rectangle(position.X + m_GumpSliderBackground[0].Width, position.Y, BarWidth - m_GumpSliderBackground[2].Width - m_GumpSliderBackground[0].Width, m_GumpSliderBackground[1].Height), Vector3.Zero);
         spriteBatch.Draw2D(m_GumpSliderBackground[2], new Vector3(position.X + BarWidth - m_GumpSliderBackground[2].Width, position.Y, 0), Vector3.Zero);
     }
     spriteBatch.Draw2D(m_GumpWidget, new Vector3(position.X + m_sliderX, position.Y, 0), Vector3.Zero);
     base.Draw(spriteBatch, position);
 }
Exemplo n.º 2
0
 public override void Draw(SpriteBatchUI spriteBatch, Vector2Int position, double frameMS)
 {
     if (_gumpSliderBackground != null)
     {
         spriteBatch.Draw2D(_gumpSliderBackground[0], new Vector3(position.x, position.y, 0), Vector3.zero);
         spriteBatch.Draw2DTiled(_gumpSliderBackground[1], new RectInt(position.x + _gumpSliderBackground[0].Width, position.y, BarWidth - _gumpSliderBackground[2].Width - _gumpSliderBackground[0].Width, _gumpSliderBackground[1].Height), Vector3.zero);
         spriteBatch.Draw2D(_gumpSliderBackground[2], new Vector3(position.x + BarWidth - _gumpSliderBackground[2].Width, position.y, 0), Vector3.zero);
     }
     spriteBatch.Draw2D(_gumpWidget, new Vector3(position.x + _sliderX, position.y, 0), Vector3.zero);
     base.Draw(spriteBatch, position, frameMS);
 }
Exemplo n.º 3
0
        public override void Draw(SpriteBatchUI spriteBatch, Point position)
        {
            int centerWidth  = Width - m_bgGumps[0].Width - m_bgGumps[2].Width;
            int centerHeight = Height - m_bgGumps[0].Height - m_bgGumps[6].Height;
            int line2Y       = position.Y + m_bgGumps[0].Height;
            int line3Y       = position.Y + Height - m_bgGumps[6].Height;

            spriteBatch.Draw2D(m_bgGumps[0], new Vector3(position.X, position.Y, 0), Vector3.Zero);
            spriteBatch.Draw2DTiled(m_bgGumps[1], new Rectangle(position.X + m_bgGumps[0].Width, position.Y, centerWidth, m_bgGumps[0].Height), Vector3.Zero);
            spriteBatch.Draw2D(m_bgGumps[2], new Vector3(position.X + Width - m_bgGumps[2].Width, position.Y, 0), Vector3.Zero);

            spriteBatch.Draw2DTiled(m_bgGumps[3], new Rectangle(position.X, line2Y, m_bgGumps[3].Width, centerHeight), Vector3.Zero);
            spriteBatch.Draw2DTiled(m_bgGumps[4], new Rectangle(position.X + m_bgGumps[3].Width, line2Y, centerWidth, centerHeight), Vector3.Zero);
            spriteBatch.Draw2DTiled(m_bgGumps[5], new Rectangle(position.X + Width - m_bgGumps[5].Width, line2Y, m_bgGumps[5].Width, centerHeight), Vector3.Zero);

            spriteBatch.Draw2D(m_bgGumps[6], new Vector3(position.X, line3Y, 0), Vector3.Zero);
            spriteBatch.Draw2DTiled(m_bgGumps[7], new Rectangle(position.X + m_bgGumps[6].Width, line3Y, centerWidth, m_bgGumps[6].Height), Vector3.Zero);
            spriteBatch.Draw2D(m_bgGumps[8], new Vector3(position.X + Width - m_bgGumps[8].Width, line3Y, 0), Vector3.Zero);

            base.Draw(spriteBatch, position);
        }
Exemplo n.º 4
0
        public override void Draw(SpriteBatchUI spriteBatch)
        {
            int centerWidth  = Width - m_bgGumps[0].Width - m_bgGumps[2].Width;
            int centerHeight = Height - m_bgGumps[0].Height - m_bgGumps[2].Height;
            int line2Y       = Y + m_bgGumps[0].Height;
            int line3Y       = Y + Height - m_bgGumps[6].Height;

            spriteBatch.Draw2D(m_bgGumps[0], new Point(X, Y), 0, false, false);
            spriteBatch.Draw2DTiled(m_bgGumps[1], new Rectangle(X + m_bgGumps[0].Width, Y, centerWidth, m_bgGumps[0].Height), 0, false, false);
            spriteBatch.Draw2D(m_bgGumps[2], new Point(X + Width - m_bgGumps[2].Width, Y), 0, false, false);

            spriteBatch.Draw2DTiled(m_bgGumps[3], new Rectangle(X, line2Y, m_bgGumps[0].Width, centerHeight), 0, false, false);
            spriteBatch.Draw2DTiled(m_bgGumps[4], new Rectangle(X + m_bgGumps[0].Width, line2Y, centerWidth, centerHeight), 0, false, false);
            spriteBatch.Draw2DTiled(m_bgGumps[5], new Rectangle(X + Width - m_bgGumps[2].Width, line2Y, m_bgGumps[2].Width, centerHeight), 0, false, false);

            spriteBatch.Draw2D(m_bgGumps[6], new Point(X, line3Y), 0, false, false);
            spriteBatch.Draw2DTiled(m_bgGumps[7], new Rectangle(X + m_bgGumps[0].Width, line3Y, centerWidth, m_bgGumps[6].Height), 0, false, false);
            spriteBatch.Draw2D(m_bgGumps[8], new Point(X + Width - m_bgGumps[2].Width, line3Y), 0, false, false);

            base.Draw(spriteBatch);
        }
Exemplo n.º 5
0
        public override bool Draw(SpriteBatchUI spriteBatch, Vector3 position, Vector3?hue = null)
        {
            int centerWidth  = Width - _frame[0].Width - _frame[2].Width;
            int centerHeight = Height - _frame[0].Height - _frame[6].Height;
            int line2Y       = (int)position.Y + _frame[0].Height;
            int line3Y       = (int)position.Y + Height - _frame[6].Height;

            // top row
            spriteBatch.Draw2D(_frame[0], new Vector3(position.X, position.Y, 0), Vector3.Zero);
            spriteBatch.Draw2DTiled(_frame[1], new Rectangle((int)position.X + _frame[0].Width, (int)position.Y, centerWidth, _frame[0].Height), Vector3.Zero);
            spriteBatch.Draw2D(_frame[2], new Vector3(position.X + Width - _frame[2].Width, position.Y, 0), Vector3.Zero);
            // middle
            spriteBatch.Draw2DTiled(_frame[3], new Rectangle((int)position.X, line2Y, _frame[3].Width, centerHeight), Vector3.Zero);
            spriteBatch.Draw2DTiled(_frame[4], new Rectangle((int)position.X + _frame[3].Width, line2Y, centerWidth, centerHeight), Vector3.Zero);
            spriteBatch.Draw2DTiled(_frame[5], new Rectangle((int)position.X + Width - _frame[5].Width, line2Y, _frame[5].Width, centerHeight), Vector3.Zero);
            // bottom
            spriteBatch.Draw2D(_frame[6], new Vector3(position.X, line3Y, 0), Vector3.Zero);
            spriteBatch.Draw2DTiled(_frame[7], new Rectangle((int)position.X + _frame[6].Width, line3Y, centerWidth, _frame[6].Height), Vector3.Zero);
            spriteBatch.Draw2D(_frame[8], new Vector3(position.X + Width - _frame[8].Width, line3Y, 0), Vector3.Zero);

            return(base.Draw(spriteBatch, position, hue));
        }
Exemplo n.º 6
0
        public override void Draw(SpriteBatchUI spriteBatch, Vector2Int position, double frameMS)
        {
            var centerWidth  = Width - _gumps[0].Width - _gumps[2].Width;
            var centerHeight = Height - _gumps[0].Height - _gumps[6].Height;
            var line2Y       = position.y + _gumps[0].Height;
            var line3Y       = position.y + Height - _gumps[6].Height;

            // top row
            spriteBatch.Draw2D(_gumps[0], new Vector3(position.x, position.y, 0), Vector3.zero);
            spriteBatch.Draw2DTiled(_gumps[1], new RectInt(position.x + _gumps[0].Width, position.y, centerWidth, _gumps[0].Height), Vector3.zero);
            spriteBatch.Draw2D(_gumps[2], new Vector3(position.x + Width - _gumps[2].Width, position.y, 0), Vector3.zero);
            // middle
            spriteBatch.Draw2DTiled(_gumps[3], new RectInt(position.x, line2Y, _gumps[3].Width, centerHeight), Vector3.zero);
            spriteBatch.Draw2DTiled(_gumps[4], new RectInt(position.x + _gumps[3].Width, line2Y, centerWidth, centerHeight), Vector3.zero);
            spriteBatch.Draw2DTiled(_gumps[5], new RectInt(position.x + Width - _gumps[5].Width, line2Y, _gumps[5].Width, centerHeight), Vector3.zero);
            // bottom
            spriteBatch.Draw2D(_gumps[6], new Vector3(position.x, line3Y, 0), Vector3.zero);
            spriteBatch.Draw2DTiled(_gumps[7], new RectInt(position.x + _gumps[6].Width, line3Y, centerWidth, _gumps[6].Height), Vector3.zero);
            spriteBatch.Draw2D(_gumps[8], new Vector3(position.x + Width - _gumps[8].Width, line3Y, 0), Vector3.zero);

            base.Draw(spriteBatch, position, frameMS);
        }
Exemplo n.º 7
0
        public override void Draw(SpriteBatchUI spriteBatch, Point position, double frameMS)
        {
            if (Height <= 0)
            {
                return;
            }

            // draw scrollbar background
            int middleHeight = Height - m_GumpUpButton[0].Height - m_GumpDownButton[0].Height - m_GumpBackground[0].Height - m_GumpBackground[2].Height;

            if (middleHeight > 0)
            {
                spriteBatch.Draw2D(m_GumpBackground[0], new Vector3(position.X, position.Y + m_GumpUpButton[0].Height, 0), Vector3.Zero);
                spriteBatch.Draw2DTiled(m_GumpBackground[1], new Rectangle(position.X, position.Y + m_GumpUpButton[0].Height + m_GumpBackground[0].Height, m_GumpBackground[0].Width, middleHeight), Vector3.Zero);
                spriteBatch.Draw2D(m_GumpBackground[2], new Vector3(position.X, position.Y + Height - m_GumpDownButton[0].Height - m_GumpBackground[2].Height, 0), Vector3.Zero);
            }
            else
            {
                middleHeight = Height - m_GumpUpButton[0].Height - m_GumpDownButton[0].Height;
                spriteBatch.Draw2DTiled(m_GumpBackground[1], new Rectangle(position.X, position.Y + m_GumpUpButton[0].Height, m_GumpBackground[0].Width, middleHeight), Vector3.Zero);
            }

            // draw up button
            spriteBatch.Draw2D(m_BtnUpClicked ? m_GumpUpButton[1] : m_GumpUpButton[0], new Vector3(position.X, position.Y, 0), Vector3.Zero);

            // draw down button
            spriteBatch.Draw2D(m_BtnDownClicked ? m_GumpDownButton[1] : m_GumpDownButton[0], new Vector3(position.X, position.Y + Height - m_GumpDownButton[0].Height, 0), Vector3.Zero);

            // draw slider
            if (MaxValue > MinValue && middleHeight > 0)
            {
                spriteBatch.Draw2D(m_GumpSlider, new Vector3(position.X + (m_GumpBackground[0].Width - m_GumpSlider.Width) / 2, position.Y + m_GumpUpButton[0].Height + m_SliderPosition, 0), Vector3.Zero);
            }

            base.Draw(spriteBatch, position, frameMS);
        }
Exemplo n.º 8
0
        public override void Draw(SpriteBatchUI spriteBatch)
        {
            if (!Visible)
            {
                return;
            }

            // up button
            spriteBatch.Draw2D(m_btnUpClicked ? m_gumpUpButton[1] : m_gumpUpButton[0], new Point(X, Y), 0, false, false);
            // scrollbar background
            spriteBatch.Draw2D(m_gumpBackground[0], new Point(X, Y + m_gumpUpButton[0].Height), 0, false, false);
            int middlewidth = BarHeight - m_gumpUpButton[0].Height - m_gumpDownButton[0].Height - m_gumpBackground[0].Height - m_gumpBackground[2].Height;

            spriteBatch.Draw2DTiled(m_gumpBackground[1], new Rectangle(X, Y + m_gumpUpButton[0].Height + m_gumpBackground[0].Height, m_gumpBackground[0].Width, middlewidth), 0, false, false);
            spriteBatch.Draw2D(m_gumpBackground[2], new Point(X, Y + BarHeight - m_gumpDownButton[0].Height - m_gumpBackground[2].Height), 0, false, false);
            // down button
            spriteBatch.Draw2D(m_btnDownClicked ? m_gumpDownButton[1] : m_gumpDownButton[0], new Point(X, Y + Height - m_gumpDownButton[0].Height), 0, false, false);
            // slider
            spriteBatch.Draw2D(m_gumpSlider, new Point(X + (m_gumpBackground[0].Width - m_gumpSlider.Width) / 2, Y + m_gumpUpButton[0].Height + 1 + (int)m_sliderY), 0, false, false);
            base.Draw(spriteBatch);
        }
Exemplo n.º 9
0
 public void Draw(SpriteBatchUI spriteBatch, int x, int y)
 {
     // determine if properties need to be updated.
     if (_entity != null && _propertyListHash != _entity.PropertyList.Hash)
     {
         _propertyListHash = _entity.PropertyList.Hash;
         Caption           = _entity.PropertyList.Properties;
     }
     // update text if necessary.
     if (_renderedText == null)
     {
         _renderedText = new RenderedText("<center>" + Caption, 300, true);
     }
     else if (_renderedText.Text != "<center>" + Caption)
     {
         _renderedText = null;
         _renderedText = new RenderedText("<center>" + Caption, 300, true);
     }
     // draw checkered trans underneath.
     spriteBatch.Draw2DTiled(CheckerTrans.CheckeredTransTexture, new RectInt(x - 4, y - 4, _renderedText.Width + 8, _renderedText.Height + 8), Vector3.zero);
     // draw tooltip contents
     _renderedText.Draw(spriteBatch, new Vector2Int(x, y));
 }
Exemplo n.º 10
0
 public override void Draw(SpriteBatchUI spriteBatch, Vector2Int position, double frameMS)
 {
     spriteBatch.Draw2DTiled(_bgGump, new RectInt(position.x, position.y, Width, Height), Vector3.zero);
     base.Draw(spriteBatch, position, frameMS);
 }
Exemplo n.º 11
0
        public override bool Draw(SpriteBatchUI spriteBatch, Point position, Vector3?hue = null)
        {
            spriteBatch.Draw2DTiled(Texture, new Rectangle(position.X, position.Y, Width, Height), ShaderHuesTraslator.GetHueVector(0, false, IsTransparent ? 0.5f : 0, false));

            return(base.Draw(spriteBatch, position, hue));
        }
Exemplo n.º 12
0
 public override void Draw(SpriteBatchUI spriteBatch, Point position, double frameMS)
 {
     spriteBatch.Draw2DTiled(m_bgGump, new Rectangle(position.X, position.Y, Width, Height), Vector3.Zero);
     base.Draw(spriteBatch, position, frameMS);
 }
Exemplo n.º 13
0
 public override void Draw(SpriteBatchUI spriteBatch)
 {
     spriteBatch.Draw2DTiled(m_bgGump, new Rectangle(X, Y, Area.Width, Area.Height), 0, false, false);
     base.Draw(spriteBatch);
 }
Exemplo n.º 14
0
        public override bool Draw(SpriteBatchUI spriteBatch, Point position, Vector3?hue = null)
        {
            //int offsetTop = Math.Max(_gumpTexture[0].Height, _gumpTexture[2].Height) - _gumpTexture[1].Height;
            //int offsetBottom = Math.Max(_gumpTexture[5].Height, _gumpTexture[7].Height) - _gumpTexture[6].Height;
            //int offsetLeft = Math.Max(_gumpTexture[0].Width, _gumpTexture[5].Width) - _gumpTexture[3].Width;
            //int offsetRight = Math.Max(_gumpTexture[2].Width, _gumpTexture[7].Width) - _gumpTexture[4].Width;
            Vector3 color = IsTransparent ? ShaderHuesTraslator.GetHueVector(0, false, Alpha, true) : Vector3.Zero;

            for (int i = 0; i < 9; i++)
            {
                SpriteTexture t          = _gumpTexture[i];
                int           drawWidth  = t.Width;
                int           drawHeight = t.Height;
                int           drawX      = position.X;
                int           drawY      = position.Y;

                switch (i)
                {
                case 0:
                    spriteBatch.Draw2D(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;

                case 1:
                    drawX    += _gumpTexture[0].Width;
                    drawWidth = Width - _gumpTexture[0].Width - _gumpTexture[2].Width;
                    spriteBatch.Draw2DTiled(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;

                case 2:
                    drawX += Width - drawWidth;
                    spriteBatch.Draw2D(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;

                case 3:
                    drawY     += _gumpTexture[0].Height;
                    drawHeight = Height - _gumpTexture[0].Height - _gumpTexture[5].Height;
                    spriteBatch.Draw2DTiled(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;

                case 4:
                    drawX     += Width - drawWidth /*- offsetRight*/;
                    drawY     += _gumpTexture[2].Height;
                    drawHeight = Height - _gumpTexture[2].Height - _gumpTexture[7].Height;
                    spriteBatch.Draw2DTiled(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;

                case 5:
                    drawY += Height - drawHeight;
                    spriteBatch.Draw2D(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;

                case 6:
                    drawX    += _gumpTexture[5].Width;
                    drawY    += Height - drawHeight /*- offsetBottom*/;
                    drawWidth = Width - _gumpTexture[5].Width - _gumpTexture[7].Width;
                    spriteBatch.Draw2DTiled(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;

                case 7:
                    drawX += Width - drawWidth;
                    drawY += Height - drawHeight;
                    spriteBatch.Draw2D(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;

                case 8:
                    drawX     += _gumpTexture[0].Width;
                    drawY     += _gumpTexture[0].Height;
                    drawWidth  = Width - _gumpTexture[0].Width - _gumpTexture[2].Width;
                    drawHeight = Height - _gumpTexture[2].Height - _gumpTexture[7].Height;
                    spriteBatch.Draw2DTiled(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;
                }
            }

            //int centerWidth = Width - _gumpTexture[0].Width - _gumpTexture[2].Width;
            //int centerHeight = Height - _gumpTexture[0].Height - _gumpTexture[6].Height;
            //int line2Y = position.Y + _gumpTexture[0].Height;
            //int line3Y = position.Y + Height - _gumpTexture[6].Height;
            //Vector3 color = IsTransparent ? ShaderHuesTraslator.GetHueVector(0, false, Alpha, true) : Vector3.Zero;

            //// top row
            //spriteBatch.Draw2D(_gumpTexture[0], position, color);
            //spriteBatch.Draw2DTiled(_gumpTexture[1], new Rectangle(position.X + _gumpTexture[0].Width, position.Y, centerWidth, _gumpTexture[0].Height), color);
            //spriteBatch.Draw2D(_gumpTexture[2], new Point(position.X + Width - _gumpTexture[2].Width, position.Y), color);

            //// middle
            //spriteBatch.Draw2DTiled(_gumpTexture[3], new Rectangle(position.X, line2Y, _gumpTexture[3].Width, centerHeight), color);
            //spriteBatch.Draw2DTiled(_gumpTexture[4], new Rectangle(position.X + _gumpTexture[3].Width, line2Y, centerWidth, centerHeight), color);
            //spriteBatch.Draw2DTiled(_gumpTexture[5], new Rectangle(position.X + Width - _gumpTexture[5].Width, line2Y, _gumpTexture[5].Width, centerHeight), color);

            //// bottom
            //spriteBatch.Draw2D(_gumpTexture[6], new Point(position.X, line3Y), color);
            //spriteBatch.Draw2DTiled(_gumpTexture[7], new Rectangle(position.X + _gumpTexture[6].Width, line3Y, centerWidth, _gumpTexture[6].Height), color);
            //spriteBatch.Draw2D(_gumpTexture[8], new Point(position.X + Width - _gumpTexture[8].Width, line3Y), color);

            return(base.Draw(spriteBatch, position, hue));
        }
Exemplo n.º 15
0
 public override void Draw(SpriteBatchUI spriteBatch, Point position)
 {
     spriteBatch.Draw2DTiled(CheckeredTransTexture, new Rectangle(position.X, position.Y, Width, Height), Vector3.Zero);
     base.Draw(spriteBatch, position);
 }
Exemplo n.º 16
0
        public override bool Draw(SpriteBatchUI spriteBatch, Vector3 position, Vector3?hue = null)
        {
            spriteBatch.Draw2DTiled(Texture, new Rectangle((int)position.X, (int)position.Y, Width, Height), RenderExtentions.GetHueVector(0, false, IsTransparent ? 0.5f : 0, false));

            return(base.Draw(spriteBatch, position, hue));
        }