Fonteditor/Character.cs
/// <summary>
/// Fills the characters palette entry matrix with the image of a character in a given font
/// </summary>
Fills the characters palette entry matrix with the image of a character in a given font
Fills the characters palette entry matrix with the image of a character in a given font
public void FillMatrixFromCharacter(char c, Font font, int offsetX, int offsetY, byte paletteIndex)
        {
            int picWidth = Width;
            int picHeight = Height;
            Bitmap b = Utils.CreateFontPicture(c, font, picWidth, picHeight,  offsetX, offsetY);
            for (int y = 0; y < Height; y++)
            {
                for (int x = 0; x < Width; x++)
                {
                    int colorID = Constants.BACKGROUND_COLOR_ID;
                    Color color = b.GetPixel(x, y);
                    if (color.R < 128)
                    {
                        colorID = paletteIndex;
                    }
                    Matrix[x, y] = (byte)colorID;
                }
            }
        }
public void FillMatrixFromCharacter ( char c , Font font , int offsetX , int offsetY , byte paletteIndex ) { int picWidth = Width ; int picHeight = Height ; Bitmap b = Utils . CreateFontPicture ( c , font , picWidth , picHeight , offsetX , offsetY ) ; for ( int y = 0 ; y < Height ; y ++ ) { for ( int x = 0 ; x < Width ; x ++ ) { int colorID = Constants . BACKGROUND_COLOR_ID ; Color color = b . GetPixel ( x , y ) ; if ( color . R < 128 ) { colorID = paletteIndex ; } Matrix [ x , y ] = ( byte ) colorID ; } } }
Fills the characters palette entry matrix with the image of a character in a given font
Fills the characters palette entry matrix with the image of a character in a given font
c
char
font
Font
offsetX
int
offsetY
int
paletteIndex
byte