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


C# IContentService.Load方法代码示例

本文整理汇总了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");
        }
开发者ID:patriksvensson,项目名称:ld29,代码行数:18,代码来源:Bottle.cs

示例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)));
        }
开发者ID:patriksvensson,项目名称:ld29,代码行数:45,代码来源:Player.cs


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