Skip to content

Full outline rather than shadow on FlxText #234

@michaelplzno

Description

@michaelplzno

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));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions