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


C# TileSet.AddTile方法代码示例

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


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

示例1: GlControlBox_Load

		/// <summary>
		/// Form loading
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void GlControlBox_Load(object sender, EventArgs e)
		{
			if (DesignMode)
				return;

			GlControlBox.MakeCurrent();
			Display.Init();

			// Spritebatch
            Batch = new SpriteBatch();

			// Preload background texture resource
			CheckerBoard = new Texture2D(ResourceManager.GetInternalResource("ArcEngine.Resources.checkerboard.png"));
			CheckerBoard.HorizontalWrap = TextureWrapFilter.Repeat;
			CheckerBoard.VerticalWrap = TextureWrapFilter.Repeat;


			// Preload texture resources
			Icons = new TileSet();
			Icons.Texture = new Texture2D(ResourceManager.GetInternalResource("DungeonEye.Forms.data.editor.png"));

			int id = 0;
			for (int y = 0; y < Icons.Texture.Size.Height - 50; y += 25)
			{
				for (int x = 0; x < Icons.Texture.Size.Width; x += 25)
				{
					Tile tile = Icons.AddTile(id++);
					tile.Rectangle = new Rectangle(x, y, 25, 25);
				}
			}
			Icons.AddTile(100).Rectangle = new Rectangle(0, 245, 6, 11); // alcoves
			Icons.AddTile(101).Rectangle = new Rectangle(6, 248, 11, 6); // alcoves


			ParentForm.FormClosing += new FormClosingEventHandler(ParentForm_FormClosing);
			DrawTimer.Start();
	
		}
开发者ID:melkor54248,项目名称:dungeoneye,代码行数:43,代码来源:DungeonLocationControl.cs

示例2: DungeonForm_Load

		/// <summary>
		/// On form loading
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void DungeonForm_Load(object sender, EventArgs e)
		{

			glControl.MakeCurrent();
			Display.Init();

			SpriteBatch = new SpriteBatch();


			// Preload background texture resource
			CheckerBoard = new Texture2D(ResourceManager.GetInternalResource("ArcEngine.Resources.checkerboard.png"));
			CheckerBoard.HorizontalWrap = TextureWrapFilter.Repeat;
			CheckerBoard.VerticalWrap = TextureWrapFilter.Repeat;

			// Preload texture resources
			Icons = new TileSet();
			Icons.Texture = new Texture2D(ResourceManager.GetInternalResource("DungeonEye.Forms.data.editor.png"));
			int id = 0;
			for (int y = 0 ; y < Icons.Texture.Size.Height - 50 ; y += 25)
			{
				for (int x = 0 ; x < Icons.Texture.Size.Width ; x += 25)
				{
					Tile tile = Icons.AddTile(id++);
					tile.Rectangle = new Rectangle(x, y, 25, 25);
				}
			}
			Icons.AddTile(100).Rectangle = new Rectangle(0, 245, 6, 11); // alcoves
			Icons.AddTile(101).Rectangle = new Rectangle(6, 248, 11, 6); // alcoves
			Icons.AddTile(102).Rectangle = new Rectangle(17, 243, 10, 13); // wall switch
			Icons.AddTile(103).Rectangle = new Rectangle(27, 246, 13, 10); // wall switch


			RebuildMazeList();

			if (Dungeon.StartLocation != null && !string.IsNullOrEmpty(Dungeon.StartLocation.Maze) && MazeListBox.Items.Contains(Dungeon.StartLocation.Maze))
				MazeListBox.SelectedItem = Dungeon.StartLocation.Maze;
			else if (MazeListBox.Items.Count > 0)
				MazeListBox.SelectedIndex = 0;

			DrawTimer.Start();

		}
开发者ID:melkor54248,项目名称:dungeoneye,代码行数:47,代码来源:DungeonForm.cs


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