Example #1
1
 public override void Draw(SpriteBatchUI spriteBatch, Point position)
 {
     Vector3 hueVector = Utility.GetHueVector(Hue);
     int width = (int)(m_PercentWidthDrawn * Width);
     spriteBatch.Draw2D(m_Texture, new Rectangle(position.X, position.Y, width, Height), new Rectangle(0, 0, width, Height), hueVector);
     base.Draw(spriteBatch, position);
 }
Example #2
0
 public override void Draw(SpriteBatchUI spriteBatch, Point position)
 {
     base.Draw(spriteBatch, position);
     if (IsChecked && m_Active != null)
     {
         spriteBatch.Draw2D(m_Active, new Vector3(position.X, position.Y, 0), Vector3.Zero);
     }
     else if (!IsChecked && m_Inactive != null)
     {
         spriteBatch.Draw2D(m_Inactive, new Vector3(position.X, position.Y, 0), Vector3.Zero);
     }
 }
        public override void Draw(SpriteBatchUI spriteBatch, Point position)
        {
            if (m_Texture == null)
            {
                IResourceProvider provider = ServiceRegistry.GetService<IResourceProvider>();
                if (IsFemale)
                {
                    int index = Item.ItemData.AnimID + 60000;
                    int indexTranslated, hueTranslated;
                    if (GumpDefTranslator.ItemHasGumpTranslation(index, out indexTranslated, out hueTranslated))
                    {
                        index = indexTranslated;
                        m_HueOverride = hueTranslated;
                        m_Texture = provider.GetUITexture(index);
                    }
                }
                if (m_Texture == null)
                {
                    int index = Item.ItemData.AnimID + 50000;
                    int indexTranslated, hueTranslated;
                    if (GumpDefTranslator.ItemHasGumpTranslation(index, out indexTranslated, out hueTranslated))
                    {
                        index = indexTranslated;
                        m_HueOverride = hueTranslated;
                        m_Texture = provider.GetUITexture(index);
                    }
                    m_Texture = provider.GetUITexture(index);
                }
                Size = new Point(m_Texture.Width, m_Texture.Height);
            }

            int hue = (Item.Hue == 0 & m_HueOverride != 0) ? m_HueOverride : Item.Hue;
            spriteBatch.Draw2D(m_Texture, new Vector3(position.X, position.Y, 0), Utility.GetHueVector(hue));
            base.Draw(spriteBatch, position);
        }
Example #4
0
        public override void Draw(SpriteBatchUI spriteBatch, Point position)
        {
            Texture2D worldTexture = (m_Model.GetView() as WorldView).Isometric.Texture;
            m_InputMultiplier = new Vector2((float)worldTexture.Width / Width, (float)worldTexture.Height / Height);

            spriteBatch.Draw2D(worldTexture, new Rectangle(position.X, position.Y, Width, Height), Vector3.Zero);
            base.Draw(spriteBatch, position);
        }
Example #5
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[0].Width, centerHeight), Vector3.Zero);
            spriteBatch.Draw2DTiled(m_bgGumps[4], new Rectangle(position.X + m_bgGumps[0].Width, line2Y, centerWidth, centerHeight), Vector3.Zero);
            spriteBatch.Draw2DTiled(m_bgGumps[5], new Rectangle(position.X + Width - m_bgGumps[2].Width, line2Y, m_bgGumps[2].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[0].Width, line3Y, centerWidth, m_bgGumps[6].Height), Vector3.Zero);
            spriteBatch.Draw2D(m_bgGumps[8], new Vector3(position.X + Width - m_bgGumps[2].Width, line3Y, 0), Vector3.Zero);

            base.Draw(spriteBatch, position);
        }
 public override void Draw(SpriteBatchUI spriteBatch, Point position)
 {
     if (m_texture == null)
     {
         if (IsFemale)
             m_texture = IO.GumpData.GetGumpXNA(Item.ItemData.AnimID + 60000);
         if (m_texture == null)
             m_texture = IO.GumpData.GetGumpXNA(Item.ItemData.AnimID + 50000);
         Size = new Point(m_texture.Width, m_texture.Height);
     }
     spriteBatch.Draw2D(m_texture, new Vector3(position.X, position.Y, 0), Utility.GetHueVector(Item.Hue));
     base.Draw(spriteBatch, position);
 }
Example #7
0
 public override void Draw(SpriteBatchUI spriteBatch, Point position)
 {
     if (m_texture == null)
     {
         m_texture = IO.ArtData.GetStaticTexture(Item.DisplayItemID);
         Size = new Point(m_texture.Width, m_texture.Height);
     }
     Vector3 hue = Utility.GetHueVector(IsMouseOver && HighlightOnMouseOver ? WorldView.MouseOverHue : Item.Hue);
     if (Item.Amount > 1 && Item.ItemData.IsGeneric)
     {
         int offset = Item.ItemData.Unknown4;
         spriteBatch.Draw2D(m_texture, new Vector3(position.X - offset, position.Y - offset, 0), hue);
     }
     spriteBatch.Draw2D(m_texture, new Vector3(position.X, position.Y, 0), hue);
     base.Draw(spriteBatch, position);
 }
Example #8
0
 public override void Draw(SpriteBatchUI spriteBatch, Point position)
 {
     if (m_Texture == null)
     {
         IResourceProvider provider = ServiceRegistry.GetService<IResourceProvider>();
         m_Texture = provider.GetItemTexture(Item.DisplayItemID);
         Size = new Point(m_Texture.Width, m_Texture.Height);
     }
     Vector3 hue = Utility.GetHueVector(IsMouseOver && HighlightOnMouseOver ? WorldView.MouseOverHue : Item.Hue);
     if (Item.Amount > 1 && Item.ItemData.IsGeneric && Item.DisplayItemID == Item.ItemID)
     {
         int offset = Item.ItemData.Unknown4;
         spriteBatch.Draw2D(m_Texture, new Vector3(position.X - 5, position.Y - 5, 0), hue);
     }
     spriteBatch.Draw2D(m_Texture, new Vector3(position.X, position.Y, 0), hue);
     base.Draw(spriteBatch, position);
 }
Example #9
0
        public override void Draw(SpriteBatchUI spriteBatch, Point position, double frameMS)
        {
            int centerWidth = Width - m_Gumps[0].Width - m_Gumps[2].Width;
            int centerHeight = Height - m_Gumps[0].Height - m_Gumps[6].Height;
            int line2Y = position.Y + m_Gumps[0].Height;
            int line3Y = position.Y + Height - m_Gumps[6].Height;
            // top row
            spriteBatch.Draw2D(m_Gumps[0], new Vector3(position.X, position.Y, 0), Vector3.Zero);
            spriteBatch.Draw2DTiled(m_Gumps[1], new Rectangle(position.X + m_Gumps[0].Width, position.Y, centerWidth, m_Gumps[0].Height), Vector3.Zero);
            spriteBatch.Draw2D(m_Gumps[2], new Vector3(position.X + Width - m_Gumps[2].Width, position.Y, 0), Vector3.Zero);
            // middle
            spriteBatch.Draw2DTiled(m_Gumps[3], new Rectangle(position.X, line2Y, m_Gumps[3].Width, centerHeight), Vector3.Zero);
            spriteBatch.Draw2DTiled(m_Gumps[4], new Rectangle(position.X + m_Gumps[3].Width, line2Y, centerWidth, centerHeight), Vector3.Zero);
            spriteBatch.Draw2DTiled(m_Gumps[5], new Rectangle(position.X + Width - m_Gumps[5].Width, line2Y, m_Gumps[5].Width, centerHeight), Vector3.Zero);
            // bottom
            spriteBatch.Draw2D(m_Gumps[6], new Vector3(position.X, line3Y, 0), Vector3.Zero);
            spriteBatch.Draw2DTiled(m_Gumps[7], new Rectangle(position.X + m_Gumps[6].Width, line3Y, centerWidth, m_Gumps[6].Height), Vector3.Zero);
            spriteBatch.Draw2D(m_Gumps[8], new Vector3(position.X + Width - m_Gumps[8].Width, line3Y, 0), Vector3.Zero);

            base.Draw(spriteBatch, position, frameMS);
        }
Example #10
0
 public override void Draw(SpriteBatchUI spriteBatch, Point position, double frameMS)
 {
     Vector3 hueVector = Utility.GetHueVector(Hue);
     spriteBatch.Draw2D(m_Texture, new Vector3(position.X, position.Y, 0), hueVector);
     base.Draw(spriteBatch, position, frameMS);
 }
Example #11
0
        public void Draw(SpriteBatchUI sb, Rectangle destRectangle, int xScroll, int yScroll, Vector3? hueVector = null)
        {
            if (Text == null)
                return;

            Rectangle sourceRectangle;

            if (xScroll > Width)
                return;
            else if (xScroll < -MaxWidth)
                return;
            else
                sourceRectangle.X = xScroll;

            if (yScroll > Height)
                return;
            else if (yScroll < -Height)
                return;
            else
                sourceRectangle.Y = yScroll;

            int maxX = sourceRectangle.X + destRectangle.Width;
            if (maxX <= Width)
                sourceRectangle.Width = destRectangle.Width;
            else
            {
                sourceRectangle.Width = Width - sourceRectangle.X;
                destRectangle.Width = sourceRectangle.Width;
            }

            int maxY = sourceRectangle.Y + destRectangle.Height;
            if (maxY <= Height)
            {
                sourceRectangle.Height = destRectangle.Height;
            }
            else
            {
                sourceRectangle.Height = Height - sourceRectangle.Y;
                destRectangle.Height = sourceRectangle.Height;
            }

            sb.Draw2D(m_Document.Texture, destRectangle, sourceRectangle, hueVector.HasValue ? hueVector.Value : Vector3.Zero);

            for (int i = 0; i < m_Document.Links.Count; i++)
            {
                HtmlLink link = m_Document.Links[i];
                Point position;
                Rectangle sourceRect;
                if (ClipRectangle(new Point(xScroll, yScroll), link.Area, destRectangle, out position, out sourceRect))
                {
                    // only draw the font in a different color if this is a HREF region.
                    // otherwise it is a dummy region used to notify images that they are
                    // being mouse overed.
                    if (link.HREF != null)
                    {
                        int linkHue = 0;
                        if (link.Index == MouseOverRegionID)
                            if (IsMouseDown)
                                linkHue = link.Style.ActiveColorHue;
                            else
                                linkHue = link.Style.HoverColorHue;
                        else
                            linkHue = link.Style.ColorHue;

                        sb.Draw2D(m_Document.Texture, new Vector3(position.X, position.Y, 0),
                            sourceRect, Utility.GetHueVector(linkHue));
                    }
                }
            }

            for (int i = 0; i < m_Document.Images.Count; i++)
            {
                HtmlImage image = m_Document.Images[i];
                Point position;
                Rectangle sourceRect;
                if (ClipRectangle(new Point(xScroll, yScroll), image.Area, destRectangle, out position, out sourceRect))
                {
                    Rectangle srcImage = new Rectangle(
                        sourceRect.X - image.Area.X, sourceRect.Y - image.Area.Y,
                        sourceRect.Width, sourceRect.Height);
                    Texture2D texture = null;

                    // is the mouse over this image?
                    if (image.RegionIndex == MouseOverRegionID)
                    {
                        if (IsMouseDown)
                            texture = image.TextureDown;
                        if (texture == null)
                            texture = image.TextureOver;
                        if (texture == null)
                            texture = image.Texture;
                    }

                    if (texture == null)
                        texture = image.Texture;

                    if (srcImage.Width > texture.Width)
                        srcImage.Width = texture.Width;
                    if (srcImage.Height > texture.Height)
                        srcImage.Height = texture.Height;

                    sb.Draw2D(texture, new Vector3(position.X, position.Y, 0),
                        srcImage, Utility.GetHueVector(0, false, false));
                }
            }
        }
Example #12
0
        public override void Draw(SpriteBatchUI spriteBatch, Point position)
        {
            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);
        }
Example #13
0
        public override void Draw(SpriteBatchUI spriteBatch, Point position)
        {
            Texture2D texture = getTextureFromMouseState();

            if (Caption != string.Empty)
                m_Texture.Text = Caption;

            spriteBatch.Draw2D(texture, new Rectangle(position.X, position.Y, Width, Height), Vector3.Zero);

            if (Caption != string.Empty)
            {
                int yoffset = MouseDownOnThis ? 1 : 0;
                m_Texture.Draw(spriteBatch,
                    new Point(position.X + (Width - m_Texture.Width) / 2,
                        position.Y + yoffset + (Height - m_Texture.Height) / 2));
            }
            base.Draw(spriteBatch, position);
        }
Example #14
0
 public override void Draw(SpriteBatchUI spriteBatch, Point position)
 {
     if (m_texture == null)
     {
         IResourceProvider provider = ServiceRegistry.GetService<IResourceProvider>();
         m_texture = provider.GetItemTexture(m_StaticTextureID);
         Size = new Point(m_texture.Width, m_texture.Height);
     }
     spriteBatch.Draw2D(m_texture, new Vector3(position.X, position.Y, 0), Utility.GetHueVector(Hue));
     base.Draw(spriteBatch, position);
 }
Example #15
0
 public override void Draw(SpriteBatchUI spriteBatch, Point position)
 {
     spriteBatch.Draw2D(m_huesTexture, new Rectangle(position.X, position.Y, Width, Height), Vector3.Zero);
     if (IsChild && IsMouseOver)
     {
         spriteBatch.Draw2D(m_selectedIndicator, new Vector3(
             (int)(position.X + (float)(Width / m_hueWidth) * ((Index % m_hueWidth) + 0.5f) - m_selectedIndicator.Width / 2),
             (int)(position.Y + (float)(Height / m_hueHeight) * ((Index / m_hueWidth) + 0.5f) - m_selectedIndicator.Height / 2),
             0), Vector3.Zero);
     }
     base.Draw(spriteBatch, position);
 }
Example #16
0
        public override void Draw(SpriteBatchUI spriteBatch, Point position)
        {
            base.Draw(spriteBatch, position);

            spriteBatch.Draw2D(((WorldView)m_World.GetView()).MiniMap.Texture, new Vector3(position.X + 8, position.Y + 8, 0), Vector3.Zero);
        }
        public override void Draw(SpriteBatchUI spriteBatch, Point position)
        {
            EquipSlots[] slotsToDraw = new EquipSlots[6] { EquipSlots.Body, EquipSlots.Footwear, EquipSlots.Legging, EquipSlots.Shirt, EquipSlots.Hair, EquipSlots.FacialHair };
            for (int i = 0; i < slotsToDraw.Length; i++)
            {
                int bodyID = 0;
                int hue = hueSlot(slotsToDraw[i]);
                bool hueGreyPixelsOnly = true;

                switch (slotsToDraw[i])
                {
                    case EquipSlots.Body:
                        if (m_isElf)
                            bodyID = (m_isFemale ? 1893 : 1894);
                        else
                            bodyID = (m_isFemale ? 1888 : 1889);
                        break;
                    case EquipSlots.Footwear:
                        bodyID = (m_isFemale ? 1891 : 1890);
                        hue = 900;
                        break;
                    case EquipSlots.Legging:
                        bodyID = (m_isFemale ? 1892 : 1848);
                        hue = 348;
                        break;
                    case EquipSlots.Shirt:
                        bodyID = (m_isFemale ? 1812 : 1849);
                        hue = 792;
                        break;
                    case EquipSlots.Hair:
                        if (equipmentSlot(EquipSlots.Hair) != 0)
                        {
                            bodyID = m_isFemale ?
                                IO.HairStyles.FemaleGumpIDForCharacterCreationFromItemID(equipmentSlot(EquipSlots.Hair)) :
                                IO.HairStyles.MaleGumpIDForCharacterCreationFromItemID(equipmentSlot(EquipSlots.Hair));
                            hueGreyPixelsOnly = false;
                        }
                        break;
                    case EquipSlots.FacialHair:
                        if (equipmentSlot(EquipSlots.FacialHair) != 0)
                        {
                            bodyID = m_isFemale ?
                                0 : IO.HairStyles.FacialHairGumpIDForCharacterCreationFromItemID(equipmentSlot(EquipSlots.FacialHair));
                            hueGreyPixelsOnly = false;
                        }
                        break;
                }

                if (bodyID != 0)
                    spriteBatch.Draw2D(IO.GumpData.GetGumpXNA(bodyID), new Vector3(position.X, position.Y, 0), Utility.GetHueVector(hue, hueGreyPixelsOnly, false));
            }
        }
Example #18
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);
 }
        public override void Draw(SpriteBatchUI spriteBatch, Point position)
        {
            EquipSlots[] slotsToDraw = new EquipSlots[6] { EquipSlots.Body, EquipSlots.Footwear, EquipSlots.Legging, EquipSlots.Shirt, EquipSlots.Hair, EquipSlots.FacialHair };
            for (int i = 0; i < slotsToDraw.Length; i++)
            {
                int bodyID = 0;
                int hue = hueSlot(slotsToDraw[i]);
                bool hueGreyPixelsOnly = true;

                switch (slotsToDraw[i])
                {
                    case EquipSlots.Body:
                        if (m_isElf)
                            bodyID = (m_isFemale ? 1893 : 1894);
                        else
                            bodyID = (m_isFemale ? 1888 : 1889);
                        break;
                    case EquipSlots.Footwear:
                        bodyID = (m_isFemale ? 1891 : 1890);
                        hue = 900;
                        break;
                    case EquipSlots.Legging:
                        bodyID = (m_isFemale ? 1892 : 1848);
                        hue = 348;
                        break;
                    case EquipSlots.Shirt:
                        bodyID = (m_isFemale ? 1812 : 1849);
                        hue = 792;
                        break;
                    case EquipSlots.Hair:
                        if (equipmentSlot(EquipSlots.Hair) != 0)
                        {
                            bodyID = m_isFemale ?
                                HairStyles.FemaleGumpIDForCharacterCreationFromItemID(equipmentSlot(EquipSlots.Hair)) :
                                HairStyles.MaleGumpIDForCharacterCreationFromItemID(equipmentSlot(EquipSlots.Hair));
                            hueGreyPixelsOnly = false;
                        }
                        break;
                    case EquipSlots.FacialHair:
                        if (equipmentSlot(EquipSlots.FacialHair) != 0)
                        {
                            bodyID = m_isFemale ?
                                0 : HairStyles.FacialHairGumpIDForCharacterCreationFromItemID(equipmentSlot(EquipSlots.FacialHair));
                            hueGreyPixelsOnly = false;
                        }
                        break;
                }

                if (bodyID != 0)
                {
                    // this is silly, we should be keeping a local copy of the body texture.
                    IResourceProvider provider = ServiceRegistry.GetService<IResourceProvider>();
                    spriteBatch.Draw2D(provider.GetUITexture(bodyID), new Vector3(position.X, position.Y, 0), Utility.GetHueVector(hue, hueGreyPixelsOnly, false));
                }
            }
        }
Example #20
0
        public override void Draw(SpriteBatchUI spriteBatch, Point position, double frameMS)
        {
            // draw slider
            if (MaxValue == MinValue)
            {
                // do nothing.
            }
            else
            {
                spriteBatch.Draw2D(m_GumpSlider, new Vector3(position.X - 5, position.Y + m_SliderPosition, 0), Vector3.Zero);
            }

            base.Draw(spriteBatch, position, frameMS);
        }
Example #21
0
 public override void Draw(SpriteBatchUI spriteBatch, Point position)
 {
     if (m_texture == null)
     {
         m_texture = IO.ArtData.GetStaticTexture(m_StaticTextureID);
         Size = new Point(m_texture.Width, m_texture.Height);
     }
     spriteBatch.Draw2D(m_texture, new Vector3(position.X, position.Y, 0), Utility.GetHueVector(Hue));
     base.Draw(spriteBatch, position);
 }
Example #22
0
 public override void Draw(SpriteBatchUI spriteBatch, Point position)
 {
     spriteBatch.Draw2D(m_texture, new Vector3(position.X, position.Y, 0), Utility.GetHueVector(0, false, false, true));
     base.Draw(spriteBatch, position);
 }
Example #23
0
        public override void Draw(SpriteBatchUI spriteBatch, Point position)
        {
            AEntity player = WorldModel.Entities.GetPlayerEntity();
            float x = (float)Math.Round((player.Position.X % 256) + player.Position.X_offset) / 256f;
            float y = (float)Math.Round((player.Position.Y % 256) + player.Position.Y_offset) / 256f;
            Vector3 playerPosition = new Vector3(x - y, x + y, 0f);
            float minimapU = (m_GumpTexture.Width / 256f) / 2f;
            float minimapV = (m_GumpTexture.Height / 256f) / 2f;

            VertexPositionNormalTextureHue[] v = new VertexPositionNormalTextureHue[4]
            {
                new VertexPositionNormalTextureHue(new Vector3(position.X, position.Y, 0), playerPosition + new Vector3(-minimapU, -minimapV, 0), new Vector3(0, 0, 0)),
                new VertexPositionNormalTextureHue(new Vector3(position.X + Width, position.Y, 0), playerPosition + new Vector3(minimapU, -minimapV, 0), new Vector3(1, 0, 0)),
                new VertexPositionNormalTextureHue(new Vector3(position.X, position.Y + Height, 0), playerPosition + new Vector3(-minimapU, minimapV, 0), new Vector3(0, 1, 0)),
                new VertexPositionNormalTextureHue(new Vector3(position.X + Width, position.Y + Height, 0), playerPosition + new Vector3(minimapU, minimapV, 0), new Vector3(1, 1, 0))
            };

            spriteBatch.Draw(m_GumpTexture, v, Techniques.MiniMap);

            if (UltimaGame.TotalMS % 500f < 250f)
            {
                if (m_PlayerIndicator == null)
                {
                    m_PlayerIndicator = new Texture2D(spriteBatch.GraphicsDevice, 1, 1);
                    m_PlayerIndicator.SetData<uint>(new uint[1] { 0xFFFFFFFF });
                }
                spriteBatch.Draw2D(m_PlayerIndicator, new Vector3(position.X + Width / 2, position.Y + Height / 2 - 8, 0), Vector3.Zero);
            }
        }
Example #24
0
        protected void DebugDrawBounds(SpriteBatchUI spriteBatch, Point position, Color color)
        {
            if (m_BoundsTexture == null)
            {
                m_BoundsTexture = new Texture2D(spriteBatch.GraphicsDevice, 1, 1);
                m_BoundsTexture.SetData<Color>(new Color[] { Color.White });
            }

            Rectangle drawArea = new Rectangle(ScreenX, ScreenY, Width, Height);
            spriteBatch.Draw2D(m_BoundsTexture, new Rectangle(position.X, position.Y, Width, 1), Vector3.Zero);
            spriteBatch.Draw2D(m_BoundsTexture, new Rectangle(position.X, position.Y + Height - 1, Width, 1), Vector3.Zero);
            spriteBatch.Draw2D(m_BoundsTexture, new Rectangle(position.X, position.Y, 1, Height), Vector3.Zero);
            spriteBatch.Draw2D(m_BoundsTexture, new Rectangle(position.X + Width - 1, position.Y, 1, Height), Vector3.Zero);
        #endregion
        }
Example #25
0
        public override void Draw(SpriteBatchUI spriteBatch, Point position)
        {
            // draw slider
            spriteBatch.Draw2D(m_GumpSlider, new Vector3(position.X, position.Y + m_SliderPosition, 0), Vector3.Zero);

            base.Draw(spriteBatch, position);
        }
Example #26
0
        public override void Draw(SpriteBatchUI spriteBatch, Point position)
        {
            IResourceProvider provider = ServiceRegistry.GetService<IResourceProvider>();
            m_Inactive = provider.GetUITexture(210);

            spriteBatch.Draw2D(m_Inactive, new Vector3(position.X, position.Y, 0), Vector3.Zero);
            spriteBatch.Draw2D(m_huesTexture, new Rectangle(position.X+3, position.Y+3, Width-2, Height-1), Vector3.Zero);

            if (IsChild && IsMouseOver)
            {
                spriteBatch.Draw2D(m_selectedIndicator, new Vector3(
                    (int)(position.X + (float)(Width / m_hueWidth) * ((Index % m_hueWidth) + 0.5f) - m_selectedIndicator.Width / 2),
                    (int)(position.Y + (float)(Height / m_hueHeight) * ((Index / m_hueWidth) + 0.5f) - m_selectedIndicator.Height / 2),
                    0), Vector3.Zero);
            }
            base.Draw(spriteBatch, position);
        }
Example #27
0
 public void Draw(SpriteBatchUI sb, Point position)
 {
     Vector3 v = new Vector3(position.X - m_Offset.X, position.Y - m_Offset.Y, 0);
     sb.Draw2D(m_Texture, v, m_SourceRect, Utility.GetHueVector(m_Hue));
 }