Prev | Current Page 989 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

The reason for this is that it can cause a few glitches with the rendering of
your other applications, sometimes causing the NME program to crash. If you need to run your NME
application in a window, try using a Timer to manage the speed of your loop, instead. Timer s are
discussed later in this chapter.
Writing Text to the Display
Text is written to the display device using literal font files, which need to be stored somewhere in the
applications directory structure. In most of the examples in this chapter where text is used, an Arial
.ttf file is used in the same location as the executed script file. Failure to find this file when running
your application may cause it to crash. We hope to have this resolved in a future release of NME.
Text in applications plays a big part, though using text in NME is extremely simple. So simple in fact,
that the class that deals with writing text to the display, the TTF class, only has one single method.
var textStr : String = ???Hello, World!???;
var font : String = ???Arial.


Pages:
977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001