![New Eagle Raptor VeeCAN 800 Скачать руководство пользователя страница 18](http://html.mh-extra.com/html/new-eagle/raptor-veecan-800/raptor-veecan-800_getting-started_1677308018.webp)
17
In this example there’s a
Draw Text
block centered on a point. (i.e. Both horizontal and vertical
alignment are set to center.) There is a
Printf
block with a format string, “
My Value = %d
”. Raptor™
reads this string and recognizes that there is one integer parameter, and creates an input port on the
block according. Finally, there is an empty Raptor™ String initialized to 20 characters wide to hold the
output value. There is also a custom subsystem that increments a number from zero once a second to
give us some sample data to change live at runtime.
Figure 3.2.5.b – Basic Example to Draw Text
The above example will draw text on the screen, updating the text value every second. The
problem with this approach is that Raptor™ will not clear the previous string before drawing the next
one. The result will be a strange overlapped string drawn on the screen.
To updated strings from being written over old ones the easiest technique is to put the live
element being drawn into a function call subsystem triggered by the
Element
block. This will ensure that
the entire area being written is cleared in between each successive redraw.
Figure 3.2.5.c – Drawing Text in an
Element
Block Triggered Subsystem