mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-24 03:56:31 +00:00
Refactor BitmapFont (#887)
* Update file header * Created initial project to move BitmapFont too * XMl, Text, and Binar reading now supported for BMFont * Refactor BittmapFont * Update content pipeline from BitmapFont refactor * Update changelog
This commit is contained in:
committed by
GitHub
parent
1f0235c605
commit
66277568c8
@@ -1,22 +1,24 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.Xna.Framework.Content.Pipeline;
|
||||
using MonoGame.Extended.BitmapFonts.BmfTypes;
|
||||
|
||||
namespace MonoGame.Extended.Content.Pipeline.BitmapFonts
|
||||
{
|
||||
[ContentProcessor(DisplayName = "BMFont Processor - MonoGame.Extended")]
|
||||
public class BitmapFontProcessor : ContentProcessor<BitmapFontFile, BitmapFontProcessorResult>
|
||||
public class BitmapFontProcessor : ContentProcessor<ContentImporterResult<BmfFile>, BitmapFontProcessorResult>
|
||||
{
|
||||
public override BitmapFontProcessorResult Process(BitmapFontFile bitmapFontFile, ContentProcessorContext context)
|
||||
public override BitmapFontProcessorResult Process(ContentImporterResult<BmfFile> importerResult, ContentProcessorContext context)
|
||||
{
|
||||
try
|
||||
{
|
||||
BmfFile bmfFile = importerResult.Data;
|
||||
context.Logger.LogMessage("Processing BMFont");
|
||||
var result = new BitmapFontProcessorResult(bitmapFontFile);
|
||||
var result = new BitmapFontProcessorResult(bmfFile);
|
||||
|
||||
foreach (var fontPage in bitmapFontFile.Pages)
|
||||
foreach (var fontPage in bmfFile.Pages)
|
||||
{
|
||||
var assetName = Path.GetFileNameWithoutExtension(fontPage.File);
|
||||
var assetName = Path.GetFileNameWithoutExtension(fontPage);
|
||||
context.Logger.LogMessage("Expected texture asset: {0}", assetName);
|
||||
result.TextureAssets.Add(assetName);
|
||||
}
|
||||
@@ -30,4 +32,4 @@ namespace MonoGame.Extended.Content.Pipeline.BitmapFonts
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user