ContentLoadException in MonoGame

后端 未结 5 718
夕颜
夕颜 2021-01-13 19:29

I\'ve been trying load a texture in MonoGame using Xamarin Studio. My code is set up as below :

#region Using Statements
using System;

using Microsoft.Xna.F         


        
5条回答
  •  庸人自扰
    2021-01-13 20:17

    Just use this way

    using (var stream = TitleContainer.OpenStream ("Content/charactersheet.png"))
    {
        characterSheetTexture = Texture2D.FromStream (this.GraphicsDevice, stream);
    
    }
    

    instead of

    texture = Content.Load("player");
    

提交回复
热议问题