-
Notifications
You must be signed in to change notification settings - Fork 3
/
EmbossedText.as
executable file
·58 lines (47 loc) · 1.47 KB
/
EmbossedText.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package
{
import org.flixel.FlxText;
import flash.text.AntiAliasType;
import flash.text.TextFormat;
/**
* ...
* @author Nicholas 'A' Feinberg
*/
public class EmbossedText extends FlxText
{
[Embed(source='misc/CryptOf1950.ttf', fontFamily="cryptOf1950")] public static const magicFont:String;
[Embed(source='misc/CryptOfTomorrow.ttf', fontFamily="cryptOfTomorrow")] public static const magicerFont:String;
public function EmbossedText(X:Number, Y:Number, Width:uint, Text:String=null) {
super(X, Y, Width, Text);
//_tf.antiAliasType = AntiAliasType.ADVANCED;
//_tf.sharpness = -400;
font = "cryptOfTomorrow";
color = 0x404040;
shadow = 0xffffff;
}
override protected function renderShadow(tfa:TextFormat):void {
_tf.setTextFormat(new TextFormat(tfa.font,tfa.size,_shadow,null,null,null,null,null,tfa.align));
_mtx.translate(0,1);
_pixels.draw(_tf,_mtx,_ct);
_mtx.translate(0,-1);
_tf.setTextFormat(new TextFormat(tfa.font,tfa.size,tfa.color,null,null,null,null,null,tfa.align));
}
/*override public function render():void {
var tf:TextFormat;
tf = dtfCopy();
tf.color = 0xffffff;
_tf.defaultTextFormat = tf;
_tf.setTextFormat(tf);
calcFrame();
super.render();
y -= 1;
tf = dtfCopy();
tf.color = 0x404040;
_tf.defaultTextFormat = tf;
_tf.setTextFormat(tf);
calcFrame();
super.render();
y += 1;
}*/
}
}