Tinkr2/4.2/AphelionCore/AphelionCore/Core/Core.cs
/// <summary>
/// Draws a 4 pixel wide alpha blended shadow inside the supplied area.
/// </summary>
/// <param name="x">X location of the region to be shadowed.</param>
/// <param name="y">Y location of the region to be shadowed.</param>
/// <param name="width">Width of the region to be shadowed.</param>
/// <param name="height">Height of the region to be shadowed.</param>
/// <param name="color">Color to use when rendering shadow.</param>
Draws a 4 pixel wide alpha blended shadow inside the supplied area.
Draws a 4 pixel wide alpha blended shadow inside the supplied area .
public static void ShadowRegionInset(int x, int y, int width, int height, Color color = Colors.Black)
      {
         ushort[] alpha = { 76, 51, 26, 13 };
         int i;
         int v1 = 0;
         int v2 = 1;
         int v3 = 2;
         for (i = 0; i < alpha.Length; i++)
         {
            _instance._screen.DrawRectangle(0, 0, x + v1, y + v1, width - v1, 1, 0, 0, color, 0, 0, color, 0, 0, alpha[i]);
            _instance._screen.DrawRectangle(0, 0, x + v1, y + height - v2, width - v1, 1, 0, 0, color, 0, 0, color, 0, 0, alpha[i]);
            _instance._screen.DrawRectangle(0, 0, x + v1, y + v2, 1, height - v3, 0, 0, color, 0, 0, color, 0, 0, alpha[i]);
            _instance._screen.DrawRectangle(0, 0, x + width - v2, y + v2, 1, height - v3, 0, 0, color, 0, 0, color, 0, 0, alpha[i]);
            v1 += 1;
            v2 += 1;
            v3 += 1;
         }
      }
public static void ShadowRegionInset ( int x , int y , int width , int height , Color color = Colors . Black ) { ushort [ ] alpha = { 76 , 51 , 26 , 13 } ; int i ; int v1 = 0 ; int v2 = 1 ; int v3 = 2 ; for ( i = 0 ; i < alpha . Length ; i ++ ) { _instance . _screen . DrawRectangle ( 0 , 0 , x + v1 , y + v1 , width - v1 , 1 , 0 , 0 , color , 0 , 0 , color , 0 , 0 , alpha [ i ] ) ; _instance . _screen . DrawRectangle ( 0 , 0 , x + v1 , y + height - v2 , width - v1 , 1 , 0 , 0 , color , 0 , 0 , color , 0 , 0 , alpha [ i ] ) ; _instance . _screen . DrawRectangle ( 0 , 0 , x + v1 , y + v2 , 1 , height - v3 , 0 , 0 , color , 0 , 0 , color , 0 , 0 , alpha [ i ] ) ; _instance . _screen . DrawRectangle ( 0 , 0 , x + width - v2 , y + v2 , 1 , height - v3 , 0 , 0 , color , 0 , 0 , color , 0 , 0 , alpha [ i ] ) ; v1 += 1 ; v2 += 1 ; v3 += 1 ; } }
Draws a 4 pixel wide alpha blended shadow inside the supplied area.
Draws a 4 pixel wide alpha blended shadow inside the supplied area .
x
int
X location of the region to be shadowed.
X location of the region to be shadowed .
y
int
Y location of the region to be shadowed.
Y location of the region to be shadowed .
width
int
Width of the region to be shadowed.
Width of the region to be shadowed .
height
int
Height of the region to be shadowed.
Height of the region to be shadowed .
color
Color
Color to use when rendering shadow.
Color to use when rendering shadow .