Welcome Guest! To enable all features please Login or Register.



Go to last post Go to first unread
Offline Aravol  
#1 Posted : Saturday, December 28, 2013 2:18:07 AM(UTC)

Joined: 12/26/2013(UTC)
Posts: 11
Location: New Mexico

So, I have looked through the tutorials, the documentation, and made at least a few attempts to work wit the Delta Engine system, and will soon be starting on a project at the behest of a friend, wherein we're going to make a Visual Novel. For those not familiar, these are, in a nutshell, a choose your own adventure story. As such, keeping the images invisible to the player until they go through the story is critical.

What I'd like to do is make a custom extension of the Content Loader class, which will utilize Embedded Resources instead of those on the disk or downloaded from DE, so as to keep the images out of the filesystem and thus out of direct access from the player. My only question now is whether someone has already done this and would be willing to share.

As always, my work will be posted to the main repository once completed, and I would be happy for any advice on extending the Content Loading mechanics.

Wanna join the discussion?! Login to your forum accountregister a new account. Or Connect via Facebook Twitter Google

Offline Benjamin  
#2 Posted : Saturday, December 28, 2013 9:35:57 AM(UTC)

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
As a starting point you should look at the DiskContentLoader, which is very simple or the MockContentLoader, which just pretends to load content for quick unit tests. You can derive from DiskContentLoader and overwrite the GetContentDataStream method:


	protected virtual Stream GetContentDataStream(ContentData content)
			if (String.IsNullOrEmpty(content.MetaData.LocalFilePath))
				return Stream.Null;
			string filePath = Path.Combine(contentPath, content.MetaData.LocalFilePath);
			//Instead of File.OpenRead(filePath) do something else
Offline Aravol  
#3 Posted : Sunday, December 29, 2013 1:21:06 AM(UTC)

Joined: 12/26/2013(UTC)
Posts: 11
Location: New Mexico

And now it is done, changes are in, forks has been made.

Ended up making the resource loader as a sibling of DiskContentLoader instead of inheriting, since Embedded Resrouces call for dot-notation through subfolders.

Currently requires that the ContentMetaData be located in the root (available as AssemblyName.ContentMetaData.xml) and contain all resources with their full Path name (including the Assembly name they belong to). Hope this helps more people than just me!
Rss Feed  Atom Feed
Users browsing this topic
OceanSpiders 2.0
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2023, Yet Another Forum.NET
This page was generated in 0.050 seconds.