Prev | Current Page 691 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

ttf is included in the produced
movie and used directly in SWFMill to create a text field:
< ?xml version=???1.0??? encoding=???iso-8859-1??? ? >
< movie width=???200??? height=???60??? framerate=???20??? >
< frame > < /frame >
< font id=???nicefont??? name=???Nice Font??? import=???library/nicefont.ttf???/ >
< textfield id=???firstlabel??? font=???nicefont??? width=???200??? height=???30??? size=???20???
text=???First Label??? useOutlines=???1??? / >
< place id=???firstlabel??? name=???fl??? / >
< /movie >
The font element is not inside a library element because otherwise it is necessary to define a class for it
in the haXe code. This is not necessary because the font utilization works differently from clips; the fonts
are referenced in the haXe code using their internal name, Nice Font in this case, and not a class type.
In the haXe example, a second text field is defined at run time and the embedded font is assigned to it.
The embedFonts field must be set to true or otherwise the player will try to use a default system font.


Pages:
679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703