Gamua / Starling-Framework

The Cross Platform Game Engine
http://www.starling-framework.org
Other
2.87k stars 826 forks source link

Add "requiresRedraw" to starling.text.TextField #754

Closed MuaoLoniel closed 9 years ago

MuaoLoniel commented 9 years ago

Please add "requiresRedraw" to starling.text.TextField

I need it in my class:

public class WordWrapTextField extends starling.text.TextField
{
    private var mWordWrap:Boolean;

    override protected function formatText(textField:flash.text.TextField, textFormat:TextFormat):void
    {
        super.formatText(textField, textFormat);
        textField.wordWrap = mWordWrap;
    }

    public function get wordWrap ():Boolean { return mWordWrap }
    public function set wordWrap (value:Boolean):void
    {
        mWordWrap = value;
        super.requiresRedraw();
    }
}

Thanks.

PrimaryFeather commented 9 years ago

Thanks, that makes sense!

I just renamed the method to "requireRedraw" (note the missing "s"), though. The third person "s" makes sense for the member variable, but the method should be a verb.

... yeah, I'm a nit-picker, I know. :grin:

Thanks anyway!