diff options
Diffstat (limited to 'BitmapChar.cs')
-rw-r--r-- | BitmapChar.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/BitmapChar.cs b/BitmapChar.cs index 432dce8..12d3aae 100644 --- a/BitmapChar.cs +++ b/BitmapChar.cs @@ -227,6 +227,44 @@ namespace BitmapFontEd m_changed=true;
}
+ public void Glow(Color col)
+ {
+ Color[,] d=new Color[m_width,m_height];
+
+ // I'm sure this is too convoluted...
+ //
+ for(int y=0;y<m_height;y++)
+ for(int x=0;x<m_width;x++)
+ d[x,y]=Color.Black;
+
+ for(int y=0;y<m_height;y++)
+ for(int x=0;x<m_width;x++)
+ if (m_data[x,y]!=Color.Black)
+ {
+ for(int dx=-1;dx<2;dx++)
+ for(int dy=-1;dy<2;dy++)
+ {
+ int nx=x+dx;
+ int ny=y+dy;
+
+ if (nx>=0 && nx<m_width && ny>=0 && ny<m_height &&
+ m_data[nx,ny]==Color.Black)
+ {
+ d[nx,ny]=col;
+ }
+ }
+ }
+
+ for(int y=0;y<m_height;y++)
+ for(int x=0;x<m_width;x++)
+ if (d[x,y]!=Color.Black)
+ {
+ m_data[x,y]=d[x,y];
+ }
+
+ m_changed=true;
+ }
+
public void Output(Stream stream)
{
Util.WriteUint(stream,m_width);
|