|
|
|||||
Как создать такой класс?
Добрый вечер.
Понимаю, что вопрос несуразный но суть такова. Я пишу игру на HAXE У меня есть класс CosmoFont, который расширяет TextField. package; import openfl.Assets; import openfl.text.TextField; import openfl.text.TextFieldAutoSize; import openfl.text.TextFormat; /** * ... * @author Volodin A.S. */ class CosmoFont1 extends TextField { public function new(txt:String, x:Float=0, y: Float=0, size:Int=22, color:Int=0x000000, autosize:String = "l") { super(); this.x = x; this.y = y; var textFormat: TextFormat = new TextFormat(); textFormat.color = color; textFormat.size = size; textFormat.font = Assets.getFont("fonts/CosmoFont1.ttf").fontName; defaultTextFormat = textFormat; embedFonts = true; switch(autosize) { case "l": autoSize = TextFieldAutoSize.LEFT; case "r": autoSize = TextFieldAutoSize.RIGHT; case "c": autoSize = TextFieldAutoSize.CENTER; default: autoSize = TextFieldAutoSize.LEFT; } mouseEnabled = false; this.text = txt; } } Выходит нечто вроде этого: Вопрос: как мне создать класс, который можно будет настраивать постепенно (ИЛИ в конструкторе)? Имею в виду:
__________________
Надо сменить подпись... |
Часовой пояс GMT +4, время: 10:28. |
|
« Предыдущая тема | Следующая тема » |
|
|