本文整理汇总了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();
}
示例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();
}