Jump to content
  • Advertisement
Sign in to follow this  
mpipe

content pipeline tutorials

This topic is 3825 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone have some practical guides to using the content pipeline with your own content? I have a bunch of XML-serialized objects I'd like the content pipeline to load, but I'm not sure how to go about it. Also, is there a way to make the content pipeline read the binary data from an arbitrary stream, such as a memory stream?

Share this post


Link to post
Share on other sites
Advertisement
First one i didnt get.

Second, i use this to load from a pak system i got.

    
public class PAKContentManager : ContentManager
{
public string packname;
public string packdir;

Pak pak = new Pak();
public PAKContentManager(IServiceProvider serviceProvider)
: base(serviceProvider)
{
}

protected override Stream OpenStream(string assetName)
{
pak.OpenPack("Data/" + packname);
byte[] data = pak.GetFileData(assetName, packdir);
pak.Dispose();

MemoryStream stream = new MemoryStream(data);
return stream;
}
}



then to load somewhere (just an excample).

private PAKContentManager pakcontent;

and then init it
pakcontent = new PAKContentManager(Services);

then to load from a pak
Lists.defaultFont = pakcontent.Load<SpriteFont>("Arial.xnb");

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!