本文整理汇总了C#中IContentService.Load方法的典型用法代码示例。如果您正苦于以下问题:C# IContentService.Load方法的具体用法?C# IContentService.Load怎么用?C# IContentService.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IContentService
的用法示例。
在下文中一共展示了IContentService.Load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadContent
public override void LoadContent(IContentService content)
{
var texture = content.Load<Texture2D>("textures/bottle");
_sprite = new Sprite(texture, new Size(16,16));
_sprite.Position = this.Position;
_sprite.Register("Botteling", new Animation(
new[] {
new Frame(new Cell(0,0), TimeSpan.FromMilliseconds(75)),
new Frame(new Cell(1,0), TimeSpan.FromMilliseconds(75)),
new Frame(new Cell(2,0), TimeSpan.FromMilliseconds(75)),
new Frame(new Cell(3,0), TimeSpan.FromMilliseconds(75)),
new Frame(new Cell(2,0), TimeSpan.FromMilliseconds(75)),
new Frame(new Cell(1,0), TimeSpan.FromMilliseconds(75))
}, new Size(16, 16)));
_sprite.Play("Botteling");
}
示例2: LoadContent
public void LoadContent(IContentService content)
{
var texture = content.Load<Texture2D>("textures/playersheet");
_sprite = new Sprite(texture, new Size(16, 16));
_sprite.Register("Walk-Right", new Animation(
new[] {
new Frame(new Cell(0,0), TimeSpan.FromMilliseconds(75)),
new Frame(new Cell(1,0), TimeSpan.FromMilliseconds(75)),
new Frame(new Cell(2,0), TimeSpan.FromMilliseconds(75)),
new Frame(new Cell(1,0), TimeSpan.FromMilliseconds(75)),
}, new Size(16, 16)));
_sprite.Register("Walk-Left", new Animation(
new[] {
new Frame(new Cell(0,1), TimeSpan.FromMilliseconds(75)),
new Frame(new Cell(1,1), TimeSpan.FromMilliseconds(75)),
new Frame(new Cell(2,1), TimeSpan.FromMilliseconds(75)),
new Frame(new Cell(1,1), TimeSpan.FromMilliseconds(75)),
}, new Size(16, 16)));
_sprite.Register("Idle-Right", new Animation(
new[] {
new Frame(new Cell(0,2), TimeSpan.FromMilliseconds(150)),
new Frame(new Cell(1,2), TimeSpan.FromMilliseconds(150)),
new Frame(new Cell(2,2), TimeSpan.FromMilliseconds(150)),
new Frame(new Cell(1,2), TimeSpan.FromMilliseconds(150)),
}, new Size(16, 16)));
_sprite.Register("Idle-Left", new Animation(
new[] {
new Frame(new Cell(0,3), TimeSpan.FromMilliseconds(150)),
new Frame(new Cell(1,3), TimeSpan.FromMilliseconds(150)),
new Frame(new Cell(2,3), TimeSpan.FromMilliseconds(150)),
new Frame(new Cell(1,3), TimeSpan.FromMilliseconds(150)),
}, new Size(16, 16)));
_sprite.Register("Climb", new Animation(
new[] {
new Frame(new Cell(0,4), TimeSpan.FromMilliseconds(150)),
new Frame(new Cell(1,4), TimeSpan.FromMilliseconds(150)),
new Frame(new Cell(2,4), TimeSpan.FromMilliseconds(150)),
new Frame(new Cell(1,4), TimeSpan.FromMilliseconds(150)),
}, new Size(16, 16)));
}