當前位置: 首頁>>代碼示例>>C#>>正文


C# SpriteBatchUI.Draw2DTiled方法代碼示例

本文整理匯總了C#中UltimaXNA.Core.Graphics.SpriteBatchUI.Draw2DTiled方法的典型用法代碼示例。如果您正苦於以下問題:C# SpriteBatchUI.Draw2DTiled方法的具體用法?C# SpriteBatchUI.Draw2DTiled怎麽用?C# SpriteBatchUI.Draw2DTiled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UltimaXNA.Core.Graphics.SpriteBatchUI的用法示例。


在下文中一共展示了SpriteBatchUI.Draw2DTiled方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Draw

        public void Draw(SpriteBatchUI spriteBatch, int x, int y)
        {
            // determine if properties need to be updated.
            if (m_Entity != null && m_PropertyListHash != m_Entity.PropertyList.Hash)
            {
                m_PropertyListHash = m_Entity.PropertyList.Hash;
                Caption = m_Entity.PropertyList.Properties;
            }

            // update text if necessary.
            if (m_RenderedText == null)
            {
                m_RenderedText = new RenderedText("<center>" + Caption, 300, true);
            }
            else if (m_RenderedText.Text != "<center>" + Caption)
            {
                m_RenderedText = null;
                m_RenderedText = new RenderedText("<center>" + Caption, 300, true);
            }

            // draw checkered trans underneath.
            spriteBatch.Draw2DTiled(CheckerTrans.CheckeredTransTexture, new Rectangle(x - 4, y - 4, m_RenderedText.Width + 8, m_RenderedText.Height + 8), Vector3.Zero);
            // draw tooltip contents
            m_RenderedText.Draw(spriteBatch, new Point(x, y));
        }
開發者ID:msx752,項目名稱:UltimaXNA,代碼行數:25,代碼來源:Tooltip.cs

示例2: Draw

        public void Draw(SpriteBatchUI spriteBatch, int x, int y)
        {
            // draw checkered trans underneath.

            if (m_RenderedText == null)
            {
                m_RenderedText = new RenderedText(Caption, 200);
            }

            spriteBatch.Draw2DTiled(Controls.CheckerTrans.CheckeredTransTexture, new Rectangle(x - 4, y - 4, m_RenderedText.Width + 8, m_RenderedText.Height + 8), Vector3.Zero);

            m_RenderedText.Draw(spriteBatch, new Point(x, y));
        }
開發者ID:gautamabudha,項目名稱:UltimaXNA,代碼行數:13,代碼來源:Tooltip.cs

示例3: Draw

        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);
        }
開發者ID:gautamabudha,項目名稱:UltimaXNA,代碼行數:21,代碼來源:ResizePic.cs

示例4: Draw

        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);
        }
開發者ID:jorsi,項目名稱:UltimaXNA,代碼行數:21,代碼來源:ResizePic.cs

示例5: Draw

        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);
        }
開發者ID:gautamabudha,項目名稱:UltimaXNA,代碼行數:31,代碼來源:ScrollBar.cs

示例6: Draw

 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);
 }
開發者ID:InjectionDev,項目名稱:UltimaXNA,代碼行數:11,代碼來源:HSliderBar.cs

示例7: Draw

 public override void Draw(SpriteBatchUI spriteBatch, Point position)
 {
     spriteBatch.Draw2DTiled(m_bgGump, new Rectangle(position.X, position.Y, Width, Height), Vector3.Zero);
     base.Draw(spriteBatch, position);
 }
開發者ID:gautamabudha,項目名稱:UltimaXNA,代碼行數:5,代碼來源:GumpPicTiled.cs

示例8: Draw

 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);
 }
開發者ID:gautamabudha,項目名稱:UltimaXNA,代碼行數:5,代碼來源:CheckerTrans.cs


注:本文中的UltimaXNA.Core.Graphics.SpriteBatchUI.Draw2DTiled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。