Class ContentBuilder
- Assembly
- MonoGame.Framework.Content.Pipeline.dll
This class is the entry point for the content builder system.
public abstract class ContentBuilder
- Inheritance
-
ContentBuilder
- Inherited Members
Properties
ContentCache
Gets or sets the content cahcing system to be used by the ContentBuilder.
public virtual IContentCache ContentCache { get; init; }
Property Value
FailedToBuild
Returns the number of content items that failed to build.
public uint FailedToBuild { get; }
Property Value
Logger
Gets or sets the logger to be used by the ContentBuilder.
public ContentBuildLogger Logger { get; set; }
Property Value
- ContentBuildLogger
ContentBuildLogger by default.
Parameters
Parameters to be used by the ContentBuilder or any of its subsystems.
Can be passed from CLI args, see Run(string[]).
public ContentBuilderParams Parameters { get; set; }
Property Value
SucceededToBuild
Returns the number of content items that built successfully.
public uint SucceededToBuild { get; }
Property Value
Methods
BuildAndLoadContent(string, ContentInfo)
Initiates a build of the specified asset and then loads the result into memory.
public (ContentFileCache? contentFileCache, object? processedObject) BuildAndLoadContent(string relativePath, ContentInfo contentInfo)
Parameters
relativePath
stringA relative path to the source asset.
contentInfo
ContentInfoThe desired ContentInfo to be used for the content building.
Returns
BuildAndWriteContent(string, ContentInfo)
Initiates a build of the specified asset and then writes down the result to disk..
public ContentFileCache? BuildAndWriteContent(string relativePath, ContentInfo contentInfo)
Parameters
relativePath
stringA relative path to the source asset.
contentInfo
ContentInfoThe desired ContentInfo to be used for the content building.
Returns
GetContentCollection()
Called to build system to gather information about how to handle the content. It gets called only once during initialization.
public abstract IContentCollection GetContentCollection()
Returns
- IContentCollection
An IContentCollection that contains information about the content handling.
Run(ContentBuilderParams)
Runs the ContentBuilder with the specified parameters.
public bool Run(ContentBuilderParams parameters)
Parameters
parameters
ContentBuilderParamsA ContentBuilderParams describing both the platform paramteres for the content compilation as well as the configuration of the ContentBuilder itself.
Returns
Run(string[])
A helper method to run the ContentBuilder with the passed ContentBuilderParams from the entry point args.
public void Run(string[] args)
Parameters
args
string[]An array of string to be deserialized into ContentBuilderParams.