Example #1
0
 private Texture2D CreateIcon()
 {
     if (!this.HasFile("icon.png"))
     {
         return(((Asset <Texture2D>)((IAssetRepository)XnaExtensions.Get <IAssetRepository>(this._services)).Request <Texture2D>("Images/UI/DefaultResourcePackIcon", (AssetRequestMode)1)).Value);
     }
     using (Stream stream = this.OpenStream("icon.png"))
         return((Texture2D)((AssetReaderCollection)XnaExtensions.Get <AssetReaderCollection>(this._services)).Read <Texture2D>(stream, ".png"));
 }
 private Texture2D CreateIcon()
 {
     if (!HasFile("icon.png"))
     {
         return(XnaExtensions.Get <IAssetRepository>(_services).Request <Texture2D>("Images/UI/DefaultResourcePackIcon", Main.content, (AssetRequestMode)1).Value);
     }
     using Stream stream = OpenStream("icon.png");
     return(XnaExtensions.Get <AssetReaderCollection>(_services).Read <Texture2D>(stream, ".png"));
 }