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


C# Microsoft.Load方法代码示例

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


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

示例1: LoadContent

        public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            //do not remove this
            base.LoadBasicContent(content);

            logo = content.Load<Texture2D>("logo");
        }
开发者ID:Kairna,项目名称:TouchAndPlay,代码行数:7,代码来源:CartesianTestScreen.cs

示例2: FontManager

        public FontManager(GraphicsDevice graphicsDevice, Microsoft.Xna.Framework.Content.ContentManager content, int appWinHeight)
        {
            m_LabelColor = Color.Red;
            m_TopEchoColor = Color.Black;
            m_BottomEchoColor = Color.Black;
            ComputeFontPositions(appWinHeight);

            m_LabelFont = null;
            m_EchoFont = null;
            m_DrawHelper = null;

            const String path1 = @"Resources/Fonts/Arial";
            const String path2 = @"Content/Resources/Fonts/Arial";
            String usePath = null;

            #if WINDOWS_PHONE
            usePath = path2;
            #else
            if (File.Exists(string.Concat(path1, ".xnb")))
                usePath = path1;
            else if (File.Exists(string.Concat(path2, ".xnb")))
                usePath = path2;
            #endif

            if (null!=usePath) {
                m_LabelFont = content.Load<SpriteFont>(usePath);
                m_EchoFont = content.Load<SpriteFont>(usePath);
                Vector2 spaceSize = m_EchoFont.MeasureString(" ");
                m_SpaceFillerWidth = spaceSize.X;
            }
        }
开发者ID:AntMartz,项目名称:fat-cats-final,代码行数:31,代码来源:FontsManager.cs

示例3: LoadContent

 public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager content, string assetName)
 {
     base.LoadContent(content, assetName);
     heart2 = content.Load<Texture2D>("heartv2");
     heart1 = content.Load<Texture2D>("heartv1");
     Position = new Microsoft.Xna.Framework.Vector2(0,0);
 }
开发者ID:faudeval,项目名称:projet,代码行数:7,代码来源:Life.cs

示例4: Init

        public override void Init(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            base.Init(content);
            this.collider = new RectangleCollider(new Vector2(0, 0), new Vector2(64, 64));
            Random r = new Random();
            int choo = r.Next(0,100);
            if(choo < 3)
            {
                this.texture = new AnimatedTexture2D(content.Load<Texture2D>(FileNames.jewelPurple), 64, animationSub.def);
                this.loot = 2500;
            }
            else if (choo < 10)
            {
                this.texture = new AnimatedTexture2D(content.Load<Texture2D>(FileNames.jewelBlue), 64, animationSub.def);
                this.loot = 2000;
            }
            else if (choo <  20)
            {
                this.texture = new AnimatedTexture2D(content.Load<Texture2D>(FileNames.jewelOrange), 64, animationSub.def);
                this.loot = 1500;
            }
            else if (choo < 50)
            {
                this.texture = new AnimatedTexture2D(content.Load<Texture2D>(FileNames.jewelGreen), 64, animationSub.def);
                this.loot = 1000;
            }
            else
            {
                this.texture = new AnimatedTexture2D(content.Load<Texture2D>(FileNames.jewelRed), 64, animationSub.def);
                this.loot = 500;
            }

            this.texture.skipC = 4;
        }
开发者ID:callumlawson,项目名称:Space,代码行数:34,代码来源:LootObject.cs

示例5: InitOne

        public override bool InitOne(Microsoft.Xna.Framework.Content.ContentManager content, int id)
        {
            XmlDocument _doc = new XmlDocument();
            _doc.Load(_xmlInfo);
            XmlNode _label = _doc.SelectSingleNode("//Label[@id = '" + id.ToString() + "']");

            _prototype[id] = new Label();

            _prototype[id]._nsprite = 1;
            _prototype[id]._sprite = new GameSprite[_prototype[id]._nsprite];
            Texture2D _tempTexture = content.Load<Texture2D>(_label.SelectSingleNode ("BackGround").InnerText);
            _prototype[id]._sprite[0] = new GameSprite(_tempTexture, 0, 0);

            ((Label)_prototype[id]).Sf = content.Load<SpriteFont>(_label.SelectSingleNode("Font").InnerText);
            ((Label)_prototype[id]).StringInfo = _label.SelectSingleNode("StringInfo").InnerText;
            _prototype[id].X = int.Parse(_label.SelectSingleNode("X").InnerText);
            _prototype[id].Y = int.Parse(_label.SelectSingleNode("Y").InnerText);
            _prototype[id].OffSetX = _prototype[id].X;
            _prototype[id].OffSetY = _prototype[id].Y;
            ((Label)_prototype[id]).DrawOffSetX = int.Parse(_label.SelectSingleNode("DrawOffSetX").InnerText);
            ((Label)_prototype[id]).DrawOffSetY = int.Parse(_label.SelectSingleNode("DrawOffSetY").InnerText);

            float _red = float.Parse(_label.SelectSingleNode("Color").SelectSingleNode("R").InnerText);
            float _green = float.Parse(_label.SelectSingleNode("Color").SelectSingleNode("G").InnerText);
            float _blue = float.Parse(_label.SelectSingleNode("Color").SelectSingleNode("B").InnerText);
            ((Label)_prototype[id]).StringColor = new Color(_red, _green, _blue);

            return true;
        }
开发者ID:ndphu,项目名称:39649deb8d44b551ea1b03f7a77aff84,代码行数:29,代码来源:LabelManager.cs

示例6: Item

 public Item(int id, Microsoft.Xna.Framework.Content.ContentManager content)
 {
     _ID = id;
     if (_ID == (int)ItemName.Apple)
     {
         _texture = content.Load<Texture2D>("Sprites\\Apple");
         _description = "Restores a small amount of health when eaten.";
     }
     if (_ID == (int)ItemName.Golden_Apple)
     {
         _texture = content.Load<Texture2D>("Sprites\\GoldenApple");
         _description = "Fully restores a creature when eaten.";
     }
     if (_ID == (int)ItemName.Spring_Water)
     {
         _texture = content.Load<Texture2D>("Sprites\\SpringWater");
         _description = "Fresh from the springs. Fully restores stamina.";
     }
     if (_ID == (int)ItemName.Honey)
     {
         _texture = content.Load<Texture2D>("Sprites\\Honey");
         _description = "Sugary goodness. Increases a creature's obedience.";
     }
     if (_ID == (int)ItemName.Chilli)
     {
         _texture = content.Load<Texture2D>("Sprites\\Chilli");
         _description = "Makes a creature more aggressive when eaten.";
     }
 }
开发者ID:hkeeble,项目名称:GroupProject,代码行数:29,代码来源:Item.cs

示例7: LoadTexture

 public override void LoadTexture( Microsoft.Xna.Framework.Content.ContentManager Content )
 {
     Texture = Content.Load<Texture2D>( "Sprites\\ExtraLife" );
     Halo = Content.Load<Texture2D>( "Sprites\\ExtraAlive" );
     Origin = new Vector2( 16, 16 );
     Scale = 2.0F;
 }
开发者ID:nitzanbueno,项目名称:TanksDropTwo,代码行数:7,代码来源:ExtraLife.cs

示例8: Validate

        public bool Validate(FileCollection sourceFiles, Microsoft.SharePoint.Client.ClientContext ctx)
        {
            int scount = 0;
            int tcount = 0;

            foreach (var sf in sourceFiles)
            {
                scount++;
                string fileName = sf.Src;
                string folderName = sf.Folder;
                string fileUrl = UrlUtility.Combine(ctx.Web.ServerRelativeUrl, folderName + "/" + fileName);
                var file = ctx.Web.GetFileByServerRelativeUrl(UrlUtility.Combine(ctx.Web.ServerRelativeUrl, folderName + "/" + fileName));
                ctx.Load(file, f => f.Exists, f => f.Length);
                ctx.ExecuteQuery();

                if (file.Exists)
                {
                    tcount++;

                    #region File - Security
                    if (sf.Security != null)
                    {
                        ctx.Load(file, f => f.ListItemAllFields);
                        ctx.ExecuteQuery();
                        bool isSecurityMatch = ValidateSecurityCSOM(ctx, sf.Security, file.ListItemAllFields);
                        if (!isSecurityMatch)
                        {
                            return false;
                        }

                    }
                    #endregion

                    #region Overwrite validation
                    if (sf.Overwrite == false)
                    {
                        // lookup the original added file size...should be different from the one we retrieved from SharePoint since we opted to NOT overwrite
                        var files = System.IO.Directory.GetFiles(@".\framework\functional\templates");
                        foreach (var f in files)
                        {
                            if (f.Contains(sf.Src))
                            {
                                if (new System.IO.FileInfo(f).Length == file.Length)
                                {
                                    return false;
                                }
                            }
                        }
                    }
                    #endregion
                }
                else
                {
                    return false;
                }
            }

            return true;
        }
开发者ID:stijnbrouwers,项目名称:PnP-Sites-Core,代码行数:59,代码来源:FilesValidator.cs

示例9: Load

        public override void Load(Microsoft.Xna.Framework.Content.ContentManager contentManager)
        {
            soundEffectList.Add("dance", contentManager.Load<SoundEffect>(@"Audio\Effects\tingle_dance"));
            soundEffectList.Add("hoi", contentManager.Load<SoundEffect>(@"Audio\Effects\tingle_hoi"));
            soundEffectList.Add("laugh", contentManager.Load<SoundEffect>(@"Audio\Effects\tingle_laugh"));
            soundEffectList.Add("magic", contentManager.Load<SoundEffect>(@"Audio\Effects\tingle_magic"));

            base.Load(contentManager);
        }
开发者ID:Rosthouse,项目名称:JumpNRun,代码行数:9,代码来源:GreenTurtle.cs

示例10: LoadContent

        public static void LoadContent(Microsoft.Xna.Framework.Content.ContentManager Content)
        {
            playlist.Add("Amazing Plan", Content.Load<Song>("Music\\AmazingPlan"));
            playlist.Add("Fig Leaf Rag", Content.Load<Song>("Music\\FigLeafRag"));
            playlist.Add("Dark Hallway", Content.Load<Song>("Music\\DarkHallway"));
            playlist.Add("Clay", Content.Load<Song>("Music\\madeofclay"));


        }
开发者ID:guozanhua,项目名称:KinectRagdoll,代码行数:9,代码来源:Jukebox.cs

示例11: Initialize

        public override void Initialize(Microsoft.Xna.Framework.Content.ContentManager contentLoader, Manifracture.ComponentManifest manifest)
        {
            IrradianceMap = contentLoader.Load<Texture2D>((string)(manifest.Properties[ManifestKeys.IRRADIANCEMAP]));
            SpecPrefilter = contentLoader.Load<Texture2D>((string)(manifest.Properties[ManifestKeys.SPECPREFILTER]));
            NumSpecLevels = (int)(manifest.Properties[ManifestKeys.NUMSPECLEVELS]);
            SpecExponentFactor = (float)(manifest.Properties[ManifestKeys.SPECEXPONENTFACTOR]);
            AmbientLight = (Vector3)(manifest.Properties[ManifestKeys.AMBIENTLIGHT]);

            Owner.ActorInitialized += ActorInitializedHandler;
        }
开发者ID:Tengato,项目名称:Mechadrone1,代码行数:10,代码来源:HDRLightComponent.cs

示例12: IMGui

 public IMGui(Microsoft.Xna.Framework.Content.ContentManager a_content, GraphicsDevice a_graphicsDevice, MegaJump.Model.MainModel a_mainmodel)
 {
     // TODO: Complete member initialization
     m_content = a_content;
     m_spriteBatch = new SpriteBatch(a_graphicsDevice);
     m_spriteFont = a_content.Load<SpriteFont>("Courier New");
     m_menuFont = a_content.Load<SpriteFont>("MenuButtons");
     m_texture = a_content.Load<Texture2D>("button");
     m_backGround = a_content.Load<Texture2D>("MenuBackground");
     m_mainModel = a_mainmodel;
 }
开发者ID:BaltaX,项目名称:MegaJump,代码行数:11,代码来源:IMGui.cs

示例13: LoadContent

 public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager Content)
 {
     bakcground.LoadContent(Content);
     objectManager.LoadContent(Content);
     objectManager.AddObject(player);
     this.texture2 = Content.Load<Texture2D>("sprites/Pause");
     this.sound = Content.Load<Song>("sounds/space");
     base.LoadContent(Content);
     MediaPlayer.Play(this.sound);
     MediaPlayer.Volume = 2f;
     MediaPlayer.IsRepeating = true;
 }
开发者ID:TeamAmpere,项目名称:AdvancedC-Game,代码行数:12,代码来源:MainScreen.cs

示例14: LoadContent

        public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            glove = new Image_MenuItem(new Vector2(clientBounds.X + clientBounds.Width / 4, clientBounds.Y + 3 * clientBounds.Height / 4),
                content.Load<Texture2D>("Menu/Punch_Glove"), 200, 200);

            butlerHand = new Image_MenuItem(new Vector2(clientBounds.X + clientBounds.Width / 4, clientBounds.Y + 3 * clientBounds.Height / 4),
                content.Load<Texture2D>("Menu/ButlerHand_Idle"), 200, 200);

            items.Add(glove);
            items.Add(butlerHand);

            base.LoadContent(content);
        }
开发者ID:NarPar,项目名称:Auction-Boxing-3rd,代码行数:13,代码来源:MainMenuScreen.cs

示例15: LoadContent

        public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager Content, Microsoft.Xna.Framework.Graphics.SpriteBatch sprBatch)
        {
            m_sprBatch = sprBatch;

            Background = Content.Load<Texture2D>("GameState/Graphics/Credits/creditScreen");
            Cursor = Content.Load<Texture2D>("FallDown/Textures/cursor");
            Arrow = Content.Load<Texture2D>("FallDown/Textures/arrow");
            ListFont = Content.Load<SpriteFont>("FallDown/Textures/ScoreFont");

            ArrowPosition = new Vector2(0, 480 - 50);

            base.LoadContent(Content, sprBatch);
        }
开发者ID:choppyfireballs,项目名称:sescape,代码行数:13,代码来源:CreditsScreen.cs


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