当前位置: 首页>>代码示例>>C#>>正文


C# Map.DrawMap方法代码示例

本文整理汇总了C#中Map.DrawMap方法的典型用法代码示例。如果您正苦于以下问题:C# Map.DrawMap方法的具体用法?C# Map.DrawMap怎么用?C# Map.DrawMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Map的用法示例。


在下文中一共展示了Map.DrawMap方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Game

        public Game(Canvas canvas, BitmapImage unitImg, BitmapImage towerImg, BitmapImage bulletImg, BitmapImage roadImg)
        {
            this.gameCanvas = canvas;
            this.unitImg = unitImg;
            this.towerImg = towerImg;
            this.roadImg = roadImg;
            //tileHeight = Math.Max(this.unitImg.DecodePixelHeight, this.towerImg.DecodePixelHeight);
            //tileWidth = Math.Max(this.unitImg.DecodePixelWidth, this.towerImg.DecodePixelWidth);
            this.map = new Map((int)gameCanvas.Width, (int)canvas.Height, tileWidth, tileHeight);
            InitPath();
            this.bulletImg = bulletImg;
            InitUnits();
            InitTowers();

            //map.DrawTiles(gameCanvas);
            map.Images[ObjectType.Path] = this.roadImg;
            map.DrawMap(gameCanvas);
            map.DrawTiles(gameCanvas);
        }
开发者ID:RodionXedin,项目名称:Game1-TowerDefence,代码行数:19,代码来源:Game.cs

示例2: MapInfos

        public MapInfos(Map CurrentMap, String ProjectName, String filename)
        {
            InitializeComponent();

            map = CurrentMap;

            PN_Title.BackgroundImage = new Bitmap(PN_Title.Width, PN_Title.Height);

            using (XNAUtils utils = new XNAUtils())
            using (Graphics g = Graphics.FromImage(PN_Title.BackgroundImage))
            using (Brush brush = new SolidBrush(Color.Black))
            using (Font bigfont = new Font("Calibri", 30))
            using (Font smallfont = new Font("Calibri", 14))
            {
                g.DrawImage(utils.ConvertToImage(map.DrawMap()), new Point(0, 0));
                g.DrawImage(Properties.Resources.FuzzyLineTitle, new Point(0,0));
                g.DrawImage(Properties.Resources.AeroEffect, new Point(0, 0));
                g.DrawString(map.Name, bigfont, brush, new Point(5, 5));

                g.DrawString(ProjectName, smallfont, brush, new Point(25, 50));

                PN_Title.Refresh();

                NUM_X.Value = Convert.ToDecimal(map.MapSize.Width);
                NUM_Y.Value = Convert.ToDecimal(map.MapSize.Height);

                TB_Rename.Text = map.Name;

                PB_Tileset.Image = utils.ConvertToImage(map.TileSet);
                PB_Tileset.Size = PB_Tileset.Image.Size;

                FileInfo info = new FileInfo(filename);
                LB_Filename.Text = info.Name;
                LB_Filesize.Text = (info.Length / 1024) + "ko";
            }

            this.Text += " - " + map.Name;
        }
开发者ID:rykdesjardins,项目名称:pixel-lion,代码行数:38,代码来源:MapInfos.cs

示例3: DrawLimits

        public DrawLimits(Map map)
        {
            InitializeComponent();
            this.map = map;

            using (XNAUtils utils = new XNAUtils())
            {
                PN_Map.BackgroundImage = utils.ConvertToImage(map.DrawMap());
                PN_Map.Size = new Size(map.MapSize.Width * 32, map.MapSize.Height * 32);

                Buffer = new Bitmap(PN_Map.Size.Width, PN_Map.Size.Height);
                using (Graphics g = Graphics.FromImage(Buffer))
                {
                    g.Clear(Color.White);
                    if (map.Limits != null) g.DrawImage(utils.ConvertToImage(map.Limits), new Point(0, 0));
                }
                Buffer.MakeTransparent(Color.White);

                Brushsize = 10;
                Brushtype = BrushType.Circle;
                brushcolor = Color.Black;
            }
        }
开发者ID:rykdesjardins,项目名称:pixel-lion,代码行数:23,代码来源:DrawLimits.cs

示例4: DrawMap

    private MemoryStream DrawMap(Map diMap)
    {
        MemoryStream RetVal = new MemoryStream();

        Bitmap bmp = new Bitmap(Convert.ToInt32(diMap.Width), Convert.ToInt32(diMap.Height));
        diMap.DrawMap(string.Empty, Graphics.FromImage(bmp));
        bmp.Save(RetVal, ImageFormat.Png);

        return RetVal;
    }
开发者ID:SDRC-India,项目名称:sdrcdevinfo,代码行数:10,代码来源:MapCallback.cs

示例5: GenerateMap

 public Texture2D GenerateMap(Texture2D tileset)
 {
     Map map = new Map(tiles, tileset);
     return map.DrawMap();
 }
开发者ID:rykdesjardins,项目名称:pixel-lion,代码行数:5,代码来源:MapState.cs


注:本文中的Map.DrawMap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。