1
0
mirror of synced 2024-12-01 02:27:22 +01:00

Some bxfnt adjustments with columns

This commit is contained in:
KillzXGaming 2020-03-23 20:21:47 -04:00
parent 8c6b547900
commit 42304f5687
4 changed files with 11 additions and 9 deletions

View File

@ -381,7 +381,7 @@ namespace FirstPlugin
float XScale = (fontWidth / TextureGlyph.CellWidth);
float YScale = (fontHeight / TextureGlyph.CellWidth);
float height = (TextureGlyph.SheetHeight - 2) / TextureGlyph.LinesCount;
float height = (TextureGlyph.SheetHeight - 2) / TextureGlyph.ColumnCount;
/* int pos = 0;
for (int i = 0; i < text.Length; i++)
@ -432,7 +432,7 @@ namespace FirstPlugin
BitmapFont f = new BitmapFont();
f.LineHeight = FontInfo.LineFeed;
Bitmap[] Chars = new Bitmap[TextureGlyph.LinesCount * TextureGlyph.RowCount * TextureGlyph.SheetCount];
Bitmap[] Chars = new Bitmap[TextureGlyph.ColumnCount * TextureGlyph.RowCount * TextureGlyph.SheetCount];
float realcellwidth = TextureGlyph.CellWidth + 1;
float realcellheight = TextureGlyph.CellHeight + 1;
@ -450,7 +450,7 @@ namespace FirstPlugin
BitmapData bd = SheetBM.LockBits(new Rectangle(0, 0, SheetBM.Width, SheetBM.Height),
ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
for (int y = 0; y < TextureGlyph.LinesCount; y++)
for (int y = 0; y < TextureGlyph.ColumnCount; y++)
{
for (int x = 0; x < TextureGlyph.RowCount; x++)
{

View File

@ -56,7 +56,7 @@ namespace FirstPlugin
mapping.Add("Sheet_Height", texInfo.SheetHeight.ToString());
mapping.Add("Sheet_Width", texInfo.SheetWidth.ToString());
mapping.Add("RowCount", texInfo.RowCount.ToString());
mapping.Add("LinesCount", texInfo.LinesCount.ToString());
mapping.Add("LinesCount", texInfo.ColumnCount.ToString());
return mapping;
}

View File

@ -37,7 +37,7 @@ namespace FirstPlugin
public ushort BaseLinePos { get; set; }
public ushort Format { get; set; }
public ushort RowCount { get; set; }
public ushort LinesCount { get; set; }
public ushort ColumnCount { get; set; }
public ushort SheetWidth { get; set; }
public ushort SheetHeight { get; set; }
public List<byte[]> SheetDataList = new List<byte[]>();
@ -67,7 +67,7 @@ namespace FirstPlugin
Format = reader.ReadUInt16();
RowCount = reader.ReadUInt16();
LinesCount = reader.ReadUInt16();
ColumnCount = reader.ReadUInt16();
SheetWidth = reader.ReadUInt16();
SheetHeight = reader.ReadUInt16();
@ -115,7 +115,7 @@ namespace FirstPlugin
writer.Write(Format);
writer.Write(RowCount);
writer.Write(LinesCount);
writer.Write(ColumnCount);
writer.Write(SheetWidth);
writer.Write(SheetHeight);
long _ofsSheetBlocks = writer.Position;

View File

@ -33,6 +33,8 @@ namespace FirstPlugin.Forms
return new List<IFileFormat>() { FileFormat };
}
public void BeforeFileSaved() { }
private Image PanelImage { get; set; }
private BitmapFont bitmapFont;
@ -288,10 +290,10 @@ namespace FirstPlugin.Forms
PanelImage = BitmapExtension.Resize(PanelImage, textureGlyph.SheetWidth, textureGlyph.SheetHeight);
int y = 0;
for (int c = 0; c < (int)textureGlyph.RowCount; c++)
for (int c = 0; c < (int)textureGlyph.ColumnCount; c++)
{
int x = 0;
for (int r = 0; r < (int)textureGlyph.LinesCount; r++)
for (int r = 0; r < (int)textureGlyph.RowCount; r++)
{
var rect = new Rectangle(x, y, textureGlyph.CellWidth, textureGlyph.CellHeight);