Delta Engine
»
Support
»
Content
»
EmbeddedContentLoader
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.
|
|
|
|
Medals:  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: Code:
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
}
|
|
|
|
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!
|
|
|
|
Delta Engine
»
Support
»
Content
»
EmbeddedContentLoader
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.