Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full outline rather than shadow on FlxText #234

Open
michaelplzno opened this issue Oct 27, 2012 · 1 comment
Open

Full outline rather than shadow on FlxText #234

michaelplzno opened this issue Oct 27, 2012 · 1 comment

Comments

@michaelplzno
Copy link

I know how to implement this as well and would be happy to post code if you'd like. I find it quite helpful. It would be very easy to make a Boolean property for FlxText, something like fullOutlineShadow, that when set to true makes the whole text outlined rather than just the lower right.

I just add these lines to FlxText at line 287:

if(_shadow > 0)
{
    _textField.setTextFormat(new TextFormat(formatAdjusted.font,formatAdjusted.size,_shadow,null,null,null,null,null,formatAdjusted.align));                
    _matrix.translate(1, 1);
    _pixels.draw(_textField, _matrix, _colorTransform);
    _matrix.translate(0, -1);
    _pixels.draw(_textField, _matrix, _colorTransform);
    _matrix.translate(0, -1);
    _pixels.draw(_textField, _matrix, _colorTransform);
    _matrix.translate( -1, 0);
    _pixels.draw(_textField, _matrix, _colorTransform);
    _matrix.translate(-1, 0);
    _pixels.draw(_textField, _matrix, _colorTransform);
    _matrix.translate(0, 1);
    _pixels.draw(_textField, _matrix, _colorTransform);
    _matrix.translate(0, 1);
    _pixels.draw(_textField, _matrix, _colorTransform);
    _matrix.translate(1, 0);
    _pixels.draw(_textField, _matrix, _colorTransform);

    _matrix.translate(0,-1);
    _textField.setTextFormat(new TextFormat(formatAdjusted.font,formatAdjusted.size,formatAdjusted.color,null,null,null,null,null,formatAdjusted.align));
}
@clarkin
Copy link

clarkin commented Nov 10, 2013

+1, this was very useful to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants