![]() |
|
||||||||||
|
|
|
|||||
|
Регистрация: Dec 2013
Сообщений: 49
|
Подскажите как применить градиент к тексту?
var shape_mask_matrix:Matrix = new Matrix(); shape_mask_matrix.createGradientBox(255, 255, 90, 0, 0); var shape_mask:Shape = new Shape; shape_mask.graphics.beginGradientFill(GradientType.LINEAR, [0xd36300, 0xfcff00], [1, 1], [0,255], shape_mask_matrix); shape_mask.graphics.drawRect(25, 100, 500, 500); shape_mask.graphics.endFill(); var format_90:TextFormat = new TextFormat; format_90.font = 'Tahoma'; format_90.size = 90; format_90.color = 0xEFE284; format_90.bold = true; format_90.align = TextFormatAlign.CENTER; score_text = new TextField; score_text.defaultTextFormat = format_90; score_text.width = body.width; score_text.text = '12500'; score_text.y = text_top.y + 45; addChild(score_text); |
|
|||||
|
Регистрация: Dec 2013
Сообщений: 49
|
public class TextGold extends MovieClip { public var score_text:TextField; public function TextGold(_width:Number, _heidth:Number) { var format_90:TextFormat = new TextFormat; format_90.font = 'Tahoma'; format_90.size = 90; format_90.color = 0xEFE284; format_90.bold = true; format_90.align = TextFormatAlign.CENTER; score_text = new TextField; score_text.defaultTextFormat = format_90; score_text.width = _width; score_text.height = _heidth; score_text.text = '12500'; var shape_mask:Shape = new Shape; var shape_mask_matrix:Matrix = new Matrix(); shape_mask_matrix.createGradientBox(_width, _heidth, 90, 0, 0); shape_mask.graphics.beginGradientFill(GradientType.LINEAR, [0xd36300, 0xfcff00], [1, 1], [0,255], shape_mask_matrix); shape_mask.graphics.drawRect(0, 0, _width, _heidth); shape_mask.graphics.endFill(); shape_mask.cacheAsBitmap=true; score_text.cacheAsBitmap=true; addChild(score_text); addChild(shape_mask); shape_mask.mask = score_text; } Так как флеш не может применить прозрачность к не растровой графике... |
|
|||||
|
Регистрация: Dec 2013
Сообщений: 49
|
спс учту.
Кстати о шрифтах я так и не понял как в коде их использовать, после внедрения |
|
|||||
|
|
![]() |
![]() |
Часовой пояс GMT +4, время: 03:46. |
|
|
« Предыдущая тема | Следующая тема » |
| Опции темы | |
| Опции просмотра | |
|
|