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


C# Sector.Add方法代码示例

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


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

示例1: CreateSector

    /// <summary>
    /// Initializes a new sector with some default values.
    /// </summary>
    /// <param name="Name">Name of new sector.</param>
    /// <returns>The created <see cref="Sector"/> object.</returns>
    public static Sector CreateSector(string Name)
    {
        Sector sector = new Sector();
        sector.Name = Name;

        Tilemap tilemap = new Tilemap();
        tilemap.Resize(100, 35, 0);
        tilemap.Layer = -100;
        tilemap.Name = "Background";
        sector.Add(tilemap, true);

        tilemap = new Tilemap();
        tilemap.Resize(100, 35, 0);
        tilemap.Layer = 0;
        tilemap.Solid = true;
        tilemap.Name = "Interactive";
        sector.Add(tilemap, true);

        tilemap = new Tilemap();
        tilemap.Resize(100, 35, 0);
        tilemap.Layer = 100;
        tilemap.Name = "Foreground";
        sector.Add(tilemap, true);

        SpawnPoint spawnpoint = new SpawnPoint();
        spawnpoint.X = 96;
        spawnpoint.Y = 96;
        spawnpoint.Name = "main";
        sector.Add(spawnpoint, true);

        Camera camera = new Camera();
        sector.Add(camera, true);

        sector.FinishRead(); //let sector detect it's dimensions

        return sector;
    }
开发者ID:Karkus476,项目名称:supertux-editor,代码行数:42,代码来源:LevelUtil.cs

示例2: CreateSector

    /// <summary>
    /// Initialises a new sector with some default values.
    /// </summary>
    /// <param name="Name">Name of new sector.</param>
    /// <returns>The created sector.</returns>
    public static Sector CreateSector(string Name)
    {
        Sector sector = new Sector();
        sector.Name = Name;

        Tilemap tilemap = new Tilemap();
        tilemap.Resize(100, 35, 0);
        tilemap.ZPos = -100;
        tilemap.Name = "Background";
        sector.Add(tilemap);

        tilemap = new Tilemap();
        tilemap.Resize(100, 35, 0);
        tilemap.ZPos = 0;
        tilemap.Solid = true;
        tilemap.Name = "Interactive";
        sector.Add(tilemap);

        tilemap = new Tilemap();
        tilemap.Resize(100, 35, 0);
        tilemap.ZPos = 100;
        tilemap.Name = "Foreground";
        sector.Add(tilemap);

        SpawnPoint spawnpoint = new SpawnPoint();
        spawnpoint.X = 96;
        spawnpoint.Y = 96;
        spawnpoint.Name = "main";
        sector.Add(spawnpoint);

        Camera camera = new Camera();
        sector.Add(camera);

        Background background = new Background();
        background.Image = "images/background/BlueRock_Forest/blue-middle.jpg";
        background.ImageTop = "images/background/BlueRock_Forest/blue-top.jpg";
        background.ImageBottom = "images/background/BlueRock_Forest/blue-bottom.jpg";
        sector.Add(background);

        return sector;
    }
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:46,代码来源:LevelUtil.cs


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