require( "scripts/style.lua" );

local kDefaultShadowOff_x = -2;
local kDefaultShadowOff_y = 3;
local kDefaultShadowColor = BlackColor;

function ShadowText( text )
	return function()
        local off_x = GetTag(text,"shadow_off_x");
        local off_y = GetTag(text,"shadow_off_y");
        local color = GetTag(text,"shadow_color");
        
        if (not off_x) then
            off_x = kDefaultShadowOff_x;
        end;
        if (not off_y) then
            off_y = kDefaultShadowOff_y;
        end;
        if (not color) then
            color = kDefaultShadowColor;
        end;
        
        local original_color = text.font[3];
        
        text.typename='Text';
        text.x = text.x + off_x;
        text.y = text.y + off_y;
        text.font[3] = color;
        DoWindow( text );
        text.x = text.x - off_x;
        text.y = text.y - off_y;
        text.font[3] = original_color;
        DoWindow( text );
    end;
end;
