예제 #1
0
        private static void DrawItems(Tile tile, Rectangle target)
        {
            Item tileItem = tile.MainObject as Item;

            if (tileItem != null)
            {
                ComponentHasTexture itemVisual = tileItem.GetExactComponent <ComponentHasTexture>();

                Point2D topLeft = new Point2D(0, 0);
                int     length  = itemVisual.Visuals.Count;
                for (int i = 0; i < length; i++)
                {
                    AbstractVisual visual = itemVisual.Visuals[i];
                    topLeft.X = target.X;
                    topLeft.Y = target.Y;
                    visual.Render(MapDrawer, topLeft);
                }

                ItemCountBounds.X = target.Location.X + (TileSize.X / 2);
                ItemCountBounds.Y = target.Location.Y + TileSize.Y;

                MapDrawer.DrawText(tileItem.CurrentlyStacked.ToString(), ItemCountBounds,
                                   ItemCountFont, SimpleTextRenderer.Alignment.Left, RenderLayer.MapItemCount);
            }
        }
예제 #2
0
        private static void DrawItems(Tile tile, Rectangle target)
        {
            if (tile.Item != null)
            {
                Texture2D texture = AssetManager.Textures[tile.Item.TextureIndex];
                MapDrawer.Draw(texture, target, RenderLayer.Items);

                ItemCountBounds.X = target.Location.X + TileSize.X / 2;
                ItemCountBounds.Y = target.Location.Y + TileSize.Y;

                MapDrawer.DrawText(tile.Item.CurrentlyStacked.ToString(), ItemCountBounds,
                                   ItemCountFont, SimpleTextRenderer.Alignment.Left, RenderLayer.MapItemCount);
            }
        }