Exemplo n.º 1
0
 public override void Draw(SpriteBatch spriteBatch)
 {
     base.Draw(spriteBatch);
     spriteBatch.Draw(GraphicAssets.itemsTileset,
                      MathUtil.GetDrawRectangle(position, size, parentPosition),
                      TilesetManager.GetSourceRectangle(TilesetManager.TileSetType.ITEMS,
                                                        (int)TilesetManager.ItemTileSet.WOOD_SWORD),
                      Color.White);
 }
        public void DrawFrame(SpriteBatch p_spriteBatch, Rectangle p_pos)
        {
            if (Animation?.Frame == null)
            {
                return;
            }

            p_spriteBatch.Draw(TilesetManager.GetTileSet(Animation.Frame.frameType), p_pos,
                               TilesetManager.GetSourceRectangle(Animation.Frame.frameType, Animation.Frame.GetFrameIndex()), Color.White);
        }
Exemplo n.º 3
0
        public override void Draw(SpriteBatch p_spriteBatch)
        {
            base.Draw(p_spriteBatch);

            //Draw Background
            p_spriteBatch.Draw(GraphicAssets.guiItemsBackground, new Rectangle(88 * Main.s_scale,
                                                                               ((int)parentPosition.Y + 188) * Main.s_scale, 144 * Main.s_scale, 32 * Main.s_scale), Color.White);

            //Draw -LIFE-
            p_spriteBatch.DrawString(GraphicAssets.zeldaFont12, "-LIFE-",
                                     new Vector2(185f * Main.s_scale, ((int)parentPosition.Y + 188.0f) * Main.s_scale), GraphicAssets.guiRedColor,
                                     0.0f, Vector2.Zero, Main.s_scale / 2.0f, SpriteEffects.None, 0.0f);

            //Draw Rupees
            p_spriteBatch.DrawString(GraphicAssets.zeldaFont12, "X" + Inventory.Instance.rupeeCount,
                                     new Vector2((parentPosition.X + 97.0f) * Main.s_scale, (parentPosition.Y + 188.0f) * Main.s_scale), Color.White,
                                     0.0f, Vector2.Zero, Main.s_scale / 2.0f, SpriteEffects.None, 0.0f);

            //Draw Keys
            p_spriteBatch.DrawString(GraphicAssets.zeldaFont12, "X" + Inventory.Instance.keyCount,
                                     new Vector2((parentPosition.X + 97.0f) * Main.s_scale, (parentPosition.Y + 204.0f) * Main.s_scale), Color.White,
                                     0.0f, Vector2.Zero, Main.s_scale / 2.0f, SpriteEffects.None, 0.0f);

            //Draw Bombs
            p_spriteBatch.DrawString(GraphicAssets.zeldaFont12, "X" + Inventory.Instance.bombCount,
                                     new Vector2((parentPosition.X + 97.0f) * Main.s_scale, (parentPosition.Y + 212.0f) * Main.s_scale), Color.White,
                                     0.0f, Vector2.Zero, Main.s_scale / 2.0f, SpriteEffects.None, 0.0f);

            //Draw Second Item HotKey
            p_spriteBatch.DrawString(GraphicAssets.zeldaFont12, "B",
                                     new Vector2((parentPosition.X + 129.0f) * Main.s_scale, (parentPosition.Y + 188.0f) * Main.s_scale), Color.White,
                                     0f, Vector2.Zero, Main.s_scale / 2.0f, SpriteEffects.None, 0.0f);

            p_spriteBatch.Draw(GraphicAssets.inventoryTileset,
                               new Rectangle((124 + (int)parentPosition.X) * Main.s_scale,
                                             (196 + (int)parentPosition.Y) * Main.s_scale, 16 * Main.s_scale, 16 * Main.s_scale),
                               TilesetManager.GetSourceRectangle(TilesetManager.TileSetType.INVENTORY, 7), Color.White);

            //Draw Sword HotKey
            p_spriteBatch.DrawString(GraphicAssets.zeldaFont12, "A",
                                     new Vector2((parentPosition.X + 153.0f) * Main.s_scale, (parentPosition.Y + 188.0f) * Main.s_scale), Color.White,
                                     0.0f, Vector2.Zero, Main.s_scale / 2.0f, SpriteEffects.None, 0.0f);

            p_spriteBatch.Draw(GraphicAssets.inventoryTileset,
                               new Rectangle((148 + (int)parentPosition.X) * Main.s_scale,
                                             (196 + (int)parentPosition.Y) * Main.s_scale, 16 * Main.s_scale, 16 * Main.s_scale),
                               TilesetManager.GetSourceRectangle(TilesetManager.TileSetType.INVENTORY, 9), Color.White);

            //Draw Hearts
            var __x = 0;

            for (var __i = 0; __i < _player.maximumLife; __i += 2)
            {
                var __type = 0;

                if (_player.life - __i > 1)
                {
                    __type = 0;
                }
                else if (_player.life - __i == 1)
                {
                    __type = 1;
                }
                else
                {
                    __type = 2;
                }

                p_spriteBatch.Draw(GraphicAssets.inventoryTileset,
                                   new Rectangle((176 + (int)parentPosition.X + __x * 8) * Main.s_scale,
                                                 (208 + (int)parentPosition.Y) * Main.s_scale, 16 * Main.s_scale, 16 * Main.s_scale),
                                   TilesetManager.GetSourceRectangle(TilesetManager.TileSetType.INVENTORY, __type), Color.White);

                __x++;
            }
        }
Exemplo n.º 4
0
        public override void Draw(SpriteBatch p_spriteBatch)
        {
            base.Draw(p_spriteBatch);

            //Draw Small Item Frame
            p_spriteBatch.Draw(GraphicAssets.guiInventorySmallItemFrame,
                               new Rectangle(56 * Main.s_scale, ((int)parentPosition.Y + 39) * Main.s_scale, 32 * Main.s_scale, 32 * Main.s_scale),
                               Color.White);

            //Draw Big Item Frame
            p_spriteBatch.Draw(GraphicAssets.guiInventoryBigItemFrame,
                               new Rectangle(116 * Main.s_scale, ((int)parentPosition.Y + 39) * Main.s_scale, 112 * Main.s_scale, 48 * Main.s_scale),
                               Color.White);

            //Draw INVENTORY
            p_spriteBatch.DrawString(GraphicAssets.zeldaFont12, "INVENTORY",
                                     new Vector2(34.0f * Main.s_scale, (parentPosition.Y + 23.0f) * Main.s_scale),
                                     GraphicAssets.guiRedColor,
                                     0.0f,
                                     Vector2.Zero,
                                     Main.s_scale / 2.0f,
                                     SpriteEffects.None,
                                     0.0f);

            //Draw Use B Button
            p_spriteBatch.DrawString(GraphicAssets.zeldaFont12, "USE B BUTTON\n  FOR THIS",
                                     new Vector2(16.0f * Main.s_scale, (parentPosition.Y + 71.0f) * Main.s_scale),
                                     Color.White,
                                     0.0f,
                                     Vector2.Zero,
                                     Main.s_scale / 2.0f,
                                     SpriteEffects.None,
                                     0.0f);

            p_spriteBatch.Draw(GraphicAssets.inventoryTileset,
                               new Rectangle((63 + (int)parentPosition.X) * Main.s_scale, (47 + (int)parentPosition.Y) * Main.s_scale, 16 * Main.s_scale, 16 * Main.s_scale),
                               TilesetManager.GetSourceRectangle(TilesetManager.TileSetType.INVENTORY, 6),
                               Color.White);

            //Draw Map
            if (Inventory.Instance.hasMap)
            {
                p_spriteBatch.DrawString(GraphicAssets.zeldaFont12, "MAP",
                                         new Vector2(40.0f * Main.s_scale, (parentPosition.Y + 95.0f) * Main.s_scale),
                                         GraphicAssets.guiRedColor,
                                         0.0f,
                                         Vector2.Zero,
                                         Main.s_scale / 2.0f,
                                         SpriteEffects.None, 0.0f);

                p_spriteBatch.Draw(GraphicAssets.inventoryTileset,
                                   new Rectangle((44 + (int)parentPosition.X) * Main.s_scale, (111 + (int)parentPosition.Y) * Main.s_scale, 16 * Main.s_scale, 16 * Main.s_scale),
                                   TilesetManager.GetSourceRectangle(TilesetManager.TileSetType.INVENTORY, 3),
                                   Color.White);

                //Draw Compass
                if (Inventory.Instance.hasCompass)
                {
                    p_spriteBatch.DrawString(GraphicAssets.zeldaFont12, "COMPASS",
                                             new Vector2(24.0f * Main.s_scale, (parentPosition.Y + 135.0f) * Main.s_scale),
                                             GraphicAssets.guiRedColor,
                                             0.0f,
                                             Vector2.Zero,
                                             Main.s_scale / 2.0f,
                                             SpriteEffects.None,
                                             0.0f);

                    p_spriteBatch.Draw(GraphicAssets.inventoryTileset,
                                       new Rectangle((44 + (int)parentPosition.X) * Main.s_scale, (151 + (int)parentPosition.Y) * Main.s_scale, 16 * Main.s_scale, 16 * Main.s_scale),
                                       TilesetManager.GetSourceRectangle(TilesetManager.TileSetType.INVENTORY, 4),
                                       Color.White);
                }
            }
            //Draw Big Triforce
            else
            {
                p_spriteBatch.Draw(GraphicAssets.guiInventoryBigTriforce,
                                   new Rectangle(80 * Main.s_scale, ((int)parentPosition.Y + 103) * Main.s_scale, 96 * Main.s_scale, 48 * Main.s_scale),
                                   Color.White);

                p_spriteBatch.DrawString(GraphicAssets.zeldaFont12, "TRIFORCE",
                                         new Vector2(97.0f * Main.s_scale, (parentPosition.Y + 159.0f) * Main.s_scale),
                                         GraphicAssets.guiRedColor,
                                         0.0f,
                                         Vector2.Zero,
                                         Main.s_scale / 2.0f,
                                         SpriteEffects.None,
                                         0.0f);
            }

            //Draw Items
            p_spriteBatch.Draw(GraphicAssets.inventoryTileset,
                               new Rectangle((63 + (int)parentPosition.X) * Main.s_scale, (47 + (int)parentPosition.Y) * Main.s_scale, 16 * Main.s_scale, 16 * Main.s_scale),
                               TilesetManager.GetSourceRectangle(TilesetManager.TileSetType.INVENTORY, 6),
                               Color.White);
        }