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


C# ContentManager.Load方法代码示例

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


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

示例1: ParticleSystem

        public ParticleSystem(GraphicsDevice device, ContentManager content)
        {
            this.device = device;

            // Create vertex buffer used to spawn new particles
            this.particleStart = Buffer.Vertex.New<ParticleVertex>(device, MAX_NEW);

            // Create vertex buffers to use for updating and drawing the particles alternatively
            var vbFlags = BufferFlags.VertexBuffer | BufferFlags.StreamOutput;
            this.particleDrawFrom = Buffer.New<ParticleVertex>(device, MAX_PARTICLES, vbFlags);
            this.particleStreamTo = Buffer.New<ParticleVertex>(device, MAX_PARTICLES, vbFlags);

            this.layout = VertexInputLayout.FromBuffer(0, this.particleStreamTo);
            this.effect = content.Load<Effect>("ParticleEffect");
            this.texture = content.Load<Texture2D>("Dot");

            this.viewParameter = effect.Parameters["_view"];
            this.projParameter = effect.Parameters["_proj"];
            this.lookAtMatrixParameter = effect.Parameters["_lookAtMatrix"];
            this.elapsedSecondsParameter = effect.Parameters["_elapsedSeconds"];
            this.camDirParameter = effect.Parameters["_camDir"];
            this.gravityParameter = effect.Parameters["_gravity"];
            this.textureParameter = effect.Parameters["_texture"];
            this.samplerParameter = effect.Parameters["_sampler"];
            this.updatePass = effect.Techniques["UpdateTeq"].Passes[0];
            this.renderPass = effect.Techniques["RenderTeq"].Passes[0];
        }
开发者ID:Kammikazy,项目名称:SharpDX-Samples,代码行数:27,代码来源:ParticleSystem.cs

示例2: LoadContent

 /// <summary>
 /// Loads the content.
 /// </summary>
 /// <param name="content">The ContentManager.</param>
 public override void LoadContent(ContentManager content)
 {
     _skyBox =
         new Skybox(new[]
         {
             content.Load<Texture2D>("mainbackground.png"), content.Load<Texture2D>("bgLayer1.png"),
             content.Load<Texture2D>("bgLayer2.png")
         });
     _header = new Font("Segoe UI", 25, TypefaceStyle.Bold);
     _subHeader = new Font("Segoe UI", 40, TypefaceStyle.Bold);
     _fadeableText1 = new FadeableText
     {
         Font = _header,
         Text = "ThuCommix presents",
         Position = new Vector2(270, 200),
         FadeInVelocity = 2,
         FadeOutVelocity = 3
     };
     _fadeableText2 = new FadeableText
     {
         Font = _header,
         Text = "a game powered by Sharpex2D",
         Position = new Vector2(220, 200),
         FadeInVelocity = 2,
         FadeOutVelocity = 3
     };
     _fadeableText3 = new FadeableText
     {
         Font = _subHeader,
         Text = "XPlane",
         Position = new Vector2(330, 200),
         FadeInVelocity = 2,
         FadeOutVelocity = 2
     };
 }
开发者ID:ThuCommix,项目名称:Sharpex2D,代码行数:39,代码来源:IntroScene.cs

示例3: BGLayerButton

        public BGLayerButton(ContentManager content)
            : base(content)
        {
            normalTexture = content.Load<Texture2D>("Editor/Buttons/LayerButtons/Normal/Background");
            TextureToDraw = normalTexture;

            hooverTexture = content.Load<Texture2D>("Editor/Buttons/LayerButtons/Hoover/BackgroundHoover");
        }
开发者ID:nian0601,项目名称:MobileGame,代码行数:8,代码来源:GUIStyles.cs

示例4: BGTile2

        public BGTile2(ContentManager content)
            : base(content)
        {
            normalTexture = content.Load<Texture2D>("Editor/ToolButtons/Normal/BGTile2");
            TextureToDraw = normalTexture;

            hooverTexture = content.Load<Texture2D>("Editor/ToolButtons/Hoover/BGTile2Hoover");
        }
开发者ID:nian0601,项目名称:MobileGame,代码行数:8,代码来源:GUIStyles.cs

示例5: LoadContent

 /// <summary>
 /// Loads the content.
 /// </summary>
 /// <param name="content">The Content.</param>
 public override void LoadContent(ContentManager content)
 {
     _skyBox =
         new Skybox(new[]
         {
             content.Load<Texture2D>("mainbackground.png"), content.Load<Texture2D>("bgLayer1.png"),
             content.Load<Texture2D>("bgLayer2.png")
         });
 }
开发者ID:ThuCommix,项目名称:Sharpex2D,代码行数:13,代码来源:GameScene.cs

示例6: loadResource

 public static void loadResource(ContentManager Content)
 {
     plant = new Texture2D[5];
     plant[0] = Content.Load<Texture2D>("UI/carrotIcon");
     plant[1] = Content.Load<Texture2D>("UI/tomatoIcon");
     plant[2] = Content.Load<Texture2D>("UI/eggplantIcon");
     plant[3] = Content.Load<Texture2D>("UI/bananaIcon");
     plant[4] = Content.Load<Texture2D>("UI/watermelonIcon");
 }
开发者ID:griffenclaw,项目名称:Farm,代码行数:9,代码来源:HUD.cs

示例7: GameWorld

    public GameWorld(int width, int height, ContentManager Content)
    {
        screenWidth = width;
        screenHeight = height;
        random = new Random();
        gameState = GameState.Menu;
        inputHelper = new InputHelper();
        block = Content.Load<Texture2D>("block");
        reset = Content.Load<Texture2D>("reset");
        font = Content.Load<SpriteFont>("SpelFont");
        font2 = Content.Load<SpriteFont>("SpriteFont1");
        font3 = Content.Load<SpriteFont>("SpriteFont2");
        playButton = Content.Load<Texture2D>("Play");
        optionsButton = Content.Load<Texture2D>("Options");
        backButton = Content.Load<Texture2D>("Back");
        polytris = Content.Load<Texture2D>("Polytris");
        grid = new TetrisGrid(block);
        level = 1;
        levelspeed = 1;
        score = 0;
        i = (int)random.Next(7) + 1;
        i2 = (int)random.Next(7) + 1;
        blockcounter = 1;

        blocks = new BlockList(block, Content);          //Voegen de verschillende blockobjecten toe aan de lijst
        block1 = new Block1(block, Content);
        blocks.Add(block1, 1);
        block2 = new Block2(block, Content);
        blocks.Add(block2, 2);
        block3 = new Block3(block, Content);
        blocks.Add(block3, 3);
        block4 = new Block4(block, Content);
        blocks.Add(block4, 4);
        block5 = new Block5(block, Content);
        blocks.Add(block5, 5);
        block6 = new Block6(block, Content);
        blocks.Add(block6, 6);
        block7 = new Block7(block, Content);
        blocks.Add(block7, 7);

        //Voegen de verschillende blockobjecten toe aan een tweede lijst voor het tekenen van het volgende blokje
        block1res = new Block1(block, Content);
        blocks.AddToReserve(block1res, 1);
        block2res = new Block2(block, Content);
        blocks.AddToReserve(block2res, 2);
        block3res = new Block3(block, Content);
        blocks.AddToReserve(block3res, 3);
        block4res = new Block4(block, Content);
        blocks.AddToReserve(block4res, 4);
        block5res = new Block5(block, Content);
        blocks.AddToReserve(block5res, 5);
        block6res = new Block6(block, Content);
        blocks.AddToReserve(block6res, 6);
        block7res = new Block7(block, Content);
        blocks.AddToReserve(block7res, 7);

        options = new Options(block, reset, backButton, width, height, font, blocks);
        menu = new Menu(playButton, optionsButton, polytris, width, height);
        gameOver = new GameOver(backButton, width, height);
    }
开发者ID:Supercarlijn,项目名称:Tetris,代码行数:60,代码来源:GameWorld.cs

示例8: GameWorld

    public GameWorld(int width, int height, ContentManager Content)
    {
        screenWidth = width;
        screenHeight = height;
        random = new Random();
        gameState = GameState.Playing;

        block = Content.Load<Texture2D>("block");
        font = Content.Load<SpriteFont>("SpelFont");
        grid = new TetrisGrid(block);
    }
开发者ID:OlymposDieu,项目名称:Tetris,代码行数:11,代码来源:GameWorld.cs

示例9: Load

        public void Load(ContentManager content)
        {
            //MapGame = game;

            // load map
            //map = content.Load<Map>("Maps/Start");
            map.Texture = content.Load<Texture2D>("Textures/tileSet");
            font = content.Load<SpriteFont>("Arial");

            map.Load();
        }
开发者ID:blackwaltzone,项目名称:Parallel_Worlds_RPG,代码行数:11,代码来源:MapEngine.cs

示例10: Intro

 public override void Intro( params object [] args )
 {
     contentManager = new ContentManager ( FileSystemManager.GetFileSystem ( "ManifestFileSystem" ) );
     contentManager.AddDefaultContentLoader ();
     LiqueurSystem.Launcher.InvokeInMainThread ( () =>
     {
         titleFont = contentManager.Load<TrueTypeFont> ( "Test.Game.Dodge.Resources.GameFont.ttf", 64 );
         menuFont = contentManager.Load<TrueTypeFont> ( "Test.Game.Dodge.Resources.GameFont.ttf", 24 );
     } );
     base.Intro ( args );
 }
开发者ID:Daramkun,项目名称:ProjectLiqueur,代码行数:11,代码来源:MenuScene.cs

示例11: Initialise

    /// <summary>
    /// Initialises the asset manager.
    /// </summary>
    /// <param name="coMan"></param>
    public static void Initialise(ContentManager coMan)
    {
        if (coMan != null)
        {
            coManager = coMan;

            DefTexture = coMan.Load<Texture2D>("Default/DefTexture");
            DefFont = coMan.Load<SpriteFont>("Default/DefFont");
        }
        else
            Console.WriteLine("The content manager send to the Asset class was null (empty)!");
    }
开发者ID:JonneDeurloo,项目名称:ParticleWorkshop,代码行数:16,代码来源:Asset.cs

示例12: Cannon

    public Cannon(ContentManager Content)
    {
        this.cannonBarrel = Content.Load<Texture2D>("spr_cannon_barrel");
        barrelPosition = new Vector2(72, 405);
        barrelOrigin = new Vector2(cannonBarrel.Height, cannonBarrel.Height) / 2;

        this.colorRed = Content.Load<Texture2D>("spr_cannon_red");
        this.colorBlue = Content.Load<Texture2D>("spr_cannon_blue");
        this.colorGreen = Content.Load<Texture2D>("spr_cannon_green");
        currentColor = colorBlue;
        Color = Color.Blue;
        colorOrigin = new Vector2(currentColor.Width, currentColor.Height) / 2;
    }
开发者ID:pienpien34,项目名称:BalloonFW,代码行数:13,代码来源:Cannon.cs

示例13: Paddle

    public int Playertype; // 0 = Human, 1 = Computer

    public Paddle(ContentManager Content, GraphicsDeviceManager graphics, int x, int y, int playerType)
    {
        xloc = x;
        yloc = y;
        Position = new Vector2(xloc, yloc); // inladen positie van 'Position' met variabelen xloc en yloc.
        blauweSpeler = Content.Load<Texture2D>("blauweSpeler");
        rodeSpeler = Content.Load<Texture2D>("rodeSpeler");
        BoundsPaddle = blauweSpeler.Bounds;
        BoundsPaddle.X = (int)Position.X;
        BoundsPaddle.Y = (int)Position.Y;
        Playertype = playerType;

    }
开发者ID:Lunaface,项目名称:Pong,代码行数:15,代码来源:Paddle.cs

示例14: Intro

        public override void Intro( params object [] args )
        {
            contentManager = new ContentManager ( FileSystemManager.GetFileSystem ( "ManifestFileSystem" ) );
            contentManager.AddDefaultContentLoader ();

            audio1 = contentManager.Load<IAudio> ( "Test.Game.PlaySound.Resources.test1.ogg" );
            audio2 = contentManager.Load<IAudio> ( "Test.Game.PlaySound.Resources.test2.ogg" );

            font = contentManager.Load<TrueTypeFont> ( "Test.Game.PlaySound.Resources.GameFont.ttf", 20 );

            Add ( InputHelper.CreateInstance () );

            base.Intro ( args );
        }
开发者ID:Daramkun,项目名称:ProjectLiqueur,代码行数:14,代码来源:Container.cs

示例15: LoadContent

		public override void LoadContent(ContentManager content)
		{
			base.LoadContent(content);

			_ascii = content.Load<TileSet>("TileSets/ASCII.xml");
			
			var progress = new Progress<string>(message => _progressMessages.Push(message));
			content.Load<BlockRegistry>("Blocks/SampleBlockRegistry.xml");
			ItemRegistry.Instance.Initialize();

			_loadingTask = Task.Run(() =>
			{
				_level = new Level(ChunkType.Overworld);
				var chunk = _level[ChunkLayer.Floor, 0, 0]; // generate the first chunk
			}).ContinueWith(x => Thread.Sleep(100));
		}
开发者ID:treytomes,项目名称:ASCIIWorld2,代码行数:16,代码来源:LoadWorldGameState.cs


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