Some bxfnt adjustments with columns
This commit is contained in:
parent
8c6b547900
commit
42304f5687
@ -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++)
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user