I'm making a level-editor for a game, and I don't want to do "content->add and choose an image/sprite/texture" and then do Texture2D texture1 = Content.Load<Texture2D>(@"path\name");
, I want to add to my project every texture I need by OpenFileDialog
.
I already implemented the OpenFileDialog
, so I'm at the point when I have a file stream with my image. Now, how can I load the texture to be permanent in my content folder? (So I would have .xnb file?)
I read to do use the function Texture2D.FromStream(GraphicsDevice, filestream);
, but this doesn't create the .xnb file in my folder; i just need something that does the same thing as the usual way to load textures, with "content->add", ecc.
Thanks!
xnb
format and including them into your project automatically. Those are two separate problems I've seen solved before on this site. – user1306322