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


C# Graphics.SpriteBatchUI類代碼示例

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


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

示例1: Draw

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

示例2: Draw

        public override void Draw(SpriteBatchUI spriteBatch, Point position)
        {
            bool isMouseOver = (m_BG[0].IsMouseOver || m_BG[1].IsMouseOver || m_BG[2].IsMouseOver);
            if (m_IsMouseDown)
            {
                m_BG[0].IsVisible = false;
                m_BG[1].IsVisible = false;
                m_BG[2].IsVisible = true;

            }
            else if (isMouseOver)
            {
                m_BG[0].IsVisible = false;
                m_BG[1].IsVisible = true;
                m_BG[2].IsVisible = false;
            }
            else
            {
                m_BG[0].IsVisible = true;
                m_BG[1].IsVisible = false;
                m_BG[2].IsVisible = false;
            }

            if (m_IsMouseDown)
                m_Caption.Position = new Point(m_Caption.Position.X, m_Caption.Position.Y + 1);

            base.Draw(spriteBatch, position);

            if (m_IsMouseDown)
                m_Caption.Position = new Point(m_Caption.Position.X, m_Caption.Position.Y - 1);
        }
開發者ID:InjectionDev,項目名稱:UltimaXNA,代碼行數:31,代碼來源:UseSkillButtonGump.cs

示例3: Draw

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

示例4: 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

示例5: Draw

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

示例6: Draw

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

示例7: Draw

 public override void Draw(SpriteBatchUI spriteBatch, Point position, double frameMS)
 {
     base.Draw(spriteBatch, position, frameMS);
     if (Caption != string.Empty) {
         int yoffset = IsMouseDownOnThis ? 2 : 1;
         m_Caption.Draw(spriteBatch, new Point(
             position.X + (Width - m_Caption.Width) / 2,
             position.Y + yoffset + (Height - m_Caption.Height) / 2));
     }
 }
開發者ID:jorsi,項目名稱:UltimaXNA,代碼行數:10,代碼來源:ButtonResizable.cs

示例8: Draw

 public override void Draw(SpriteBatchUI spriteBatch, Point position)
 {
     int y = m_TextEntry.Y + position.Y - 6;
     for (int i = m_TextEntries.Count - 1; i >= 0; i--)
     {
         y -= m_TextEntries[i].TextHeight;
         m_TextEntries[i].Draw(spriteBatch, new Point(position.X + 2, y));
     }
     base.Draw(spriteBatch, position);
 }
開發者ID:InjectionDev,項目名稱:UltimaXNA,代碼行數:10,代碼來源:ChatControl.cs

示例9: Draw

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

示例10: Initialize

        public void Initialize()
        {
            m_SpriteBatch = Service.Get<SpriteBatchUI>();
            Texture = new Texture2D(m_SpriteBatch.GraphicsDevice, (int)Stride, (int)Stride);

            m_TextureData = new uint[Stride * Stride];
            m_BlockColors = new uint[TilesPerBlock];
            m_BlockCache = new MiniMapChunk[BlockCacheWidth * BlockCacheHeight];
            m_MustRedrawEntireTexture = true;

            m_QueuedToDrawBlocks = new List<uint>();
        }
開發者ID:jorsi,項目名稱:UltimaXNA,代碼行數:12,代碼來源:MiniMapTexture.cs

示例11: 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

示例12: Draw

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

示例13: BeforeDraw

        protected virtual void BeforeDraw(SpriteBatchUI spritebatch, Point position)
        {
            // Over the interface or not in world. Display a default cursor.
            int artworkIndex = 8305;

            if (WorldModel.IsInWorld && WorldModel.Entities.GetPlayerEntity().Flags.IsWarMode)
            {
                // if in warmode, show the red-hued cursor.
                artworkIndex -= 23;
            }

            CursorSpriteArtIndex = artworkIndex;
            CursorOffset = new Point(-1, 1);
        }
開發者ID:msx752,項目名稱:UltimaXNA,代碼行數:14,代碼來源:UltimaCursor.cs

示例14: Draw

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

示例15: Draw

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


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